Boost.Context: SIGSEGV when switch a thread within a catch block
Hi,
I get SIGSEGV on macOS when I switch an execution_context from a catch
block with one thread and than switch back with another thread.
Segmentation fault happens in libc++abi.dylib`__cxa_end_catch
Does anyone have any ideas, what it could be? Is it legal to switch
thread under an excecution_context while it's within a catch block?
A minimal example is here:
#include
not permitted - see http://www.boost.org/doc/libs/1_63_0/libs/context/doc/html/context/ecv2.html
Hi Oliver,
Thanks for your relay. Do you mean this statement in the documentation?
[image: [Important]]Important
Do not jump from inside a catch block and then re-throw the exception in
another execution context.
It's a bit unclear for me because I don't re-throw the exception neither in
one execution context nor in another.
Do you know how to address this issue? Is it addressed in Boost.Coroutines2?
In my case I play with a green-threads runtime and this limitation means
that I can't use asynchronous operations within exception handlers. It
looks artificial and also requires checks/modifications of the existing
code to make it compatible. :(
--
Thanks,
Alexander Pronchenkov
On Mon, 2 Jan 2017 at 08:31, Oliver Kowalke
not permitted - see http://www.boost.org/doc/libs/1_63_0/libs/context/doc/html/context/ecv2.html
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
you must no call jump-op inside a catch block - that means you can't use async-op handlers inside exception handler exceptions might be implemented using sj/lj - in general, exception handlers are handled/implemented in a special way.
Hi Oliver, I think it would make sense to slightly clarify the documentation: - Do not jump from inside a catch block and then re-throw the exception in another execution context. + Do not jump from inside a catch block. Otherwise it's a bit confusing because I don't re-throw exceptions in my case but the problem is here. Also, do you known whether it's safe to jump from inside of a try block? I'm asking because there is a not at https://docs.oracle.com/cd/E24457_01/html/E21991/bkahg.html that
... you must not longjmp into or out of a try-block or catch-block (directly or indirectly) ...
--
Thanks,
Alexander Pronchenkov
On 2 January 2017 at 10:09, Oliver Kowalke
you must no call jump-op inside a catch block - that means you can't use async-op handlers inside exception handler exceptions might be implemented using sj/lj - in general, exception handlers are handled/implemented in a special way.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Alexander G. Pronchenkov
-
Oliver Kowalke
-
Александр Пронченков