[Boost-bugs] [Boost C++ Libraries] #10447: io_service destructor hangs if serial_port read is queued, even if not running

Subject: [Boost-bugs] [Boost C++ Libraries] #10447: io_service destructor hangs if serial_port read is queued, even if not running
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-09-03 12:33:31


#10447: io_service destructor hangs if serial_port read is queued, even if not
running
-------------------------------------------------+-------------------------
 Reporter: Martinho Fernandes | Type: Bugs
  <martinho.fernandes@…> | Milestone: To Be
   Status: new | Determined
Component: None | Version: Boost
 Severity: Problem | 1.55.0
                                                 | Keywords:
-------------------------------------------------+-------------------------
 The following program does not terminate.

 {{{
 #include <boost/asio.hpp>

 int main() {
     auto* ios = new boost::asio::io_service;
     auto* port = new boost::asio::serial_port(*ios);
     port->open("COM6");
     char c;
     boost::asio::async_read(*port, boost::asio::buffer(&c, 1),
 [](boost::system::error_code, int) {});

     delete ios;
 }
 }}}

 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10447>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC