Boost C++ Libraries: Ticket #8935: async_write successful but only wrote 64K, handler invoked with bytes_transferred 0 https://svn.boost.org/trac10/ticket/8935 <p> Most of the time, everytime works perfect. Since boost 1.54 on Windows, I observed the following pattern in a minority of the cases (about 1 in 10 connections): </p> <ul><li>socket is open and in use, previous read-write sequences ok </li><li>async_write(103354 bytes, 4 buffers) </li><li>handle_async_write: 0 bytes written, The operation completed successfully </li><li>async_write(5 bytes, 3 buffers) </li><li>handle_async_write: 5 bytes written, The operation completed successfully </li></ul><p> What is not correct: </p> <ul><li>write handler is invoked with no error condition, but bytes_transferred set to 0 instead of the expected 103354 bytes </li><li>a packet sniffer shows that of the 103354 bytes, 65536 bytes were transferred, even though 0 was reported </li><li>the packet sniffer also shows that the 5 following bytes were transferred </li></ul><p> This corrupts the data stream. </p> <p> When I set a conditional breakpoint on the write handler, I see that the case where no error is reported but bytes_transferred != 0 happens much more regularly, but it does not seem to be problematic for writes of less than 64K. </p> <p> This is a stack trace of such an occurance (bytes_transferred is 0, e is 0): </p> <pre class="wiki"> hello.wt.exe!http::server::Connection::handleWriteResponse(const boost::system::error_code &amp; e, unsigned int bytes_transferred) Line 372 C++ hello.wt.exe!boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;::call&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt;,boost::system::error_code const ,unsigned int&gt;(boost::shared_ptr&lt;http::server::TcpConnection&gt; &amp; u, const void * __formal, const boost::system::error_code &amp; b1, unsigned int &amp; b2) Line 271 C++ hello.wt.exe!boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;::operator()&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;(boost::shared_ptr&lt;http::server::TcpConnection&gt; &amp; u, const boost::system::error_code &amp; a1, unsigned int a2) Line 287 C++ hello.wt.exe!boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt;::operator()&lt;boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list2&lt;boost::system::error_code const &amp;,unsigned int const &amp;&gt; &gt;(boost::_bi::type&lt;void&gt; __formal, boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt; &amp; f, boost::_bi::list2&lt;boost::system::error_code const &amp;,unsigned int const &amp;&gt; &amp; a, int __formal) Line 393 C++ hello.wt.exe!boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;::operator()&lt;boost::system::error_code,unsigned int&gt;(const boost::system::error_code &amp; a1, const unsigned int &amp; a2) Line 103 C++ hello.wt.exe!boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt;::operator()() Line 129 C++ hello.wt.exe!boost::asio::asio_handler_invoke&lt;boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &gt;(boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; function, ...) Line 65 C++ hello.wt.exe!boost_asio_handler_invoke_helpers::invoke&lt;boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt;(boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &amp; function, boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &amp; context) Line 37 C++ hello.wt.exe!boost::asio::detail::asio_handler_invoke&lt;boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt;(boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &amp; function, boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; * this_handler) Line 171 C++ hello.wt.exe!boost_asio_handler_invoke_helpers::invoke&lt;boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &gt;(boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &amp; function, boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &amp; context) Line 37 C++ hello.wt.exe!boost::asio::detail::strand_service::dispatch&lt;boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &gt;(boost::asio::detail::strand_service::strand_impl * &amp; impl, boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &amp; handler) Line 62 C++ hello.wt.exe!boost::asio::io_service::strand::dispatch&lt;boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &gt;(const boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::system::error_code,unsigned int&gt; &amp; handler) Line 157 C++ hello.wt.exe!boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt;::operator()&lt;boost::system::error_code,unsigned int&gt;(const boost::system::error_code &amp; arg1, const unsigned int &amp; arg2) Line 99 C++ &gt; hello.wt.exe!boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;::operator()(const boost::system::error_code &amp; ec, unsigned int bytes_transferred, int start) Line 194 C++ hello.wt.exe!boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;::operator()() Line 129 C++ hello.wt.exe!boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt;::operator()() Line 192 C++ hello.wt.exe!boost::asio::asio_handler_invoke&lt;boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; &gt;(boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; function, ...) Line 65 C++ hello.wt.exe!boost_asio_handler_invoke_helpers::invoke&lt;boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt;(boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; &amp; function, boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &amp; context) Line 37 C++ hello.wt.exe!boost::asio::detail::asio_handler_invoke&lt;boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt;,boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt;(boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; &amp; function, boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; * this_handler) Line 276 C++ hello.wt.exe!boost_asio_handler_invoke_helpers::invoke&lt;boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt;,boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; &gt;(boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; &amp; function, boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; &amp; context) Line 37 C++ hello.wt.exe!boost::asio::detail::completion_handler&lt;boost::asio::detail::rewrapped_handler&lt;boost::asio::detail::binder2&lt;boost::asio::detail::write_op&lt;boost::asio::basic_stream_socket&lt;boost::asio::ip::tcp,boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;,std::vector&lt;boost::asio::const_buffer,std::allocator&lt;boost::asio::const_buffer&gt; &gt;,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler&lt;boost::asio::io_service::strand,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt;,boost::asio::detail::is_continuation_if_running&gt; &gt;,boost::system::error_code,unsigned int&gt;,boost::_bi::bind_t&lt;void,boost::_mfi::mf2&lt;void,http::server::Connection,boost::system::error_code const &amp;,unsigned int&gt;,boost::_bi::list3&lt;boost::_bi::value&lt;boost::shared_ptr&lt;http::server::TcpConnection&gt; &gt;,boost::arg&lt;1&gt;,boost::arg&lt;2&gt; &gt; &gt; &gt; &gt;::do_complete(boost::asio::detail::win_iocp_io_service * owner, boost::asio::detail::win_iocp_operation * base, const boost::system::error_code &amp; __formal, unsigned int __formal) Line 68 C++ hello.wt.exe!boost::asio::detail::win_iocp_operation::complete(boost::asio::detail::win_iocp_io_service &amp; owner, const boost::system::error_code &amp; ec, unsigned int bytes_transferred) Line 45 C++ hello.wt.exe!boost::asio::detail::strand_service::do_complete(boost::asio::detail::win_iocp_io_service * owner, boost::asio::detail::win_iocp_operation * base, const boost::system::error_code &amp; ec, unsigned int __formal) Line 168 C++ hello.wt.exe!boost::asio::detail::win_iocp_operation::complete(boost::asio::detail::win_iocp_io_service &amp; owner, const boost::system::error_code &amp; ec, unsigned int bytes_transferred) Line 45 C++ hello.wt.exe!boost::asio::detail::win_iocp_io_service::do_one(bool block, boost::system::error_code &amp; ec) Line 402 C++ hello.wt.exe!boost::asio::detail::win_iocp_io_service::run(boost::system::error_code &amp; ec) Line 161 C++ hello.wt.exe!boost::asio::io_service::run() Line 59 C++ </pre><p> I can reproduce this quite easily, please ask if you need more information. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8935 Trac 1.4.3 smueller@… Tue, 06 Aug 2013 00:52:11 GMT <link>https://svn.boost.org/trac10/ticket/8935#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8935#comment:1</guid> <description> <p> This ticket looks like it may be the same as <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8933" title="#8933: Bugs: on the windows platform async reads with multiple threads can produce ... (closed: fixed)">#8933</a>. Shane Powell, who opened that ticket, made a simple patch that addressed the issue. It might work for you as it did for me. </p> </description> <category>Ticket</category> </item> <item> <author>wim@…</author> <pubDate>Tue, 06 Aug 2013 07:49:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8935#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8935#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8935#comment:1" title="Comment 1">smueller@…</a>: </p> <blockquote class="citation"> <p> This ticket looks like it may be the same as <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8933" title="#8933: Bugs: on the windows platform async reads with multiple threads can produce ... (closed: fixed)">#8933</a>. Shane Powell, who opened that ticket, made a simple patch that addressed the issue. It might work for you as it did for me. </p> </blockquote> <p> I applied the patch, and it seems to solve the issue. Thank you for your suggestion! </p> <p> Additional remark (if it still matters): the first buffer of the 4 buffers passed to async_write I was talking about in my original report is probably 64K, which would explain why 64K is transmitted. </p> <p> I hope this gets fixed soon, it makes boost 1.54 useless for our application (Wt), and I assume many other applications are affected too. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 09 Aug 2013 22:42:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8935#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8935#comment:3</guid> <description> <p> This looks like it may be the same underlying cause as <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/8967"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/8967</a> </p> <p> I believe there are some issues in the Windows IOCP implementation that are described in ricket 8967 - the main ones are that on_pending should probably not be used and WSARecv/WSARecv should have null pointers for the bytes read parameter. </p> </description> <category>Ticket</category> </item> <item> <author>smueller@…</author> <pubDate>Fri, 09 Aug 2013 23:29:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8935#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8935#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8935#comment:3" title="Comment 3">anonymous</a>: </p> <blockquote class="citation"> <p> This looks like it may be the same underlying cause as <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/8967"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/8967</a> </p> <p> I believe there are some issues in the Windows IOCP implementation that are described in ricket 8967 - the main ones are that on_pending should probably not be used and WSARecv/WSARecv should have null pointers for the bytes read parameter. </p> </blockquote> <p> The issues in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8967" title="#8967: Bugs: Spurious zero bytes written and eof notifications highlight ASIO IOCP ... (closed: invalid)">#8967</a> are for the TCP/IP implementation only. <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8933" title="#8933: Bugs: on the windows platform async reads with multiple threads can produce ... (closed: fixed)">#8933</a> deals with potentially all async_read instantiations under Windows. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Niall Douglas</dc:creator> <pubDate>Tue, 13 Aug 2013 14:49:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8935#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8935#comment:5</guid> <description> <p> Bug <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8669" title="#8669: Bugs: boost::asio::windows::random_access_handle is seriously broken (closed: fixed)">#8669</a> is also related - 64Kb max transfer size, plus it can ignore all but the first buffer. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Tue, 01 Oct 2013 10:54:12 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8935#comment:6 https://svn.boost.org/trac10/ticket/8935#comment:6 <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">duplicate</span> </li> </ul> <p> See <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8933" title="#8933: Bugs: on the windows platform async reads with multiple threads can produce ... (closed: fixed)">#8933</a>. </p> Ticket