Boost C++ Libraries: Ticket #11250: future made from make_exceptional fails on assertion in destructor https://svn.boost.org/trac10/ticket/11250 <p> A future created from make_exceptional fails an assertion during destruction: </p> <pre class="wiki">../include/boost/thread/future.hpp:155: virtual boost::detail::shared_state_base::~shared_state_base(): Assertion `cnt_==0' failed. </pre><p> The error can be reproduced by calling <code>compute(-1)</code> in examples/make_future.cpp </p> <p> Trace: </p> <pre class="wiki">#0 0x0000003b1f6348d7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55 #1 0x0000003b1f63653a in __GI_abort () at abort.c:89 #2 0x0000003b1f62d47d in __assert_fail_base (fmt=0x3b1f786cb8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x42a333 "cnt_==0", file=file@entry=0x42a310 "../include/boost/thread/future.hpp", line=line@entry=155, function=function@entry=0x42a8a0 &lt;boost::detail::shared_state_base::~shared_state_base()::__PRETTY_FUNCTION__&gt; "virtual boost::detail::shared_state_base::~shared_state_base()") at assert.c:92 #3 0x0000003b1f62d532 in __GI___assert_fail (assertion=0x42a333 "cnt_==0", file=0x42a310 "../include/boost/thread/future.hpp", line=155, function=0x42a8a0 &lt;boost::detail::shared_state_base::~shared_state_base()::__PRETTY_FUNCTION__&gt; "virtual boost::detail::shared_state_base::~shared_state_base()") at assert.c:101 #4 0x000000000040ddb5 in boost::detail::shared_state_base::~shared_state_base (this=0x648200, __in_chrg=&lt;optimized out&gt;) at ../include/boost/thread/future.hpp:155 #5 0x0000000000422e0d in boost::detail::shared_state&lt;int&gt;::~shared_state (this=0x648200, __in_chrg=&lt;optimized out&gt;) at ../include/boost/thread/future.hpp:488 #6 0x0000000000422e3c in boost::detail::shared_state&lt;int&gt;::~shared_state (this=0x648200, __in_chrg=&lt;optimized out&gt;) at ../include/boost/thread/future.hpp:488 #7 0x0000000000423b0b in boost::checked_delete&lt;boost::detail::shared_state&lt;int&gt; &gt; (x=0x648200) at /usr/local/include/boost/core/checked_delete.hpp:34 #8 0x000000000042655e in boost::detail::sp_counted_impl_p&lt;boost::detail::shared_state&lt;int&gt; &gt;::dispose ( this=0x6481c0) at /usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78 #9 0x000000000040ac4a in boost::detail::sp_counted_base::release (this=0x6481c0) at /usr/local/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:146 #10 0x000000000040ad0d in boost::detail::shared_count::~shared_count (this=0x7fffffffd8e8, __in_chrg=&lt;optimized out&gt;) at /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:443 #11 0x0000000000418c7a in boost::shared_ptr&lt;boost::detail::shared_state&lt;int&gt; &gt;::~shared_ptr (this=0x7fffffffd8e0, __in_chrg=&lt;optimized out&gt;) at /usr/local/include/boost/smart_ptr/shared_ptr.hpp:323 #12 0x0000000000418ff2 in boost::detail::basic_future&lt;int&gt;::~basic_future (this=0x7fffffffd8e0, __in_chrg=&lt;optimized out&gt;) at ../include/boost/thread/future.hpp:1189 #13 0x0000000000412882 in boost::future&lt;int&gt;::~future (this=0x7fffffffd8e0, __in_chrg=&lt;optimized out&gt;) at ../include/boost/thread/future.hpp:1541 #14 0x000000000040a3db in main () at make_future.cpp:100 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11250 Trac 1.4.3 viboes Wed, 29 Apr 2015 22:32:29 GMT owner, status changed https://svn.boost.org/trac10/ticket/11250#comment:1 https://svn.boost.org/trac10/ticket/11250#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Thanks for catching this untested function. </p> Ticket viboes Wed, 29 Apr 2015 23:28:56 GMT <link>https://svn.boost.org/trac10/ticket/11250#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11250#comment:2</guid> <description> <p> <a class="ext-link" href="https://github.com/boostorg/thread/commit/bce7eabba29a96c762e3a5e5c28cb6928fe706c6"><span class="icon">​</span>https://github.com/boostorg/thread/commit/bce7eabba29a96c762e3a5e5c28cb6928fe706c6</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 29 Apr 2015 23:29:06 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/11250#comment:3 https://svn.boost.org/trac10/ticket/11250#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> Ticket viboes Thu, 13 Aug 2015 06:58:49 GMT milestone changed https://svn.boost.org/trac10/ticket/11250#comment:4 https://svn.boost.org/trac10/ticket/11250#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.59.0</span> → <span class="trac-field-new">Boost 1.60.0</span> </li> </ul> Ticket viboes Wed, 02 Sep 2015 18:08:54 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11250#comment:5 https://svn.boost.org/trac10/ticket/11250#comment:5 <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-new">fixed</span> </li> </ul> <p> <a class="ext-link" href="https://github.com/boostorg/thread/commit/a3497e1ffceb14318ff09e339a53293926351057"><span class="icon">​</span>https://github.com/boostorg/thread/commit/a3497e1ffceb14318ff09e339a53293926351057</a> </p> Ticket