|
Boost : |
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2008-06-15 12:36:30
Hi Darren,
On Sun, Jun 15, 2008 at 7:51 PM, Darren Garvey <darren.garvey_at_[hidden]> wrote:
> Hello Ion,
>
> Title says it all really: the attached mini-program gives me a segmentation
> fault on ubuntu linux 8.04 with gcc 4.2.3 when trying to read back the
> shared memory between process invocations (trying a similar program on XP
> also fails). If the comments on lines 33/34 and 66-67/68-69 are swapped it
> works as expected. I've also tried and failed to get it working with my own
> types as well as std::string.
>
I think you need to use the appropriate allocator with the STL types
-- and I think if you need to use the appropriate shared memory
allocators for the things you need to keep in the shared memory
segment(s).
I took a look at your code, and you may have to specialize the
string's allocator to use the Interprocess allocator types.
HTH.
-- Dean Michael C. Berris Software Engineer, Friendster, Inc.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk