This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20442] [3.3/3.4/4.0 Regression] problem mixing C++ exceptions and setjmp/longjmp with SJLJ exceptions
- From: "rth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Mar 2005 22:34:44 -0000
- Subject: [Bug middle-end/20442] [3.3/3.4/4.0 Regression] problem mixing C++ exceptions and setjmp/longjmp with SJLJ exceptions
- References: <20050312174211.20442.paulthomas2@wanadoo.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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