CPPUnit tests consistently die on failed assertions, rather than dumping their usual useful information. Originally, they would segfault upon reaching the failed assertion. I tried remerging cppunit and now they're "Aborted" with a SIGABRT. Reproducible: Always Steps to Reproduce: 1. Download the Dirt Simple CPPUnit example from their Wiki and copy it into a file (http://c2.com/cgi/wiki?DirtSimpleCppUnitExample) 2. Add "#include <cassert>" or remove all references to assert(). 3. Change line #123 from "CPPUNIT_ASSERT (1 == 1);" to "CPPUNIT_ASSERT (2 == 1);" 4. Compile and run: "g++ -g -o dirt dirt.cpp -lcppunit && ./dirt" 5. Or run with gdb: "gdb ./dirt" Actual Results: 4: ".Aborted" 5: Starting program: ./dirt . Program received signal SIGABRT, Aborted. 0x4f71f731 in kill () from /lib/libc.so.6 (gdb) back #0 0x4f71f731 in kill () from /lib/libc.so.6 #1 0x4f71f4d5 in raise () from /lib/libc.so.6 #2 0x4f720a7b in abort () from /lib/libc.so.6 #3 0x4fab88d7 in __cxa_call_unexpected () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libstdc++.so.5 #4 0x4fab8914 in std::terminate() () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libstdc++.so.5 #5 0x4fab8a86 in __cxa_throw () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libstdc++.so.5 #6 0x4002e30c in CppUnit::Asserter::fail(std::string, CppUnit::SourceLine) () from /usr/lib/libcppunit-1.8.so.0 Expected Results: Diagnostic output from CPPUnit describing the assertion that failed. This happens on all tests I try to run, including old tests that used to work fine for me and examples downloaded from cppunit. Thanks.
By the way, I'm using CPPUnit 1.8.0, GCC 3.3.2, Linux 2.6.5, and gdb 5.3.
Yagu, is this problem still present in the latest version? George, can you handle this one? It's been over a year.
Hi; thanks for checking in. I haven't used cppunit much in the past year but I went ahead and tried the same test I initially described using cppunit 1.10.2 and it seems to be working now -- no segfaults or aborts. However, I had to explicitly link with the dl library when compiling in order to import dlclose, dlopen, and dlsym: $ g++ -g -o test test.cpp -lcppunit -ldl Similar to Bug #49309
Then I guess we should close this bug. I retested the package and it seems to build Ok, however I have no reasonable means to check the result, as I do not use it. But considering nobody else had this problem (at least as far as bug reports go :)) I think we can rely on yago's testing. As for: >However, I had to explicitly link with the dl library when compiling in order >to import dlclose, dlopen, and dlsym: isn't this how C/C++ build system is supposed to work? George
> >However, I had to explicitly link with the dl library when compiling in order > >to import dlclose, dlopen, and dlsym: > isn't this how C/C++ build system is supposed to work? I'm no expert on this but you may want to review the bug I referenced (Bug #49309) since they don't seem to think so. Also, at the time I posted this bug, -ldl wasn't necessary. Thanks, George.