id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 12499,Memory allocation fails,stephan.menzel@…,Ion Gaztañaga,"I am having a interprocess based client-server exchange mechanism at a critical spot in our infrastructure. It relies on a server opening a named shm segment with a given structure and clients being able to exchange commands and responses with it. It runs on Windows (10) and two Linux variants (clang and gcc based). On Windows I use MSVC14 and static linkage. This has been written in 1.58 and upgraded every release and worked very well up until 1.62. With this release it stopped working in all non-Debug Configurations. In RelWithDebInfo I am getting the somewhat funny error message: Unhandled exception at 0x00007FF63A728630 in client.exe: Stack cookie instrumentation code detected a stack-based buffer overrun. This happens when the client inserts a string into the message container living in the shm segment. A sample project demonstrating the issue including CMakeLists is attached. The code in question is: {{{ typedef boost::interprocess::allocator ShmemCharAllocator; typedef boost::interprocess::basic_string, ShmemCharAllocator> ShmemString; typedef boost::interprocess::allocator ShmemStringAllocator; typedef boost::interprocess::deleter ShmemStringDeleter; typedef boost::interprocess::managed_unique_ptr::type ShmemStringUPtr; typedef boost::interprocess::offset_ptr ShmemStringPtr; inline void msgmap_insert(MessageMap *n_map, CommandInterfaceSPtr n_interface, const boost::uint64_t n_key, const std::string &n_value) { boost::interprocess::managed_shared_memory::segment_manager *seg_mngr = n_interface->m_command_segment->get_segment_manager(); // create the string ShmemStringPtr s = seg_mngr->construct(boost::interprocess::anonymous_instance)(n_value.c_str(), seg_mngr); (*n_map)[n_key] = s; } }}} Steps to reproduce: 1) Build project against 1.62 on Windows in RelWithDebInfo and Debug 2) In either config run server.exe 3) Run client.exe in both configs. In Debug it seems to work. In RelWithDebInfo it produces above message (only if started in Visual Studio Debugger). If started on console, it appears to crash. The surrounding code in the vs debugger leads me to believe there's wrong #define dependent CPU instructions baked into the executable which is why I think this is quite important. Again, this used to work until 1.62. Please have a look at it. Cheers, Stephan",Bugs,closed,To Be Determined,interprocess,Boost 1.62.0,Regression,fixed,"container, interprocess",