Is it theoretically and practically safe to use longjmp/setjmp instead, provided setjmp is set right before calling a dynamically generated function, and provided that longjmp never propagates through C++ functions that rely on RAII (I must make sure that none of runtime helpers implemented in C++ make use of...

It seems like both routines are wrong. Setjmp should not ignore floating point state and getcontext should not save r8,r9. Reference: http://www.boost.org/doc/libs/1_57_0/libs/context/doc/html/context/rationale/x86_and_floating_point_env.html...

There are SEVERAL problems with this code, some of which Joachim Pileborg points out. Another problem is that you only have one context, which you are using multiple times to store different data, yet expect the data to be there when you come back. The solution is to split your...

Believe it or not, the contents of jmp_buf are intentionally meaningless. If you take a look at the source to the x86_64 setjmp(), you'll note several references to PTR_MANGLE. This is an internal glibc macro which XORs a thread-local value against a register. This is used here in large part...