(English) boost::context and SEH

Этот пост пока не переведен на русский язык. Читать на Американский Английский

  1. I have stumbled upon the same problem: when an exception is thrown in a context, does not matter if handled or unhandled the application crashes. You wrote that this issue was fixed in boost 1.53. I use 1.57, but still I have the same problem. Is there maybe some special define to activate the fix?

    • G’day,
      well, this exact issue should have been fixed. I no longer work in the company where I investigated that problem but I think we verified the fix worked on 2008 server.
      On other windows versions exceptions work just fine as long as they are caught inside the context. I used exception mechanism extensively and haven’t had a single problem.
      Setting up a trap for all uncaught exceptions in the coroutine on Windows involves a bit of trickery but it’s relatively simple.

  2. Thanks for the answer! I have solved the problem another way: for each new context I want to create I start a new thread. Then I park this thread in a boost context. So during the normal operation I have such a context which came from a thread where the TIBs are also fine. When I want to dispose the context then I just simply switch the parked thread back to it and it automatically rewinds the stack too. Then the parking context can be thrown away without any problem.

    • Wow. That’s a hell of a workaround!
      But I suspect your problem worth reporting to Oliver (maintainer of boost::context), it could well be that you have stumbled upon yet another «undocumented feature».
      BTW, what windows version are you on and did you enable any special option in compiler flags? I’d love to try it myself.

Оставить комментарий

Примечание - Вы можете использовать эти HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

11 посетителей онлайн
6 гостей, 5 bots, 0 зарегистрированных
Максимум сегодня:: 20 в 12:49 am UTC
В этом месяце: 53 в 09-21-2021 08:53 am UTC
В этом году: 248 в 07-26-2021 10:24 am UTC
За все время: 332 в 11-22-2019 03:23 am UTC