Subject: [Boost-bugs] [Boost C++ Libraries] #5682: BOOST_TEST_REPORT_LEVEL and BOOST_TEST_LOG_LEVEL crash on Mac OS X with g++ 4.6.1.1
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-10 12:14:09
#5682: BOOST_TEST_REPORT_LEVEL and BOOST_TEST_LOG_LEVEL crash on Mac OS X with g++
4.6.1.1
---------------------------------------------------------+------------------
Reporter: Thomas Krennwallner <tkren@â¦> | Owner: rogeeff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
Version: Boost 1.46.1 | Severity: Regression
Keywords: |
---------------------------------------------------------+------------------
Using the environment setting {{{BOOST_TEST_REPORT_LEVEL=detailed}}} and
{{{BOOST_TEST_LOG_LEVEL=all}}} frees an unallocated pointer on mac os x
when running simple boost unit tests compiled with g++ 4.6.1; standard g++
4.2.1 has not this problem:
{{{
$ g++ -DBOOST_TEST_DYN_LINK -I/opt/local/include -L/opt/local/lib
-lboost_unit_test_framework-mt boost_test.cxx
$ ./a.out
Running 1 test case...
*** No errors detected
$ BOOST_TEST_REPORT_LEVEL=detailed BOOST_TEST_LOG_LEVEL=all ./a.out
Running 1 test case...
Entering test suite "boost_test"
Entering test case "mytest"
boost_test.cxx:4: info: check true passed
Leaving test case "mytest"; testing time: 40mks
Leaving test suite "boost_test"
Test suite "boost_test" passed with:
1 assertion out of 1 passed
1 test case out of 1 passed
Test case "mytest" passed with:
1 assertion out of 1 passed
}}}
Compiling with g++ 4.6.1 gives
{{{
$ g++-mp-4.6 -DBOOST_TEST_DYN_LINK -I/opt/local/include -L/opt/local/lib
-lboost_unit_test_framework-mt boost_test.cxx
$ ./a.out
Running 1 test case...
*** No errors detected
$ BOOST_TEST_REPORT_LEVEL=detailed BOOST_TEST_LOG_LEVEL=all ./a.out
a.out(46920) malloc: *** error for object 0x7fff71199500: pointer being
freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap
}}}
A backtrace does not give too much information:
{{{
$ BOOST_TEST_REPORT_LEVEL=detailed BOOST_TEST_LOG_LEVEL=all gdb ./a.out
[...]
(gdb) break malloc_error_break
Breakpoint 1 at 0x4189374bb83499
(gdb) run
Starting program: /Users/tkren/a.out
Reading symbols for shared libraries ++++.. done
a.out(73567) malloc: *** error for object 0x7fff71199500: pointer being
freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Breakpoint 1, 0x00007fff870a5499 in malloc_error_break ()
(gdb) backtrace
#0 0x00007fff870a5499 in malloc_error_break ()
#1 0x00007fff86fcf183 in free ()
#2 0x000000010019c261 in std::basic_stringbuf<char,
std::char_traits<char>, std::allocator<char> >::overflow ()
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5682> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC