Opened 11 years ago

Last modified 8 years ago

#6398 reopened Bugs

intermodule_singleton crash in Windows

Reported by: Joaquín M López Muñoz Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.48.0 Severity: Regression
Keywords: Cc:

Description

Steps to reproduce the problem:

  • Create singleton_dll.dll.
  • Create singleton_exe.exe, which uses singleton_dll.dll.
  • Run. On exit, an access violation happens.

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.

More context in http://lists.boost.org/Archives/boost/2012/01/189577.php

Attachments (1)

singleton.zip (777 bytes ) - added by Joaquín M López Muñoz 11 years ago.
testcase

Download all attachments as: .zip

Change History (6)

by Joaquín M López Muñoz, 11 years ago

Attachment: singleton.zip added

testcase

comment:1 by Ion Gaztañaga, 11 years ago

Resolution: fixed
Status: newclosed

(In [76576]) Fixes #6398: intermodule_singleton crash in Windows

comment:2 by Ion Gaztañaga, 11 years ago

Last edited 11 years ago by Ion Gaztañaga (previous) (diff)

comment:3 by jswigart@…, 10 years ago

This appears to still be happening in boost_1_53_0.

I have 2 dlls of the same process communicating via a message_queue

cgame_mp_x86.dll!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::interprocess::ipcdetail::ref_count_ptr,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,boost::interprocess::ipcdetail::ref_count_ptr> >,0> >::_Root() Line 1789 + 0x3 bytes C++ cgame_mp_x86.dll!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::interprocess::ipcdetail::ref_count_ptr,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,boost::interprocess::ipcdetail::ref_count_ptr> >,0> >::_Lbound(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Keyval) Line 1742 + 0x8 bytes C++ cgame_mp_x86.dll!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::interprocess::ipcdetail::ref_count_ptr,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,boost::interprocess::ipcdetail::ref_count_ptr> >,0> >::lower_bound(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Keyval) Line 1450 + 0x10 bytes C++ cgame_mp_x86.dll!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::interprocess::ipcdetail::ref_count_ptr,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,boost::interprocess::ipcdetail::ref_count_ptr> >,0> >::find(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _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<boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::find(boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map & map, const char * name) Line 269 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::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<boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::fini_atomic_func>(boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::fini_atomic_func & f) Line 213 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::thread_safe_global_map_dependant<boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::atomic_func<boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::fini_atomic_func>(boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map & map, boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::fini_atomic_func & f) Line 285 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::singleton_destructor(void * p, boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map & map) Line 472 + 0xd bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_common<boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::finalize_singleton_logic(void * & ptr, volatile unsigned int & this_module_singleton_initialized, void (void *, boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &)* destructor) Line 182 + 0x11 bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::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

comment:4 by anonymous, 10 years ago

Resolution: fixed
Status: closedreopened

in reply to:  3 comment:5 by anonymous, 8 years ago

Hi have the same issue with 1_55_0

Replying to jswigart@…:

This appears to still be happening in boost_1_53_0.

I have 2 dlls of the same process communicating via a message_queue

cgame_mp_x86.dll!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::interprocess::ipcdetail::ref_count_ptr,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,boost::interprocess::ipcdetail::ref_count_ptr> >,0> >::_Root() Line 1789 + 0x3 bytes C++ cgame_mp_x86.dll!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::interprocess::ipcdetail::ref_count_ptr,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,boost::interprocess::ipcdetail::ref_count_ptr> >,0> >::_Lbound(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Keyval) Line 1742 + 0x8 bytes C++ cgame_mp_x86.dll!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::interprocess::ipcdetail::ref_count_ptr,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,boost::interprocess::ipcdetail::ref_count_ptr> >,0> >::lower_bound(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Keyval) Line 1450 + 0x10 bytes C++ cgame_mp_x86.dll!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::interprocess::ipcdetail::ref_count_ptr,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,boost::interprocess::ipcdetail::ref_count_ptr> >,0> >::find(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _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<boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::find(boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map & map, const char * name) Line 269 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::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<boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::fini_atomic_func>(boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::fini_atomic_func & f) Line 213 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_helpers::thread_safe_global_map_dependant<boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::atomic_func<boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::fini_atomic_func>(boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map & map, boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::fini_atomic_func & f) Line 285 C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::singleton_destructor(void * p, boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map & map) Line 472 + 0xd bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_common<boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::finalize_singleton_logic(void * & ptr, volatile unsigned int & this_module_singleton_initialized, void (void *, boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map &)* destructor) Line 182 + 0x11 bytes C++ cgame_mp_x86.dll!boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interprocess::ipcdetail::windows_bootstamp,1,1,boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::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

Note: See TracTickets for help on using tickets.