C
ChessManiac
Hi
I cannot use a method that is supposed to raise an exception,
because GCC *aborts* the program before throwing the exception !
The method belongs to a class that is inside a dynamic library
(provided by a vendor, so I cannot change it)
The program nevers go into the catch statements.
With the debugger I see the following :
In eh_throw.cc, GCC doesn't throw the exception but calls terminate instead !
I use g++ (GCC 3.2.2) the Operating System is Linux Debian/Woody
with a GLIBC 2.3
I tried many things (not successfully) such as compile with
-fexceptions, -pthread, -shared, -DTHREAD, -DPTHREADS, -DREENTRANT
and to link with lstdc++, -lpthread .....
Any idea ?
I cannot use a method that is supposed to raise an exception,
because GCC *aborts* the program before throwing the exception !
The method belongs to a class that is inside a dynamic library
(provided by a vendor, so I cannot change it)
try {
instance->Method();
}
catch (LIB::Exc &e) {
cout << "Exception handled" << endl;
}
catch (const std::exception& x) {
cerr << "Error : UNKNOWN STD EXCEPTION" << endl;
}
catch (...) {
cerr << "Error : UNKNOWN EXCEPTION" << endl;
}
The program nevers go into the catch statements.
With the debugger I see the following :
0x4092b721 in kill () from /lib/libc.so.6
#1 0x4043c771 in pthread_kill () from /lib/libpthread.so.0
#2 0x4043ca7b in raise () from /lib/libpthread.so.0
#3 0x4092b4d4 in raise () from /lib/libc.so.6
#4 0x4092c9e8 in abort () from /lib/libc.so.6
#5 0x408b2ba7 in __cxxabiv1::__terminate(void (*)()) (handler=0x4092c870 <abort>) at ../../../../gcc-3.2.2/libstdc++-v3/libsupc++/eh_terminate.cc:47
/opt/src/gcc-3.2.2/libstdc++-v3/libsupc++/eh_terminate.cc:47:1856:beg:0x408b2ba7
#6 0x408b2bf4 in std::terminate() () at ../../../../gcc-3.2.2/libstdc++-v3/libsupc++/eh_terminate.cc:57
#7 0x408b2d76 in __cxa_throw () at ../../../../gcc-3.2.2/libstdc++-v3/libsupc++/eh_throw.cc:77
/opt/src/gcc-3.2.2/libstdc++-v3/libsupc++/eh_throw.cc:77:2810:beg:0x408b2d76
#8 0x4028da68 in DtFederateMgr::testReadFedFile(RtiDtString, RtiDtString) () from libLIB.so
..... etc
In eh_throw.cc, GCC doesn't throw the exception but calls terminate instead !
I use g++ (GCC 3.2.2) the Operating System is Linux Debian/Woody
with a GLIBC 2.3
I tried many things (not successfully) such as compile with
-fexceptions, -pthread, -shared, -DTHREAD, -DPTHREADS, -DREENTRANT
and to link with lstdc++, -lpthread .....
Any idea ?