Boost C++ Libraries: Ticket #11394: Sanity checks fail on unstable binomial heap when pushing elements of same weight https://svn.boost.org/trac10/ticket/11394 <p> Hi, I have come across a bug according to which sanity checks fail on unstable binomial heaps when pushing elements of same weight. If sanity checks are not enabled, pushing/popping is done successfully, but in that case assertions in user code fail (I was just comparing the size of the heap with that of a counter that keeps track of the number of elements contained in the heap). </p> <p> Furthermore, the result of empty() is not always aligned with that of size(), so for example empty() might report true, while size() might report 1. empty() gives always a correct result, since it just returns the result of the comparison `top_element == NULL', while size() reports the size of the size_holder, which seems that is not updated correctly. If the heap is defined as stable, there is no such problem. </p> <p> Tested versions are 1.57.0 and 1.58.0 and are both affected. You may find the source code to reproduce such behavior in the attached .cpp file. There, I also include a fibonacci heap (apart from stable/unstable binomial heaps) in which the bug is not present. </p> <p> Thanks, Babis </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11394 Trac 1.4.3 anonymous Thu, 11 Jun 2015 09:59:45 GMT attachment set https://svn.boost.org/trac10/ticket/11394 https://svn.boost.org/trac10/ticket/11394 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_binomial_heap_bug.cpp</span> </li> </ul> <p> File to reproduce the bug </p> Ticket timblechmann Thu, 11 Jun 2015 10:32:11 GMT <link>https://svn.boost.org/trac10/ticket/11394#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11394#comment:1</guid> <description> <p> thanks for the reproducer ... unfortunately i won't be able to have a closer look at this atm ... so it might take some time ... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>timblechmann</dc:creator> <pubDate>Sat, 05 Sep 2015 07:05:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11394#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11394#comment:2</guid> <description> <p> fixed in develop </p> </description> <category>Ticket</category> </item> <item> <dc:creator>timblechmann</dc:creator> <pubDate>Sat, 05 Sep 2015 07:05:48 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11394#comment:3 https://svn.boost.org/trac10/ticket/11394#comment:3 <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> Ticket