Boost C++ Libraries: Ticket #386: boost::pool_allocator breaks with vector of vectors https://svn.boost.org/trac10/ticket/386 <pre class="wiki">The resulting executable built with the following code under GCC 3.3.5 produces a segmentation fault when run: Note that switching the definition of EventVector to use a vector with a standard allocator will fix the problem. Also note that the definition of IndexVector doesn't seem to matter. #include &lt;boost/pool/pool_alloc.hpp&gt; #include &lt;vector&gt; #include &lt;iostream&gt; template &lt;typename DataType&gt; struct PooledVector { typedef std::vector&lt;DataType, boost::pool_allocator&lt;DataType&gt; &gt; Type; }; typedef PooledVector&lt;int&gt;::Type EventVector; //typedef std::vector&lt;int&gt; EventVector; //typedef PooledVector&lt;EventVector&gt;::Type IndexVector; typedef std::vector&lt;EventVector&gt; IndexVector; int main() { IndexVector iv; iv.push_back(EventVector()); iv.back().push_back(3); std::cout &lt;&lt; "it works\n"; return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/386 Trac 1.4.3 nobody Tue, 06 Dec 2005 11:14:20 GMT <link>https://svn.boost.org/trac10/ticket/386#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/386#comment:1</guid> <description> <pre class="wiki">Logged In: NO I have the same problem making a std::vector&lt;std::vector&lt;int, boost::pool_allocator&lt;int&gt; &gt; &gt; on gcc 3.4.4 </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>nobody</dc:creator> <pubDate>Thu, 03 Aug 2006 23:40:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/386#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/386#comment:2</guid> <description> <pre class="wiki">Logged In: NO Having the same problem under MingW gcc 3.4.4 w/ STLPort 5.0 on Cygwin32. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>verntx</dc:creator> <pubDate>Thu, 03 Aug 2006 23:42:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/386#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/386#comment:3</guid> <description> <pre class="wiki">Logged In: YES user_id=1568291 ok, logged in now. Having the same problem under MingW gcc 3.4.4 w/ STLPort 5.0 on Cygwin32. Going to try enabling a lot of the STLport debugging stuff to see if I can catch the allocators interfering w/ each other. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 09 Aug 2007 03:50:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/386#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/386#comment:4</guid> <description> <p> Under 1.33.1 with VS2005 I get a crash with a deque&lt; object, boost::pool_allocator&lt; object&gt; &gt; </p> <p> Crash is in simple_segregated_storage&lt;<a class="missing wiki">SizeType</a>&gt;::try_malloc_n </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Wed, 21 Nov 2007 00:09:38 GMT</pubDate> <title>component, description changed; severity set https://svn.boost.org/trac10/ticket/386#comment:5 https://svn.boost.org/trac10/ticket/386#comment:5 <ul> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">pool</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/386?action=diff&amp;version=5">diff</a>) </li> <li><strong>severity</strong> → <span class="trac-field-new">Showstopper</span> </li> </ul> Ticket Marshall Clow Wed, 21 Nov 2007 00:10:27 GMT severity changed https://svn.boost.org/trac10/ticket/386#comment:6 https://svn.boost.org/trac10/ticket/386#comment:6 <ul> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> Ticket Steven Watanabe Mon, 18 May 2009 23:39:52 GMT <link>https://svn.boost.org/trac10/ticket/386#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/386#comment:7</guid> <description> <p> This is probably the same as <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2869" title="#2869: Bugs: pool_allocator interferes with multi-layer instantiations (closed: duplicate)">#2869</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 05 Jun 2009 00:16:36 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/386 https://svn.boost.org/trac10/ticket/386 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">pool.patch</span> </li> </ul> <p> patch and test case. </p> Ticket Steven Watanabe Mon, 19 Oct 2009 16:26:54 GMT status, resolution changed https://svn.boost.org/trac10/ticket/386#comment:8 https://svn.boost.org/trac10/ticket/386#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/56998" title="Allow zero-sized blocks to be allocated by malloc_n. Fixes #386">[56998]</a>) Allow zero-sized blocks to be allocated by malloc_n. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/386" title="#386: Bugs: boost::pool_allocator breaks with vector of vectors (closed: fixed)">#386</a> </p> Ticket Marshall Clow Tue, 11 Jan 2011 14:22:36 GMT <link>https://svn.boost.org/trac10/ticket/386#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/386#comment:9</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/67958" title="Merging fixes to release; Fixes #2696; Refs #4346; Refs #2941; Refs #386">[67958]</a>) Merging fixes to release; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2696" title="#2696: Bugs: max_size for boost pool (closed: fixed)">#2696</a>; Refs <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/4346" title="#4346: Bugs: Boost pool's not comaptible with Microsoft memory leak detection (reopened)">#4346</a>; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2941" title="#2941: Tasks: boost/pool/pool.hpp uses reinterpret_cast instead of static_cast (closed: fixed)">#2941</a>; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/386" title="#386: Bugs: boost::pool_allocator breaks with vector of vectors (closed: fixed)">#386</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>