Boost C++ Libraries: Ticket #7164: [interprocess] Two potential bugs with b::int::vector of b::i::weak_ptr https://svn.boost.org/trac10/ticket/7164 <p> Here are two potential bugs discussed on boost-users mailing list when using b::int::vector of b::i::weak_ptr </p> <ul><li>1 - Erase of an element delete the wrong post </li></ul><p> The original post : <a class="ext-link" href="http://lists.boost.org/boost-users/2010/11/64591.php"><span class="icon">​</span>http://lists.boost.org/boost-users/2010/11/64591.php</a> </p> <p> This bug is reproduced by the sample programm pasted here : <a class="ext-link" href="http://pastebin.com/yDCngGw4"><span class="icon">​</span>http://pastebin.com/yDCngGw4</a> </p> <p> It's still present in v1.50 </p> <ul><li>2 - After a pushback sometimes the last element is not the one push_backed. </li></ul><p> The original post : <a class="ext-link" href="http://lists.boost.org/boost-users/2012/07/75311.php"><span class="icon">​</span>http://lists.boost.org/boost-users/2012/07/75311.php</a> </p> <p> The sample program trying to reproduce the bug : <a class="ext-link" href="http://pastebin.com/rdpZA7CU"><span class="icon">​</span>http://pastebin.com/rdpZA7CU</a> </p> <p> Note that this program does not reproduce the problem, as when it runs, only the priv_range_insert_new_allocation method is called. I don't know how to force the program to use priv_range_insert_expand_backwards to reproduce the problem. </p> <p> A sample of a trace when the bug occurs : </p> <pre class="wiki">In priv_range_insert_expand_backwards possibility 4/8 and NOT do_after After pushback in cableToUpdate vector last elem Id=50332165 added cable Id =134218245 !--&gt; sizeBefore=8, capacityBefore=8, sizeAfter=9, capacityAfter=13 CableToUpdate[16777216260, 16777216260, 16777216260, 50332165, 67109381, 16777216260, 16777216260, 16777216260, 50332165, ] </pre><p> The 4 firsts elements are wrongly duplicated at index 5-8. This vector corruption is perhaps done when the vector is resized from 5 to 8. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7164 Trac 1.4.3 Ion Gaztañaga Sun, 10 Feb 2013 22:07:44 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7164#comment:1 https://svn.boost.org/trac10/ticket/7164#comment:1 <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/82810" title="Fixes #7164 (first bug only)">[82810]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7164" title="#7164: Bugs: [interprocess] Two potential bugs with b::int::vector of b::i::weak_ptr (closed: fixed)">#7164</a> (first bug only) </p> Ticket Ion Gaztañaga Sun, 10 Feb 2013 22:09:18 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/7164#comment:2 https://svn.boost.org/trac10/ticket/7164#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Thanks for the report. The first bug it's caused by a missing assignment in weak_count. I'll reopen the bug until you can confirm current trunk code does not suffer from bug <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2" title="#2: Bugs: list::size should be const (closed: fixed)">#2</a> </p> Ticket Ion Gaztañaga Wed, 29 May 2013 07:47:26 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7164#comment:3 https://svn.boost.org/trac10/ticket/7164#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> No bug report received so closing the bug as fixed. </p> Ticket