Boost C++ Libraries: Ticket #9558: future continuations unit test hangs in get()/pthread_cond_wait() on Mac 10.7/32-bit/x86/darwin-4.2.1 https://svn.boost.org/trac10/ticket/9558 <p> I'm building 32- and 64-bit versions of thread on Mac and validating the result with the unit tests. Test 'ex_future_then_lib' hangs consistently in pthread_cond_wait() in a 32-bit build, all tests succeed in 64-bit builds. </p> <p> Platform: Mac 10.7.5, Xcode 4.3.3, darwin-4.2.1. </p> <p> Successful build and test (64-bit): </p> <pre class="wiki">./bjam toolset=darwin variant=debug --layout=tagged --with-thread -sNO_BZIP2=1 stage cd libs/thread/test/ ../../../bjam toolset=darwin variant=debug --layout=tagged --with-thread -sNO_BZIP2=1 -a -q -d2 -d+4 </pre><p> Hanging build and test (32-bit): </p> <pre class="wiki">./bjam toolset=darwin variant=debug address-model=32 architecture=x86 --layout=tagged --with-thread -sNO_BZIP2=1 stage cd libs/thread/test/ ../../../bjam toolset=darwin variant=debug address-model=32 architecture=x86 --layout=tagged --with-thread -sNO_BZIP2=1 -a -q -d2 -d+4 </pre><p> Stacktrace from hung unit test: </p> <pre class="wiki">#0 0x9c19c83e in __psynch_cvwait () #1 0x93bf3e21 in _pthread_cond_wait () #2 0x93ba442c in pthread_cond_wait$UNIX2003 () #3 0x00025a0b in boost::condition_variable::wait (this=0x34b16c, m=@0xbffff750) at condition_variable.hpp:73 #4 0x00025bf2 in boost::detail::shared_state_base::wait_internal (this=0x34b120, lk=@0xbffff750, rethrow=true) at future.hpp:327 #5 0x00025cf7 in boost::detail::shared_state_base::wait (this=0x34b120, rethrow=true) at future.hpp:346 #6 0x00031b2b in boost::detail::future_async_shared_state_base&lt;int&gt;::wait (this=0x34b120, rethrow=true) at future.hpp:845 #7 0x00024c05 in boost::detail::shared_state&lt;int&gt;::get (this=0x34b120) at future.hpp:666 #8 0x000248ca in boost::future&lt;int&gt;::get (this=0xbffff978) at future.hpp:1555 #9 0x000021b3 in main () at future_then.cpp:69 </pre><p> Extent of output at time of hang (appears not to have run P2): </p> <pre class="wiki">Starting program: /Users/monty/3P/3p-boost-update/boost/bin.v2/libs/thread/test/ex_future_then_lib.test/darwin-4.2.1/debug/address-model-32/architecture-x86/threading-multi/ex_future_then_lib Reading symbols for shared libraries ++......................... done 0xac7e22c0 - ../example/future_then.cpp[63] &lt;MAIN 0xb0081000 - ../example/future_then.cpp[18] P1 </pre><p> That's the extent of the bug. In addition, there's some sloppy return value coding in the example code: </p> <pre class="wiki">../example/future_then.cpp: In function ‘int p2s(boost::shared_future&lt;int&gt;)’: ../example/future_then.cpp:59: warning: control reaches end of non-void function ../example/future_then.cpp: In function ‘int p2(boost::future&lt;int&gt;)’: ../example/future_then.cpp:40: warning: control reaches end of non-void function </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9558 Trac 1.4.3 Monty Brandenberg <mcbinc@…> Fri, 10 Jan 2014 00:58:48 GMT <link>https://svn.boost.org/trac10/ticket/9558#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9558#comment:1</guid> <description> <p> As a workaround, unit tests can be passed by disabling all the boost::future related features: </p> <pre class="wiki">../../../bjam toolset=darwin variant=debug address-model=32 architecture=x86 --layout=tagged --with-thread -sNO_BZIP2=1 -a -q -d2 -d+4 cxxflags="-DBOOST_THREAD_DONT_PROVIDE_FUTURE_CONTINUATION -DBOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS -DBOOST_THREAD_DONT_PROVIDE_FUTURE_CONTINUATION -DBOOST_THREAD_DONT_PROVIDE_FUTURE_UNWRAP -DBOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET" </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 18 Jan 2014 16:14:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9558#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9558#comment:2</guid> <description> <p> Please, could you check if this change-set <a class="ext-link" href="https://github.com/boostorg/thread/commit/cb845f19e4a975fc95e8b10c096280085d24eb03"><span class="icon">​</span>https://github.com/boostorg/thread/commit/cb845f19e4a975fc95e8b10c096280085d24eb03</a> improves the situation? Note that it restrict the use of the variadic versions. It works for all the compiler for which BOOST_NO_CXX11_DECLTYPE_N3276 is defined. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 18 Jan 2014 16:15:19 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/9558#comment:3 https://svn.boost.org/trac10/ticket/9558#comment:3 <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> Ticket Monty Brandenberg <mcbinc@…> Tue, 21 Jan 2014 17:32:01 GMT <link>https://svn.boost.org/trac10/ticket/9558#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9558#comment:4</guid> <description> <p> I will check the changeset. It may be a day or two before I can get to it... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 21 Jan 2014 18:01:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9558#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9558#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9558#comment:4" title="Comment 4">Monty Brandenberg &lt;mcbinc@…&gt;</a>: </p> <blockquote class="citation"> <p> I will check the changeset. It may be a day or two before I can get to it... </p> </blockquote> <p> It seems that there are yet some troubles. See <a href="http://www.boost.org/development/tests/develop/developer/thread.html">http://www.boost.org/development/tests/develop/developer/thread.html</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 28 Jan 2014 21:02:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9558#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9558#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9558#comment:5" title="Comment 5">viboes</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9558#comment:4" title="Comment 4">Monty Brandenberg &lt;mcbinc@…&gt;</a>: </p> <blockquote class="citation"> <p> I will check the changeset. It may be a day or two before I can get to it... </p> </blockquote> <p> It seems that there are yet some troubles. See <a href="http://www.boost.org/development/tests/develop/developer/thread.html">http://www.boost.org/development/tests/develop/developer/thread.html</a>. </p> </blockquote> <p> The regression test pass now. It seems there were some issues with the git files update on some regression testers. Please let me know if the develop branch fixes your issue. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 26 Feb 2014 21:38:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9558#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9558#comment:7</guid> <description> <p> Moved to problem as this doesn't prevent the use of the library. .then() is experimental. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 26 Feb 2014 21:39:22 GMT</pubDate> <title>severity changed https://svn.boost.org/trac10/ticket/9558#comment:8 https://svn.boost.org/trac10/ticket/9558#comment:8 <ul> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> Ticket viboes Wed, 10 Sep 2014 05:46:20 GMT <link>https://svn.boost.org/trac10/ticket/9558#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9558#comment:9</guid> <description> <p> data race condition identified in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/10478" title="#10478: Bugs: Data race in boost/thread/future.hpp (closed: fixed)">#10478</a> Data race in boost/thread/future.hpp </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 10 Sep 2014 11:52:31 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/9558#comment:10 https://svn.boost.org/trac10/ticket/9558#comment:10 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> <p> <a class="ext-link" href="https://github.com/boostorg/thread/commit/11e4c950acc8f86b7cf404c4df4e3d3d50d4e55e"><span class="icon">​</span>https://github.com/boostorg/thread/commit/11e4c950acc8f86b7cf404c4df4e3d3d50d4e55e</a> </p> Ticket viboes Tue, 16 Sep 2014 06:17:01 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9558#comment:11 https://svn.boost.org/trac10/ticket/9558#comment:11 <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> Ticket