Throwing C++ exceptions from signal handlers

Andrew Haley aph@redhat.com
Thu Jun 10 09:10:00 GMT 2004


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.



More information about the Gcc mailing list