[pkg-boost-devel] Bug#538946: Known problem, still present in 1.40
Steve M. Robbins
steve at sumost.ca
Sun Sep 27 04:28:07 UTC 2009
Hi,
Just wanted to record that this problem has been known for some time
[1]. At the end of that thread, Peter Klotz provides a solution
similar to yours. It appears not to have been fixed because the
upstream developer does not believe Boost.Test code is faulty.
[1] http://www.nabble.com/-Boost.Test--valgrind-complains-about-invalid-reads-td20500154.html
Also, the bug still exists in 1.40. The demonstration is simple:
steve at riemann{boost}cat boost-test-auto-main.cc
#define BOOST_AUTO_TEST_MAIN
#include <boost/test/auto_unit_test.hpp>
BOOST_AUTO_TEST_CASE( dummy )
{
BOOST_ASSERT(1);
}
steve at riemann{boost}./a.out
Running 1 test case...
*** No errors detected
steve at riemann{boost}valgrind ./a.out
==2261== Memcheck, a memory error detector
==2261== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==2261== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h for copyright info
==2261== Command: ./a.out
==2261==
Running 1 test case...
*** No errors detected
==2261== Invalid read of size 8
==2261== at 0x4316A7: boost::unit_test::framework_impl::~framework_impl() (in /home/steve/src/test/boost/a.out)
==2261== by 0x560943C: exit (exit.c:75)
==2261== by 0x55F15CC: (below main) (libc-start.c:254)
==2261== Address 0x59266d8 is 40 bytes inside a block of size 48 free'd
==2261== at 0x4C21ACE: operator delete(void*) (vg_replace_malloc.c:346)
==2261== by 0x430FD5: std::_Rb_tree<unsigned long, std::pair<unsigned long const, boost::unit_test::test_unit*>, std::_Select1st<std::pair<unsigned long const, boost::unit_test::test_unit*> >, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, boost::unit_test::test_unit*> > >::_M_erase(std::_Rb_tree_node<std::pair<unsigned long const, boost::unit_test::test_unit*> >*) (in /home/steve/src/test/boost/a.out)
==2261== by 0x42C6C0: boost::unit_test::framework::deregister_test_unit(boost::unit_test::test_unit*) (in /home/steve/src/test/boost/a.out)
==2261== by 0x427E81: boost::unit_test::test_unit::~test_unit() (in /home/steve/src/test/boost/a.out)
==2261== by 0x4316A6: boost::unit_test::framework_impl::~framework_impl() (in /home/steve/src/test/boost/a.out)
==2261== by 0x560943C: exit (exit.c:75)
==2261== by 0x55F15CC: (below main) (libc-start.c:254)
==2261==
==2261==
==2261== HEAP SUMMARY:
==2261== in use at exit: 0 bytes in 0 blocks
==2261== total heap usage: 374 allocs, 374 frees, 51,957 bytes allocated
==2261==
==2261== All heap blocks were freed -- no leaks are possible
==2261==
==2261== For counts of detected and suppressed errors, rerun with: -v
==2261== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 5 from 5)
-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-boost-devel/attachments/20090926/bfaa47a7/attachment.pgp>
More information about the pkg-boost-devel
mailing list