|
Boost : |
Subject: [boost] Double free from UTF
From: janm-boost-devel_at_[hidden]
Date: 2009-09-17 10:04:15
Hi,
I am seeing a double free when using boost-test on:
- FreeBSD 7.2-STABLE, amd64 (gcc 4.2.1) with boost 1.39
- Mac OSX 10.6.1, x86_64 (XCode 3.2, gcc 4.2) with boost 1.40
I don't see the problem on Windows XP with Visual C++ 2005 Express.
A simple test case is below, just run. The _malloc_options is to make
the system malloc() fill memory with 0xa5 on allocation and 0x5a on
deallocation.
#define BOOST_TEST_MAIN
#include <boost/test/included/unit_test.hpp>
#include <stdlib.h>
const char* _malloc_options = "J";
BOOST_AUTO_TEST_CASE(broken)
{
BOOST_CHECK(true);
}
Output:
Running 1 test case...
*** No errors detected
zsh: bus error (core dumped) ./a.out
Stack Trace:
#0 0x0000000800b1bdee in free () from /lib/libc.so.7
#1 0x000000000043e51c in boost::unit_test::framework_impl::clear (this=0x55ad20) at framework.ipp:133
#2 0x000000000043e652 in ~framework_impl (this=0x55ad20) at framework.ipp:122
#3 0x00000000004110c6 in __tcf_1 () at framework.ipp:222
#4 0x0000000800b6dbb6 in __cxa_finalize () from /lib/libc.so.7
#5 0x0000000800b1f7c7 in exit () from /lib/libc.so.7
#6 0x0000000000404595 in _start ()
Any ideas?
Thanks,
Jan Mikkelsen
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk