Boost C++ Libraries: Ticket #3920: Boost unit test - incorrect memory read https://svn.boost.org/trac10/ticket/3920 <p> Dears, </p> <p> During my work with Boost unit test. I was faced with little problem where some memory was incorrect read. </p> <p> Details below: </p> <p> ==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: <span class="underline">gnu_cxx::new_allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt; &gt;::deallocate(std::_Rb_tree_node&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;*, unsigned int) (new_allocator.h:98) ==5432== by 0x410219B: std::_Rb_tree&lt;unsigned long, std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt;, std::_Select1st&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;, std::less&lt;unsigned long&gt;, std::allocator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt; &gt;::_M_put_node(std::_Rb_tree_node&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;*) (stl_tree.h:361) ==5432== by 0x41021FB: std::_Rb_tree&lt;unsigned long, std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt;, std::_Select1st&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;, std::less&lt;unsigned long&gt;, std::allocator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt; &gt;::_M_destroy_node(std::_Rb_tree_node&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;*) (stl_tree.h:391) ==5432== by 0x41046DF: std::_Rb_tree&lt;unsigned long, std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt;, std::_Select1st&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;, std::less&lt;unsigned long&gt;, std::allocator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt; &gt;::erase(std::_Rb_tree_iterator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;) (stl_tree.h:1319) ==5432== by 0x41047B1: std::_Rb_tree&lt;unsigned long, std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt;, std::_Select1st&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;, std::less&lt;unsigned long&gt;, std::allocator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt; &gt;::erase(std::_Rb_tree_iterator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;, std::_Rb_tree_iterator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;) (stl_tree.h:1359) ==5432== by 0x4104822: std::_Rb_tree&lt;unsigned long, std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt;, std::_Select1st&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt;, std::less&lt;unsigned long&gt;, std::allocator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt; &gt;::erase(unsigned long const&amp;) (stl_tree.h:1345) ==5432== by 0x410485D: std::map&lt;unsigned long, boost::unit_test::test_unit*, std::less&lt;unsigned long&gt;, std::allocator&lt;std::pair&lt;unsigned long const, boost::unit_test::test_unit*&gt; &gt; &gt;::erase(unsigned long const&amp;) (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. </span></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3920 Trac 1.4.3 Steven Watanabe Fri, 11 Jun 2010 02:38:42 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3920#comment:1 https://svn.boost.org/trac10/ticket/3920#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I believe that this was fixed in 1.42. </p> Ticket