[Boost-bugs] [Boost C++ Libraries] #9855: Corruption in container::string when used with boost::interprocess

Subject: [Boost-bugs] [Boost C++ Libraries] #9855: Corruption in container::string when used with boost::interprocess
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-08 12:27:47


#9855: Corruption in container::string when used with boost::interprocess
------------------------------------+-------------------------
 Reporter: Lars Hagström <lars@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.55.0 | Severity: Showstopper
 Keywords: |
------------------------------------+-------------------------
 I have found a rather strange problem in Boost.Container which I can only
 get to show itself when used from Boost.Interprocess.
 So the problem may be in either Boost.Container and Boost.Interprocess.

 I have a vector of strings (in shared memory). When I push back some of
 these strings one of them ends up missing its null termination (c_str()
 returns a string which has a garbage character at the end).

 I have tried to work out what the problem is, and my theory is that it is
 when the vector gets resized and the strings get moved into their new
 positions. The move semantics make the now "empty" strings
 "unconstructed". A new push_back will do an assign onto an unconstructed
 slot without "reconstructing" it. But this is where I get lost in the
 vector code...

 I have a short test program at
 https://gist.github.com/DonOregano/10116264. Compile and run and it will
 hopefully print out some information about the error.

 It appears that this error happens only on 64bit OSes. And I have only
 tried it on Linux (recent Ubuntu and Arch).

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9855>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC