john gateley - 2010-08-10

I am  using cppunit-1.12.1, gcc 4.5.0 (also happens with gcc 4.4.3) on Solaris 5.10. My tests are crashing when an exception is thrown. Analysis of the core dump reveals the crash happens inside of __cxa_allocate_exception, part of libstdc++. (This is C++ code).

I reduced this to the simplest possible case. It turns out to be caused by dynamically linking with a dynamic library (.so) containing the single object module This is just a main routine that has a try/catch around a throw, calling NO cppunit code, and linking against a library containing JUST that object module.

The crash happens if using the PIC or non-PIC version of The crash does NOT happen if
statically linking against a library, it must be dynamically linked.

LD_LIBRARY_PATH contains ONLY the directory with the dynamic library, and that directory has no other libraries.

The library doesn't contain any other object files. In particular, it does not contain DynamicLibraryManager.o.

Any help would be gratefully appreciated.