------- Additional Comments From rth at gcc dot gnu dot org 2005-03-24 22:34 ------- Sorry, but this test case is never going to work -- with either sjlj exceptions or unwind exceptions. By longjmp-ing from the middle of a catch clause, you've left the c++ library with live exceptions hanging around in global state. With unwind exceptions it may appear to work, but is sure to fail in subtle ways.
As for the more immediate segfault, real setjmp does not interoperate with sjlj exceptions, in that there is invisible eh state that needs to be managed behind your back, and that code is being bypassed. I suppose it wouldn't be impossible to extend this state manipulation to also catch calls to the system setjmp routine, but I certainly don't feel particularly motivated work on that. What I would strongly recommend is using either setjmp or exceptions, but not both. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20442