(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>

7 посетителей онлайн
3 гостей, 4 bots, 0 зарегистрированных
Максимум сегодня:: 12 в 06:14 am UTC
В этом месяце: 26 в 11-14-2015 02:23 pm UTC
В этом году: 104 в 02-15-2015 05:03 am UTC
За все время: 130 в 10-22-2014 11:16 pm UTC