Boost C++ Libraries: Ticket #10447: io_service destructor hangs if serial_port read is queued, even if not running https://svn.boost.org/trac10/ticket/10447 <p> The following program does not terminate. </p> <pre class="wiki">#include &lt;boost/asio.hpp&gt; int main() { auto* ios = new boost::asio::io_service; auto* port = new boost::asio::serial_port(*ios); port-&gt;open("COM6"); char c; boost::asio::async_read(*port, boost::asio::buffer(&amp;c, 1), [](boost::system::error_code, int) {}); delete ios; } </pre><p> Despite the fact that the io_service is not running, its destructor hangs if there is a pending async_read from a serial_port. If that read completes (by receiving one byte), the program terminates. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10447 Trac 1.4.3 Martinho Fernandes <martinho.fernandes@…> Wed, 03 Sep 2014 12:50:39 GMT <link>https://svn.boost.org/trac10/ticket/10447#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10447#comment:1</guid> <description> <p> Oh, I can only reproduce this on Windows. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 10 Sep 2014 12:29:52 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/10447#comment:2 https://svn.boost.org/trac10/ticket/10447#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">chris_kohlhoff</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">asio</span> </li> </ul> Ticket anonymous Mon, 08 Aug 2016 23:06:46 GMT <link>https://svn.boost.org/trac10/ticket/10447#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10447#comment:3</guid> <description> <p> User error: objects dependent on an io_service should be destroyed prior to that io_service's destruction. </p> </description> <category>Ticket</category> </item> </channel> </rss>