[Boost-bugs] [Boost C++ Libraries] #8933: on the windows platform async reads with multiple threads can produce random EOF errors

Subject: [Boost-bugs] [Boost C++ Libraries] #8933: on the windows platform async reads with multiple threads can produce random EOF errors
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-07-27 21:08:53


#8933: on the windows platform async reads with multiple threads can produce
random EOF errors
----------------------------------------+----------------------------
 Reporter: Shane Powell <killerbee@…> | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.54.0 | Severity: Showstopper
 Keywords: |
----------------------------------------+----------------------------
 After upgrading upgrading boost to 1.54.0 I started getting lots of eof
 errors out of some of my ASIO based applications that didn't make sense.

 My applications use the single io_service with a thread pool pattern.
 When the thread pool contains more than one thread I started getting
 random eof errors whenever the network traffic started to get heavy.

 Attached is an example program that can reproduce the problem.

 The application built with boost 1.53.0 works fine. Built with boost
 1.54.0 fails.

 I have tried visual studio version 2008 and 2012 with the same results.

 To reproduce the problem I use the following parameters with two instances
 on the same machine:
 SendReceiveTest.exe server 127.0.0.1 100 1 1000 10
 SendReceiveTest.exe client 127.0.0.1 100 2 0 0

 The client will error out on the read with a eof error.

 I tracked the problem back to a posted IO completion event that was
 generated from a on_pending call. The event gets converted to eof because
 ::GetLastError always returns '0' and the transferred bytes are always
 'zero' from the on_pending call. Looking at the changes between boost
 asio v1.53.0 and v1.54.0 I spotted in
 asio\detail\impl\win_iocp_io_service.ipp that some
 PostQueuedCompletionStatus calls where changed form passing
 'overlapped_contains_result' to passing '0'. Changing them back to
 'overlapped_contains_result' fixes the problem.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8933>
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:13 UTC