This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Throwing C++ exceptions from signal handlers
- From: Andrew Haley <aph at redhat dot com>
- To: "Yuval Kfir" <yuvalk at mainsoft dot com>
- Cc: <gcc at gcc dot gnu dot org>, "Noam Lampert" <noaml at mainsoft dot com>
- Date: Thu, 10 Jun 2004 10:09:45 +0100
- Subject: Throwing C++ exceptions from signal handlers
- References: <009201c44ec7$f9a33e20$410111ac@il.mainsoft.com>
Yuval Kfir writes:
> Hello,
> is it possible to somehow convince gcc to properly throw an exception from a
> signal handler context?
Yes, but only with synchronous exceptions like SIGSEGV and SIGFPE.
> In particular, I'd like to get the following program to run on Linux with
> gcc. On Solaris (with Sun's compiler) it works fine.
Hmm. This is a difficult thing to do in the general case. It raises
all sorts of problems to do with destructors and cleanup regions.
Andrew.