I have a test program called ftest. It downloads .so files containing the tests and runs the tests that it finds there. One of these tests downloads and runs .so, which contains the Postgres database driver for our O / RM.
When the Postgres driver throws an exception that is defined in this .so file (or the one to which it is bound, but ftest does not refer to) and falls into the test environment, the exception destructor calls segfault.
This segfault occurs whenever a compiled exception is found in a .so that has been dynamically loaded (using dload).
Things like this work fine on Windows with the same architecture. We really do not want to limit ourselves to using exceptions from the main libraries only - add-ons should be free to create our own exception classes and their normal operation.
Exceptions are subclasses of std :: exception. Sometimes exceptions can be defined in libraries (for example, libpqxx), which means that exceptions are sometimes also beyond our control.
Exceptions are thrown using:
throw exception_class( exception_arguments );
And caught with:
catch ( std::exception &e ) {
Is there any special compiler option needed for it to work? Do we need to switch to an exception through throw new exception_class( args ) (we really don't want to do this)?
source share