Boost C++ Libraries: Ticket #681: Memoryleak when using boost::thread and boost::test together https://svn.boost.org/trac10/ticket/681 <pre class="wiki">When I tried to use boost::thread with boost::test (Unit Test Framework) I've always got the followed message: Detected memory leaks! Dumping objects -&gt; {227} normal block at 0x00364698, 24 bytes long. Data: &lt;PS &gt; 50 53 14 00 FF FF FF FF 00 00 00 00 00 00 00 00 {226} normal block at 0x00364428, 8 bytes long. Data: &lt; F6 &gt; 98 46 36 00 01 CD CD CD Object dump complete. It does not matter from Boost version (I tried the latest one as well). The error is reproduced with simple examples from boost::thread docs. Platform: Win32 Compiler: Microsoft Visual C++ version 7.1 STL : Dinkumware standard library version 313 Boost : 1.33.1 Could you help me? Thanks in advance! Sergei Panov </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/681 Trac 1.4.3 nobody Tue, 11 Jul 2006 21:59:26 GMT <link>https://svn.boost.org/trac10/ticket/681#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/681#comment:1</guid> <description> <pre class="wiki">Logged In: NO Hi I have also detected more memoryleaks, hope you can fix them. c:\program files\microsoft visual studio .net 2003\vc7 \include\vector (828): std::vector&lt;void *,std::allocator&lt;void *&gt; &gt;::_Insert_n c:\boost_1_32_0\boost\thread\tss.hpp (98): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::reset ---------- Block 34424 at 0x01B6E3F8: 8 bytes ---------- Call Stack: c:\program files\microsoft visual studio .net 2003\vc7 \include\vector (828): std::vector&lt;boost::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt; *,std::allocator&lt;boost::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt; *&gt; &gt;::_Insert_n c:\boost\thread\tss.hpp (38): boost::detail::tss::tss c:\boost\thread\tss.hpp (86): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; ---------- Block 34423 at 0x01B6E3B0: 12 bytes ---------- Call Stack: c:\program files\microsoft visual studio .net 2003\vc7 \include\xmemory (34): std::_Allocate&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegi ster *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt; c:\program files\microsoft visual studio .net 2003\vc7 \include\xmemory (137): std::allocator&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegi ster *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt;::allocate c:\boost\function\function_template.hpp (490): boost::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt;::assign_to&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegist er *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt; c:\boost\function\function_template.hpp (434): boost::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt;::assign_to&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegist er *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt; c:\boost\function\function_template.hpp (290): boost::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt;::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt;&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt; c:\boost\thread\tss.hpp (85): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; ---------- Block 34422 at 0x01B6E368: 12 bytes ---------- Call Stack: c:\boost\thread\tss.hpp (85): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; ---------- Block 30267 at 0x01A106D0: 16 bytes ---------- Call Stack: c:\libs\thread\src\tss.cpp (119): `anonymous namespace'::get_slots c:\boost\thread\tss.hpp (98): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::reset ---------- Block 2656 at 0x00F4E240: 24 bytes ---------- Call Stack: c:\libs\thread\src\mutex.inl (55): `anonymous namespace'::new_critical_section c:\libs\thread\src\mutex.cpp (48): boost::mutex::mutex c:\libs\thread\src\tss.cpp (149): boost::detail::tss::init c:\boost\thread\tss.hpp (38): boost::detail::tss::tss c:\boost\thread\tss.hpp (86): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; ---------- Block 2655 at 0x00F4E1E8: 28 bytes ---------- Call Stack: c:\libs\thread\src\tss.cpp (63): `anonymous namespace'::init_tss_data c:\libs\thread\src\tss.cpp (149): boost::detail::tss::init c:\boost\thread\tss.hpp (38): boost::detail::tss::tss c:\boost\thread\tss.hpp (86): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; ---------- Block 2647 at 0x00F4E0C8: 12 bytes ---------- Call Stack: c:\program files\microsoft visual studio .net 2003\vc7 \include\xmemory (34): std::_Allocate&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegi ster *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt; c:\program files\microsoft visual studio .net 2003\vc7 \include\xmemory (137): std::allocator&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegi ster *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt;::allocate c:\boost\function\function_template.hpp (490): boost::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt;::assign_to&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegist er *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt; c:\boost\function\function_template.hpp (434): boost::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt;::assign_to&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegist er *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt; c:\boost\function\function_template.hpp (290): boost::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt;::function1&lt;void,void *,std::allocator&lt;boost::function_base&gt; &gt;&lt;boost::detail::tss_adapter&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; &gt; c:\boost\thread\tss.hpp (85): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; ---------- Block 2646 at 0x00F4E080: 12 bytes ---------- Call Stack: c:\boost\thread\tss.hpp (85): boost::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt;::thread_specific_ptr&lt;std::vector&lt;CRegister *,std::allocator&lt;CRegister *&gt; &gt; &gt; ---------- Block 250 at 0x00E1B4B8: 24 bytes ---------- Call Stack: c:\libs\thread\src\mutex.inl (55): `anonymous namespace'::new_critical_section c:\libs\thread\src\mutex.cpp (48): boost::mutex::mutex c:\libs\thread\src\tss_hooks.cpp (121): on_process_enter ---------- Block 249 at 0x00E1B650: 8 bytes ---------- Call Stack: c:\libs\thread\src\tss_hooks.cpp (29): `anonymous namespace'::init_threadmon_mutex c:\libs\thread\src\tss_hooks.cpp (121): on_process_enter Thank you </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Roland Schwarz</dc:creator> <pubDate>Fri, 29 Sep 2006 06:46:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/681#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/681#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=541730 This error most likely was related to the TSS global mutex leak. It has been fixed for 1.34 and 1.35 </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Roland Schwarz</dc:creator> <pubDate>Fri, 29 Sep 2006 06:47:20 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/681#comment:3 https://svn.boost.org/trac10/ticket/681#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> Ticket