Subject: [Boost-bugs] [Boost C++ Libraries] #11695: Crash if boost managed_shared_memory is used on Windows
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-09-30 06:35:15
#11695: Crash if boost managed_shared_memory is used on Windows
-----------------------------------+--------------------------
Reporter: rohbansa@⦠| Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
Version: Boost 1.60.0 | Severity: Showstopper
Keywords: managed_shared_memory |
-----------------------------------+--------------------------
The process executing below sample code crashes if two or more instances
are executed simultaneously.
If two instances are started at a gap of 1 second, then there is no crash.
{{{
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/containers/string.hpp>
#include <string>
#include <iostream>
#define RESERVED_BUFFER_SIZE_WRITE (8 * 0x0100000)
namespace bip = boost::interprocess;
//Typedefs of allocators and containers
typedef bip::allocator<char, bip::managed_shared_memory::segment_manager>
char_allocator;
typedef bip::basic_string<char, std::char_traits<char>, char_allocator>
char_string;
int main()
{
bip::managed_shared_memory m_sharedMemUsage(bip::open_or_create,
"MyBookkeeper", 2 * RESERVED_BUFFER_SIZE_WRITE);
char_allocator alloc_inst3(m_sharedMemUsage.get_segment_manager());
for (int count = 0; count < 100000; ++count) {
char_string key_obect("AAAAAAAAAAAAAAAAAAAAAAA", alloc_inst3);
}
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11695> 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:19 UTC