Boost C++ Libraries: Ticket #6398: intermodule_singleton crash in Windows https://svn.boost.org/trac10/ticket/6398 <p> Steps to reproduce the problem: </p> <ul><li>Create singleton_dll.dll. </li><li>Create singleton_exe.exe, which uses singleton_dll.dll. </li><li>Run. On exit, an access violation happens. </li></ul><p> Seemingly, the problem happens when two different singletons are created, one in the main executable and the other in a DLL. If both singletons are created in the same module everything's OK, though. </p> <p> More context in <a class="ext-link" href="http://lists.boost.org/Archives/boost/2012/01/189577.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2012/01/189577.php</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6398 Trac 1.4.3 Joaquín M López Muñoz Fri, 13 Jan 2012 20:12:47 GMT attachment set https://svn.boost.org/trac10/ticket/6398 https://svn.boost.org/trac10/ticket/6398 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">singleton.zip</span> </li> </ul> <p> testcase </p> Ticket Ion Gaztañaga Wed, 18 Jan 2012 20:37:49 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6398#comment:1 https://svn.boost.org/trac10/ticket/6398#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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76576" title="Fixes #6398: intermodule_singleton crash in Windows">[76576]</a>) Fixes <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/6398" title="#6398: Bugs: intermodule_singleton crash in Windows (reopened)">#6398</a>: intermodule_singleton crash in Windows </p> Ticket Ion Gaztañaga Wed, 18 Jan 2012 20:38:11 GMT <link>https://svn.boost.org/trac10/ticket/6398#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6398#comment:2</guid> <description> </description> <category>Ticket</category> </item> <item> <author>jswigart@…</author> <pubDate>Sat, 23 Feb 2013 04:31:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6398#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6398#comment:3</guid> <description> <p> This appears to still be happening in boost_1_53_0. </p> <p> I have 2 dlls of the same process communicating via a message_queue </p> <p> cgame_mp_x86.dll!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,boost::interprocess::ipcdetail::ref_count_ptr,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,boost::interprocess::ipcdetail::ref_count_ptr&gt; &gt;,0&gt; &gt;::_Root() Line 1789 + 0x3 bytes C++ cgame_mp_x86.dll!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,boost::interprocess::ipcdetail::ref_count_ptr,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,boost::interprocess::ipcdetail::ref_count_ptr&gt; &gt;,0&gt; &gt;::_Lbound(const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; _Keyval) Line 1742 + 0x8 bytes C++ cgame_mp_x86.dll!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,boost::interprocess::ipcdetail::ref_count_ptr,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,boost::interprocess::ipcdetail::ref_count_ptr&gt; &gt;,0&gt; &gt;::lower_bound(const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; _Keyval) Line 1450 + 0x10 bytes C++ cgame_mp_x86.dll!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,boost::interprocess::ipcdetail::ref_count_ptr,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,boost::interprocess::ipcdetail::ref_count_ptr&gt; &gt;,0&gt; &gt;::find(const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; _Keyval) Line 1424 + 0x10 bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map::find(const char * name) Line 184 + 0x38 bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::thread_safe_global_map_dependant&lt;boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::find(boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &amp; map, const char * name) Line 269 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func::operator()() Line 434 + 0x1b bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map::atomic_func&lt;boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func&gt;(boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func &amp; f) Line 213 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::thread_safe_global_map_dependant&lt;boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::atomic_func&lt;boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func&gt;(boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &amp; map, boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func &amp; f) Line 285 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::singleton_destructor(void * p, boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &amp; map) Line 472 + 0xd bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_common&lt;boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::finalize_singleton_logic(void * &amp; ptr, volatile unsigned int &amp; this_module_singleton_initialized, void (void *, boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &amp;)* destructor) Line 182 + 0x11 bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::atexit_work() Line 340 + 0x14 bytes C++ cgame_mp_x86.dll!doexit(int code, int quick, int retcaller) Line 567 C cgame_mp_x86.dll!_cexit() Line 408 + 0xb bytes C cgame_mp_x86.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 181 C cgame_mp_x86.dll__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 352 + 0x11 bytes C cgame_mp_x86.dll!_DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 293 + 0x11 bytes C </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 27 Feb 2013 00:35:24 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/6398#comment:4 https://svn.boost.org/trac10/ticket/6398#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> Ticket anonymous Thu, 30 Oct 2014 15:00:22 GMT <link>https://svn.boost.org/trac10/ticket/6398#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6398#comment:5</guid> <description> <p> Hi have the same issue with 1_55_0 </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6398#comment:3" title="Comment 3">jswigart@…</a>: </p> <blockquote class="citation"> <p> This appears to still be happening in boost_1_53_0. </p> <p> I have 2 dlls of the same process communicating via a message_queue </p> <p> cgame_mp_x86.dll!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,boost::interprocess::ipcdetail::ref_count_ptr,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,boost::interprocess::ipcdetail::ref_count_ptr&gt; &gt;,0&gt; &gt;::_Root() Line 1789 + 0x3 bytes C++ cgame_mp_x86.dll!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,boost::interprocess::ipcdetail::ref_count_ptr,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,boost::interprocess::ipcdetail::ref_count_ptr&gt; &gt;,0&gt; &gt;::_Lbound(const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; _Keyval) Line 1742 + 0x8 bytes C++ cgame_mp_x86.dll!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,boost::interprocess::ipcdetail::ref_count_ptr,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,boost::interprocess::ipcdetail::ref_count_ptr&gt; &gt;,0&gt; &gt;::lower_bound(const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; _Keyval) Line 1450 + 0x10 bytes C++ cgame_mp_x86.dll!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,boost::interprocess::ipcdetail::ref_count_ptr,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,boost::interprocess::ipcdetail::ref_count_ptr&gt; &gt;,0&gt; &gt;::find(const std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp; _Keyval) Line 1424 + 0x10 bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map::find(const char * name) Line 184 + 0x38 bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::thread_safe_global_map_dependant&lt;boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::find(boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &amp; map, const char * name) Line 269 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func::operator()() Line 434 + 0x1b bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map::atomic_func&lt;boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func&gt;(boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func &amp; f) Line 213 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::thread_safe_global_map_dependant&lt;boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::atomic_func&lt;boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func&gt;(boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &amp; map, boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::fini_atomic_func &amp; f) Line 285 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::singleton_destructor(void * p, boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &amp; map) Line 472 + 0xd bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_common&lt;boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::finalize_singleton_logic(void * &amp; ptr, volatile unsigned int &amp; this_module_singleton_initialized, void (void *, boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &amp;)* destructor) Line 182 + 0x11 bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl&lt;boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map&gt;::atexit_work() Line 340 + 0x14 bytes C++ cgame_mp_x86.dll!doexit(int code, int quick, int retcaller) Line 567 C cgame_mp_x86.dll!_cexit() Line 408 + 0xb bytes C cgame_mp_x86.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 181 C cgame_mp_x86.dll__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 352 + 0x11 bytes C cgame_mp_x86.dll!_DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 293 + 0x11 bytes C </p> </blockquote> </description> <category>Ticket</category> </item> </channel> </rss>