[Test] Memory leak with boost v1.40 under gcc 4.2 for x86_64 in Snow Leopard

[First time poster to boost] Compiling for the default x86_64 produces a memory leak in the test framework, but the same program compiled for i386 does not. Mac OS X Snow Leopard gcc 4.2 with macports boost 1.40.0 (same memory leak seen in v1.39 macports also). The memory leak only occurs with multiple test cases or test suites. Set the define in my test program to remove the extra test case, and the leak dissappears. Could not find this problem on the list, nor the 'net. Output is: <code> sroderick@mp tmp $ g++ -o boost-test-i386 -arch i386 /opt/code/tmp/ boost-test.cpp -I/opt/local/include -g sroderick@mp tmp $ g++ -o boost-test -arch x86_64 /opt/code/tmp/boost- test.cpp -I/opt/local/include -g sroderick@mp tmp $ ./boost-test Running 2 test cases... *** No errors detected boost-test(75819) malloc: *** error for object 0x3000100300780: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap sroderick@mp tmp $ ./boost-test-i386 Running 2 test cases... *** No errors detected </code> gdb backtrace for x86_64 program is: <code> (gdb) bt #0 0x00007fff83180096 in __kill () #1 0x00007fff832210c2 in abort () #2 0x00007fff83138215 in free () #3 0x000000010006979e in boost::unit_test::framework_impl::clear (this=0x1000d99c0) at framework.ipp:133 #4 0x000000010006989c in boost::unit_test::framework_impl::~framework_impl (this=0x1000d99c0) at framework.ipp:122 #5 0x000000010006ae0e in __tcf_1 () at framework.ipp:225 #6 0x00007fff831443f4 in __cxa_finalize () #7 0x00007fff8314430c in exit () #8 0x0000000100009703 in start () at unit_test_parameters.ipp:172 </code> Program is: <code> #define BOOST_TEST_MODULE example #include <boost/test/included/unit_test.hpp> BOOST_AUTO_TEST_SUITE( test_suite ) BOOST_AUTO_TEST_CASE( test_case1 ) { // BOOST_ERROR( "some error 1" ); BOOST_CHECK( true ); } BOOST_AUTO_TEST_SUITE_END() #if 1 BOOST_AUTO_TEST_CASE( test_case_on_file_scope ) { BOOST_CHECK( true ); } #endif </code>
participants (1)
-
S Roderick