|
Boost : |
Subject: Re: [boost] [test] console_test_runner ported on *nix
From: Kevin Sopp (baraclese_at_[hidden])
Date: 2008-09-18 06:19:37
Hi Gennadiy,
yesterday I noticed that valgrind reports an error for the boost test framework.
This is for a file with a single and empty BOOST_AUTO_TEST_CASE:
==3513== Invalid read of size 4
==3513== at 0x40936E0: boost::unit_test::framework_impl::clear()
(framework.ipp:133)
==3513== by 0x409383C:
boost::unit_test::framework_impl::~framework_impl()
(framework.ipp:122)
==3513== by 0x42466C8: exit (in /lib/libc-2.8.so)
==3513== by 0x422F5CC: (below main) (in /lib/libc-2.8.so)
==3513== Address 0x4375ba4 is 20 bytes inside a block of size 24 free'd
==3513== at 0x402272A: operator delete(void*) (in
/usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==3513== by 0x409161C:
__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned long
const, boost::unit_test::test_unit*> >
>::deallocate(std::_Rb_tree_node<std::pair<unsigned long const,
boost::unit_test::test_unit*> >*, unsigned) (new_allocator.h:98)
==3513== by 0x4091651: 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_put_node(std::_Rb_tree_node<std::pair<unsigned long const,
boost::unit_test::test_unit*> >*) (stl_tree.h:361)
==3513== by 0x40916B1: 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_destroy_node(std::_Rb_tree_node<std::pair<unsigned long const,
boost::unit_test::test_unit*> >*) (stl_tree.h:391)
==3513== by 0x4091707: 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*> >*) (stl_tree.h:943)
==3513== by 0x4091746: 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*> > >::clear() (stl_tree.h:697)
==3513== by 0x4093C2A: 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*> >
>::erase(std::_Rb_tree_iterator<std::pair<unsigned long const,
boost::unit_test::test_unit*> >,
std::_Rb_tree_iterator<std::pair<unsigned long const,
boost::unit_test::test_unit*> >) (stl_tree.h:1356)
==3513== by 0x4093CCC: 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*> > >::erase(unsigned long const&)
(stl_tree.h:1345)
==3513== by 0x4093D07: std::map<unsigned long,
boost::unit_test::test_unit*, std::less<unsigned long>,
std::allocator<std::pair<unsigned long const,
boost::unit_test::test_unit*> > >::erase(unsigned long const&)
(stl_map.h:538)
==3513== by 0x408F1C3:
boost::unit_test::framework::deregister_test_unit(boost::unit_test::test_unit*)
(framework.ipp:326)
==3513== by 0x40B2354: boost::unit_test::test_unit::~test_unit()
(unit_test_suite.ipp:65)
==3513== by 0x40935DE: boost::unit_test::test_case::~test_case()
(unit_test_suite_impl.hpp:110)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk