Opened 13 years ago

Closed 12 years ago

#3920 closed Bugs (fixed)

Boost unit test - incorrect memory read

Reported by: habdank@… Owned by: Gennadiy Rozental
Milestone: Boost 1.43.0 Component: test
Version: Boost 1.40.0 Severity: Problem
Keywords: Cc:

Description

Dears,

During my work with Boost unit test. I was faced with little problem where some memory was incorrect read.

Details below:

==5432== Invalid read of size 4 ==5432== at 0x4104236: boost::unit_test::framework_impl::clear() (framework.ipp:133) ==5432== by 0x4104392: boost::unit_test::framework_impl::~framework_impl() (framework.ipp:122) ==5432== by 0x434ABB8: exit (exit.c:75) ==5432== by 0x433277C: (below main) (libc-start.c:252) ==5432== Address 0x44a4f04 is 20 bytes inside a block of size 24 free'd ==5432== at 0x402599A: operator delete(void*) (vg_replace_malloc.c:342) ==5432== by 0x4102166: 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 int) (new_allocator.h:98) ==5432== by 0x410219B: 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) ==5432== by 0x41021FB: 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) ==5432== by 0x41046DF: 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*> >) (stl_tree.h:1319) ==5432== by 0x41047B1: 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:1359) ==5432== by 0x4104822: 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) ==5432== by 0x410485D: 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) ==5432== by 0x40FF753: boost::unit_test::framework::deregister_test_unit(boost::unit_test::test_unit*) (framework.ipp:326) ==5432== by 0x415D958: boost::unit_test::test_unit::~test_unit() (unit_test_suite.ipp:65) ==5432== by 0x4104134: boost::unit_test::test_case::~test_case() (unit_test_suite_impl.hpp:115) ==5432== by 0x4104232: boost::unit_test::framework_impl::clear() (framework.ipp:133) ==5432== ==5432== ERROR SUMMARY: 15 errors from 1 contexts (suppressed: 29 from 1) ==5432== malloc/free: in use at exit: 104 bytes in 2 blocks. ==5432== malloc/free: 670 allocs, 668 frees, 57,564 bytes allocated. ==5432== For counts of detected errors, rerun with: -v ==5432== searching for pointers to 2 not-freed blocks. ==5432== checked 150,708 bytes. ==5432== ==5432== LEAK SUMMARY: ==5432== definitely lost: 0 bytes in 0 blocks. ==5432== possibly lost: 0 bytes in 0 blocks. ==5432== still reachable: 104 bytes in 2 blocks. ==5432== suppressed: 0 bytes in 0 blocks. ==5432== Rerun with --leak-check=full to see details of leaked memory.

Change History (1)

comment:1 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

I believe that this was fixed in 1.42.

Note: See TracTickets for help on using tickets.