Boost logo

Boost Users :

Subject: Re: [Boost-users] Interprocess container segmentation fault (example provided)
From: Davidson, Josh (josh.davidson_at_[hidden])
Date: 2012-03-02 01:37:25


> Ion,

> Terribly sorry, but I goofed when I cobbled that code together. My actual application constructs "TestStore" from the segment, and not on the stack like what I pasted in before. I'm including the full test code again, although only the main function changed. Since the map itself a member of TestStore and TestStore is being constructed from the segment, I would think that should be roughly equivalent to just creating the map by itself from the segment. However, as you'll see if you run it, it still seg faults when accessing the list iterator.

Ok, I had to re-read your message again before it sunk in. While allocating the TestStore on the stack was an obvious issue, I understand now why it still blew up when iterating the list.

Also, it looks like I was further complicating things. It appears from my testing that I can store allocator instances in the shared memory segment (e.g. a ListAllocator in TestStore from earlier example) and just use that in addMessage rather than creating a new allocator each time I insert into the map.

Thanks,
Josh


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net