Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CppUnit can't catch it's own exceptions

#5

The test mw::SchedulerTestFixture::testPeriod10HzNoPayloadChaffX4 sometimes fails. Even though the failure is due to a CPPUNIT_ASSERT, the reported failure message is "uncaught exception of unknown type". This message is generated at line 31 in DefaultProtector.cpp, in a catch(...) clause that follows catch clauses for CppUnit::Exception and std::exception.

Apparently, after CPPUNIT_ASSERT throws an instance of CppUnit::Exception, the runtime stack fails to unwind correctly. This leads to abort() being called, which generates the exception that's caught by the catch(...) clause.

I don't know why the stack fails to unwind. My best guess is that the exception has to pass through some C code that wasn't compiled with -fexceptions. However, adding -fexceptions to CFLAGS when building the mw_supporting stuff doesn't solve the problem.

Reported by Christopher Stawarz · February 12th, 2010 @ 03:32 PM

State: resolved
Milestone: 0.5.0
Assigned to: Christopher Stawarz Christopher Stawarz

Activity

  1. Christopher Stawarz
    Christopher Stawarz
    • State changed from new to open
    • Assigned user set to Christopher Stawarz

    This looks relevant: GCC 4.0 C++ Exception Bug

    June 23rd, 2010 @ 04:55 PM

  2. Christopher Stawarz
    Christopher Stawarz
    • State changed from open to resolved
    • Milestone order changed from 0 to 0

    Fixed in this commit. The trick was to move the test-running code from MWorksCoreTestRunner to MWorksCoreTest.framework, so that the CppUnit exceptions are both thrown and caught in the same shared library.

    January 25th, 2012 @ 03:47 PM

  3. Christopher Stawarz
    Christopher Stawarz
    • Milestone set to 0.5.0
    • Milestone order changed from 194868 to 0

    April 17th, 2012 @ 01:56 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.