asynchronous-exceptions handling
Rabin Shahav (r53653)
r53653@email.sps.mot.com
Mon Jun 12 00:26:00 GMT 2000
// The -fasynchronous-exceptions flags is not
working !
// here is a sample of an exception thrown from a
signal
// handler. This exception terminates the program
although
// it is a wrapped with "catch" statement.
// Note: this bug doesn't occur on gcc-2.7.x!!!
// compile with g++ -v -g -fasynchronous-exceptions
a.cc
// on sun ultra1 running solaris 5.7
class DphError {
int errorNum;
};
#include <fstream.h>
#include <signal.h>
static void dphErrHandler(int intruptNumber)
{
cerr<<"Received signal\n";
throw DphError();
}
int my(const char * val)
{
//throw DphError();
cout<<strlen(val)<<endl;
}
int main(int argc, char *argv[]) {
signal(SIGSEGV,dphErrHandler);
try {
my(NULL);
} catch (...) {
cout << "catched"<<endl;
}
}
More information about the Gcc-bugs
mailing list