Boost logo

Boost Users :

Subject: Re: [Boost-users] [test] Malloc exceptions when using test framework on 64bit OS X 10.6.1
From: Rush Manbert (rush_at_[hidden])
Date: 2009-09-18 19:57:55


On Sep 17, 2009, at 1:02 AM, Vrai Stacey wrote:

> Hi,
>
> I've been making my first forays in to using Boost on the new OS X
> release and have encountered some strange behaviour on 64bit machines.
> Testing with Boost 1.37.0 and 1.40.0 I've found that everything
> compiles as expected, but attempting to run any unit tests results in
> an error of the form:
>
> *** No errors detected
> test_exceptions(92517) malloc: *** error for object 0x3000100200460:
> pointer being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
>
<snip>

I am seeing the same thing using Boost 1.38.0 built for 64-bit Intel
on OS X 10.6.1. The test program worked fine on OS X 10.5.7, but I'm
seeing the same malloc errors as you.

For me, the error occurs in the file framework.ipp:

class framework_impl : public test_tree_visitor {
public:
     framework_impl()
     : m_master_test_suite( 0 )
     , m_curr_test_case( INV_TEST_UNIT_ID )
     , m_next_test_case_id( MIN_TEST_CASE_ID )
     , m_next_test_suite_id( MIN_TEST_SUITE_ID )
     , m_is_initialized( false )
     , m_test_in_progress( false )
     {}

     ~framework_impl() { clear(); }

     void clear()
     {
         while( !m_test_units.empty() ) {
             test_unit_store::value_type const& tu =
*m_test_units.begin();

             // the delete will erase this element from map
             if( test_id_2_unit_type( tu.second->p_id ) == tut_suite )
                 delete (test_suite const*)tu.second;
             else
                 delete (test_case const*)tu.second;
<<<<------------------------- This statement generates the error
         }
     }

GDB won't let me put a breakpoint anywhere in this file. Maybe I can
hack it to see something...

- Rush




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net