Boost C++ Libraries: Ticket #7162: socket streams crash with C++11 enabled; tie(this) no longer legal https://svn.boost.org/trac10/ticket/7162 <p> The boost::asio sockets streams classes derive from std::basic_iostream, and then call <code>tie(this)</code>] in the basic_socket_iostream constructor. </p> <p> In C++11 this is no longer legal (I tried providing a link here, but trac wouldn't let me). The issue is explained here: <code>cplusplus.github.com/LWG/lwg-defects.html#835</code> </p> <p> Some standard libraries (like libc++) already implement this behavior, and so attempts to use the ASIO socket streams classes cause infinite recursion leading to eventual stack exhaustion and a crash. </p> <p> I found this issue in boost 1.50.0, but it appears on the boost trunk svn as well so I have filled the ticket against trunk. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7162 Trac 1.4.3 chris_kohlhoff Mon, 23 Jul 2012 23:52:17 GMT <link>https://svn.boost.org/trac10/ticket/7162#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7162#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/79710" title="Instead of using tie(), set the ios_base::unitbuf flag to force the ...">[79710]</a>) Instead of using tie(), set the ios_base::unitbuf flag to force the stream to be flushed after every insertion. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7162" title="#7162: Bugs: socket streams crash with C++11 enabled; tie(this) no longer legal (closed: fixed)">#7162</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Tue, 24 Jul 2012 05:42:45 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7162#comment:2 https://svn.boost.org/trac10/ticket/7162#comment:2 <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/79712" title="Merge from trunk: * Instead of using tie(), set the ios_base::unitbuf ...">[79712]</a>) Merge from trunk: </p> <ul><li>Instead of using tie(), set the ios_base::unitbuf flag to force the stream to be flushed after every insertion. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7162" title="#7162: Bugs: socket streams crash with C++11 enabled; tie(this) no longer legal (closed: fixed)">#7162</a> </li></ul> Ticket