Boost logo

Boost :

Subject: Re: [boost] [Interprocess] Possible bug in shared memory on FreeBSD 8.0
From: Manish Vachharajani (manishv_at_[hidden])
Date: 2009-08-11 13:34:56

> You are lucky because right now I'm working on Interprocess, that's why
> changes are happening so fast. This will change tomorrow, because I have
> other pending tasks, so let's do the work ;-)

Ok, sounds good to me :)

> I've uploaded to trunk a change I've done to remove the call to
> write_whole_device, which called ::lseek and ::write and it's only needed in
> windows, since truncation in windows does not zero fill the memory if the
> new size is bigger. Can you test it?

Works for me under 8.0 on my small test code. Minor bug on 7.2, the
test in workaround.hpp should be (__FreeBSD__ < 8), not >=8.
Otherwise, on 7.2 we don't use the filesystem based naming and things
break. It seems we'd want the opposite, filesystem naming on anything
less than 8, no filesystem naming on anything greater.

I'll let you know if it works in the main code in which I use this
stuff later today, after I patch the changes you've made into our
production version of boost. Do you know if this stuff will make it
into boost 1.40.0 or is it too late for that?

> I've just seen this:
> It seems that POSIX shared memory is now more similar to linux, so I've just
> changed workaround.hpp to avoid filesystem-based shm flag.

Yep, good catch on that post. Fortunately, the "implementation
defined" behavior on 7.2 was sane, but indeed required non-portable
use of names. Note that I think there is a minor typo in the #if
test, see my comment above.

And again, thanks for the help. You've certainly fixed the bugs
faster *much* than I could have myself since I'm not very familiar
with all the interactions in the Boost.Interprocess library, nor am I
familiar with the portability issues on non-FreeBSD and non-Linux


Boost list run by bdawes at, gregod at, cpdaniel at, john at