Opened 10 years ago

Last modified 6 years ago

#6897 new Bugs

Boost interprocess segfaults

Reported by: Mathias Creutz <mathiascreutz@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

Having a boost::unordered map in shared memory and after creation opening it in open_only or open_read_only behaves differently depending on the key length. open_only always works, open_read_only only works if key length is less than 24 bytes.

I've got very simple example code that I'll attach, maybe I am doing something wrong here.

Attachments (2)

test.cc (4.5 KB ) - added by Mathias Creutz <mathiascreutz@…> 10 years ago.
For testing the different behaviour open_only vs open_read_only
test.2.cc (4.5 KB ) - added by Mathias Creutz <mathiascreutz@…> 10 years ago.

Download all attachments as: .zip

Change History (3)

by Mathias Creutz <mathiascreutz@…>, 10 years ago

Attachment: test.cc added

For testing the different behaviour open_only vs open_read_only

by Mathias Creutz <mathiascreutz@…>, 10 years ago

Attachment: test.2.cc added

comment:1 by Robert Ayrapetyan <robert.ayrapetyan@…>, 6 years ago

Looks like an expected behavior. When string length is small (less then capacity()), no allocations are required, all characters are stored "in place". Otherwise alloc in "segment" is required (which fails when you open it in "read only" mode). I would suggest to close this ticket as "invalid".

Note: See TracTickets for help on using tickets.