Boost C++ Libraries: Ticket #10629: Interprocess Vector resize causes crash https://svn.boost.org/trac10/ticket/10629 <p> Our existing code that has worked through many versions of Boost has failed in Boost 1.56.0. </p> <p> I've reduced our code down to a specific example that replicates the issue in the following development environment: </p> <blockquote> <p> (1) Windows 7 64-bit (2) VS2010 and VS2013 (generating X64 code) </p> </blockquote> <p> The example code produces a tree-like structure. Each node contains an interprocess vector that contains child nodes. The depth of the tree is 3 (parent, child, grandchild). The parent (root) node contains <strong>D</strong> child nodes, each child node contains <strong>D</strong> grandchild nodes, and the children of the grandchild nodes are left empty. The example program crashes when using a dimension, <strong>D</strong>, of 43, but is fine for 42 and less. </p> <p> The tree is constructed in a depth-first process so there will be some resizing of the vectors in the child and parent nodes after the grandchild nodes have been created and added to the structure. </p> <p> The crash generates the following error: </p> <p> <em>Assertion failed: ptr != 0, file D:\boost64\include\boost-1_56\boost/interprocess/allocators/allocator.hpp, line 268</em> </p> <p> The crash can be prevented by reserving the correct amount of space ahead of node insertion. </p> <p> Sample code is available: github.com/peter-durrant/sandbox/tree/master/boost_interprocess_vector_broken (CPP file attached) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10629 Trac 1.4.3 peter.durrant@… Tue, 07 Oct 2014 11:24:10 GMT attachment set https://svn.boost.org/trac10/ticket/10629 https://svn.boost.org/trac10/ticket/10629 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">IpVectorTest.cpp</span> </li> </ul> <p> Example code demonstrating crash </p> Ticket