Boost C++ Libraries: Ticket #9064: select_on_container_copy_construction for scoped_allocator segfaults https://svn.boost.org/trac10/ticket/9064 <p> using gcc 4.4.7 or 4.6.3 for linux the following code segfaults due to a problem with select_on_container_copy_construction </p> <pre class="wiki">#include &lt;memory&gt; #include &lt;boost/container/scoped_allocator.hpp&gt; #include &lt;boost/container/vector.hpp&gt; int main(int argc, char* argv[]) { typedef boost::container::scoped_allocator_adaptor&lt;std::allocator&lt;int&gt; &gt; Allocator; typedef boost::container::vector&lt;int, Allocator&gt; MyVector; MyVector test1; MyVector test2(test1); }; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9064 Trac 1.4.3 Markus Mathes <Markus.Mathes@…> Thu, 29 Aug 2013 15:14:15 GMT <link>https://svn.boost.org/trac10/ticket/9064#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9064#comment:1</guid> <description> <p> The same code runs fine with boost 1.52.0 </p> </description> <category>Ticket</category> </item> <item> <author>Markus Mathes <Markus.Mathes@…></author> <pubDate>Fri, 30 Aug 2013 09:34:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9064#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9064#comment:2</guid> <description> <p> The inner_traits_type::select_on_container_copy_construction(this-&gt;inner_allocator()) statement in select_on_container_copy_construction causes an infinite recursion loop for a scoped allocator without any inner allocator type. (Inner allocator points back to outer) Somehow one has to distinguish the cases without and with inner allocator. In the latter case skipping the inner_traits_type::select_on_container_copy_construction part in the constructor call could be used to break the loop. </p> </description> <category>Ticket</category> </item> <item> <author>Markus Mathes <Markus.Mathes@…></author> <pubDate>Fri, 30 Aug 2013 09:53:40 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/9064 https://svn.boost.org/trac10/ticket/9064 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">select_on_conatiner_copy.patch</span> </li> </ul> Ticket Ion Gaztañaga Sat, 31 Aug 2013 21:48:18 GMT <link>https://svn.boost.org/trac10/ticket/9064#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9064#comment:3</guid> <description> <p> Thanks for the report and the patch. I've modified it to pass the logic to the bass class, where an specialization for 0 inner alllocator can handle select_on_container_copy_construction a bit differently. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Sat, 31 Aug 2013 21:49:28 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9064#comment:4 https://svn.boost.org/trac10/ticket/9064#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85537" title="Fixes #9064">[85537]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9064" title="#9064: Bugs: select_on_container_copy_construction for scoped_allocator segfaults (closed: fixed)">#9064</a> </p> Ticket