[Boost-bugs] [Boost C++ Libraries] #2889: Unit Test framework does things that OS X's malloc dislikes

Subject: [Boost-bugs] [Boost C++ Libraries] #2889: Unit Test framework does things that OS X's malloc dislikes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-03-26 21:42:29


#2889: Unit Test framework does things that OS X's malloc dislikes
-------------------------------------+--------------------------------------
 Reporter: akim.demaille_at_[hidden] | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: test
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: osx |
-------------------------------------+--------------------------------------
 Using the attached file, compiled as follows, OS X's malloc reports an
 invalid free. This is annoying, as we run our test with such
 instrumentation to catch other kinds of errors.

 This is Mac OS X 10.5.6. Boost 1.38 installed by !MacPorts.

 {{{
 $ g++ -Wall tests/libport/cli.cc -o cli -I/opt/local/include
 -L/opt/local/lib -lboost_unit_test_framework-mt
 $ MallocErrorAbort=1 MallocScribble=1 ./cli
 cli(50514) malloc: enabling abort() on bad malloc or free
 cli(50514) malloc: enabling scribbling to detect mods to free blocks
 cli(50514) malloc: enabling abort() on bad malloc or free
 Running 1 test case...

 *** No errors detected
 cli(50514) malloc: *** error for object 0x55555555: Non-aligned pointer
 being freed
 *** set a breakpoint in malloc_error_break to debug
 zsh: abort MallocErrorAbort=1 MallocScribble=1 ./cli
 $ g++ --version
 i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484)
 Copyright (C) 2005 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.
 }}}

 The documentation for !MallocScribble (man malloc) reads:

    If set, fill memory that has been deallocated with 0x55 bytes. This
 increases the
    likelihood that a program will fail due to accessing memory that is no
 longer allocated.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2889>
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:49:59 UTC