[Boost-bugs] [Boost C++ Libraries] #9666: managed_shared_memory constructor crash

Subject: [Boost-bugs] [Boost C++ Libraries] #9666: managed_shared_memory constructor crash
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-13 18:30:35


#9666: managed_shared_memory constructor crash
------------------------------+--------------------------
 Reporter: seppleviathan@… | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
------------------------------+--------------------------
 The following code causes a crash on Visual Studio 2013 when compiling for
 64-bit and with optimization.

 {{{
 #include <boost/interprocess/managed_shared_memory.hpp>

 using namespace boost::interprocess;
 int main()
 {
   static const char name[] = "test_shm";
   shared_memory_object::remove(name);
   managed_shared_memory segment(create_only, name, 65536);
   return 0;
 }
 }}}

 The reported error is a buffer overrun
 The crash doesn't happen on 32-bit builds. It also doesn't happen when
 building without optimization.
 Finally, it doesn't happen when compiling with /GS- (disable security
 checks).

 This is the stack trace:
 {{{
 msvcr120.dll!__crt_debugger_hook(int _Reserved=1) Line 60 C
 testshm.exe!__raise_securityfailure(_EXCEPTION_POINTERS *
 ExceptionPointers=0x000000013fa8c170) Line 70 C
 testshm.exe!__report_gsfailure(unsigned __int64
 StackCookie=63963535653567328) Line 241 C
 testshm.exe!boost::intrusive::rbtree_algorithms<boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,1> >::rebalance_after_insertion(const
 boost::interprocess::offset_ptr<boost::intrusive::compact_rbtree_node<boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0> >,__int64,unsigned __int64,0> & header=<struct at NULL>,
 boost::interprocess::offset_ptr<boost::intrusive::compact_rbtree_node<boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0> >,__int64,unsigned __int64,0> p={...}) Line 528 C++
 testshm.exe!boost::intrusive::bstree_impl<boost::intrusive::bhtraits<boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,0>::block_ctrl,boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,1>,0,boost::intrusive::default_tag,3>,void,unsigned
 __int64,1,4>::insert_equal(boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,0>::block_ctrl & value={...}) Line 861 C++
 testshm.exe!boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,0>::priv_add_segment(void * addr=0x0000000050000063, unsigned
 __int64 segment_size=1374736) Line 426 C++
 testshm.exe!boost::interprocess::segment_manager<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,0>,boost::interprocess::iset_index>::segment_manager<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,0>,boost::interprocess::iset_index>(unsigned __int64
 segment_size=65536) Line 414 C++
 testshm.exe!boost::interprocess::ipcdetail::basic_managed_memory_impl<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,0>,boost::interprocess::iset_index,8>::create_impl(void *
 addr=0x0000000000000000, unsigned __int64 size=1) Line 176 C++
 testshm.exe!boost::interprocess::ipcdetail::managed_open_or_create_impl<boost::interprocess::shared_memory_object,8,1,0>::priv_open_or_create<boost::interprocess::ipcdetail::create_open_func<boost::interprocess::ipcdetail::basic_managed_memory_impl<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,0>,boost::interprocess::iset_index,8> >
>(boost::interprocess::ipcdetail::create_enum_t type=1068023640, const
 char * const & id=0x00000000000000c2, unsigned __int64 size=8,
 boost::interprocess::mode_t mode=read_write, const void *
 addr=0x0000000000000000, const boost::interprocess::permissions &
 perm={...},
 boost::interprocess::ipcdetail::create_open_func<boost::interprocess::ipcdetail::basic_managed_memory_impl<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,__int64,unsigned
 __int64,0>,0>,boost::interprocess::iset_index,8> > construct_func) Line
 407 C++
 testshm.exe!main() Line 9 C++
 testshm.exe!__tmainCRTStartup() Line 626 C
 kernel32.dll!BaseThreadInitThunk() Unknown
 ntdll.dll!RtlUserThreadStart() Unknown
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9666>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC