On 11/12/2017 15:11, Eric Blake wrote: > I don't know if there is a way to make gcc insert stack-unwind > directives that are honored across longjmp (I know C++ does it for > exceptions; so there may be a way, and I just don't know it).
Probably -fexceptions. Paolo > Conversely, I do know that pthread_cleanup_push/pop, which does > something similar, is permitted by POSIX to NOT work across longjmp: > > Calling longjmp(3) (siglongjmp(3)) produces undefined results > if any > call has been made to pthread_cleanup_push() or > pthread_cleanup_pop() > without the matching call of the pair since the jump buffer was > filled > by setjmp(3) (sigsetjmp(3)). Likewise, calling longjmp(3) > (sig‐ > longjmp(3)) from inside a clean-up handler produces undefined > results > unless the jump buffer was also filled by setjmp(3) > (sigsetjmp(3)) > inside the handler.
signature.asc
Description: OpenPGP digital signature