This issue has been discussed before on this list, see the thread at
gmane.comp.lib.boost.user/51628
I can confirm that the fix in 1.41 does indeed work for most regular
test cases. However I believe that there is still an issue when using
fixtures.
Below is a sample app which crashes for me when compiled with gcc on
MacOS X 10.6.2.
If someone could confirm that I'm not doing anything particularly
stupid, that would be appreciated.
#define BOOST_TEST_MODULE autoreg test
#include
struct Fixture
{
Fixture() : n(1) {}
unsigned n;
};
BOOST_AUTO_TEST_SUITE(AutoregTest)
BOOST_FIXTURE_TEST_CASE(Test1, Fixture)
{
BOOST_CHECK_EQUAL(n, 1);
}
BOOST_FIXTURE_TEST_CASE(Test2, Fixture)
{
BOOST_CHECK_EQUAL(n, 1);
}
BOOST_AUTO_TEST_SUITE_END()
% ./autoregtest
Running 2 test cases...
*** No errors detected
autoregtest(52796) malloc: *** error for object 0x30001002006d0:
pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Breakpoint 1, 0x00007fff818f5951 in malloc_error_break ()
(gdb) bt
#0 0x00007fff818f5951 in malloc_error_break ()
#1 0x00007fff8181f143 in free ()
#2 0x000000010006dc62 in ~framework_impl [inlined] () at
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_boost/work/boost_1_41_0/boost/test/impl/framework.ipp:133
#3
0x000000010006dc62 in __tcf_1 () at framework.ipp:225
#4 0x00007fff8182b334 in __cxa_finalize ()
#5 0x00007fff8182b24c in exit ()
#6 0x00000001000031e7 in start ()