Boost logo

Boost Users :

Subject: Re: [Boost-users] [interprocess] garbage chars when extending interprocess strings?
From: Anthony Foiani (tkil_at_[hidden])
Date: 2011-07-31 11:10:06


"John M. Dlugosz" <mpbecey7gu_at_[hidden]> writes:

> On 7/31/2011 1:39 AM, Anthony Foiani wrote:
>>
>> typedef boost::interprocess::basic_string<
>> ShmCharType,
>> std::char_traits< ShmCharType>,
>> ShmCharAllocatorType
>> > ShmStringType;
>
> A string allocator will affect the storage of the stored characters,
> but doesn't affect the structure that is the body of the basic_string
> instance itself.

I'm pretty sure that's why I'm using the basic_string template from
interprocess in the first place, instead of std::basic_string.

But I initially wrote that code a long time ago, and now it seems to
be freaking out on me, so.

> Perhaps the actual string instance is not being shared? The other
> process has its own version and doesn't see the change to length.

Hm. In this case, I'm seeing corruption even within a single process,
so I don't *think* this is the problem.

Either way, thanks for taking a look! I'm sure I'm just doing
something extra stupid.

Thanks again,
Tony

p.s. I created an updated version that doesn't rely on Linux's /dev/shm:

        http://foiani.com/cpp/boost/InterProcStringTest2.cpp


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