Opened 9 years ago
Closed 9 years ago
#8935 closed Bugs (duplicate)
async_write successful but only wrote 64K, handler invoked with bytes_transferred 0
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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):
- socket is open and in use, previous read-write sequences ok
- async_write(103354 bytes, 4 buffers)
- handle_async_write: 0 bytes written, The operation completed successfully
- async_write(5 bytes, 3 buffers)
- handle_async_write: 5 bytes written, The operation completed successfully
What is not correct:
- write handler is invoked with no error condition, but bytes_transferred set to 0 instead of the expected 103354 bytes
- a packet sniffer shows that of the 103354 bytes, 65536 bytes were transferred, even though 0 was reported
- the packet sniffer also shows that the 5 following bytes were transferred
This corrupts the data stream.
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.
This is a stack trace of such an occurance (bytes_transferred is 0, e is 0):
hello.wt.exe!http::server::Connection::handleWriteResponse(const boost::system::error_code & e, unsigned int bytes_transferred) Line 372 C++ hello.wt.exe!boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>::call<boost::shared_ptr<http::server::TcpConnection>,boost::system::error_code const ,unsigned int>(boost::shared_ptr<http::server::TcpConnection> & u, const void * __formal, const boost::system::error_code & b1, unsigned int & b2) Line 271 C++ hello.wt.exe!boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>::operator()<boost::shared_ptr<http::server::TcpConnection> >(boost::shared_ptr<http::server::TcpConnection> & u, const boost::system::error_code & a1, unsigned int a2) Line 287 C++ hello.wt.exe!boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> >::operator()<boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list2<boost::system::error_code const &,unsigned int const &> >(boost::_bi::type<void> __formal, boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int> & f, boost::_bi::list2<boost::system::error_code const &,unsigned int const &> & a, int __formal) Line 393 C++ hello.wt.exe!boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >::operator()<boost::system::error_code,unsigned int>(const boost::system::error_code & a1, const unsigned int & a2) Line 103 C++ hello.wt.exe!boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int>::operator()() Line 129 C++ hello.wt.exe!boost::asio::asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> >(boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> function, ...) Line 65 C++ hello.wt.exe!boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > >(boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> & function, boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > & context) Line 37 C++ hello.wt.exe!boost::asio::detail::asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int>(boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> & function, boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> * this_handler) Line 171 C++ hello.wt.exe!boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int>,boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> >(boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> & function, boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> & context) Line 37 C++ hello.wt.exe!boost::asio::detail::strand_service::dispatch<boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> >(boost::asio::detail::strand_service::strand_impl * & impl, boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> & handler) Line 62 C++ hello.wt.exe!boost::asio::io_service::strand::dispatch<boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> >(const boost::asio::detail::binder2<boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::system::error_code,unsigned int> & handler) Line 157 C++ hello.wt.exe!boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running>::operator()<boost::system::error_code,unsigned int>(const boost::system::error_code & arg1, const unsigned int & arg2) Line 99 C++ > hello.wt.exe!boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >::operator()(const boost::system::error_code & ec, unsigned int bytes_transferred, int start) Line 194 C++ hello.wt.exe!boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>::operator()() Line 129 C++ hello.wt.exe!boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > >::operator()() Line 192 C++ hello.wt.exe!boost::asio::asio_handler_invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > >(boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > function, ...) Line 65 C++ hello.wt.exe!boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > >,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > >(boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > & function, boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > & context) Line 37 C++ hello.wt.exe!boost::asio::detail::asio_handler_invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > >,boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > >(boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > & function, boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > * this_handler) Line 276 C++ hello.wt.exe!boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > >,boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > >(boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > & function, boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > & context) Line 37 C++ hello.wt.exe!boost::asio::detail::completion_handler<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp> >,std::vector<boost::asio::const_buffer,std::allocator<boost::asio::const_buffer> >,boost::asio::detail::transfer_all_t,boost::asio::detail::wrapped_handler<boost::asio::io_service::strand,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > >,boost::asio::detail::is_continuation_if_running> >,boost::system::error_code,unsigned int>,boost::_bi::bind_t<void,boost::_mfi::mf2<void,http::server::Connection,boost::system::error_code const &,unsigned int>,boost::_bi::list3<boost::_bi::value<boost::shared_ptr<http::server::TcpConnection> >,boost::arg<1>,boost::arg<2> > > > >::do_complete(boost::asio::detail::win_iocp_io_service * owner, boost::asio::detail::win_iocp_operation * base, const boost::system::error_code & __formal, unsigned int __formal) Line 68 C++ hello.wt.exe!boost::asio::detail::win_iocp_operation::complete(boost::asio::detail::win_iocp_io_service & owner, const boost::system::error_code & 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 & ec, unsigned int __formal) Line 168 C++ hello.wt.exe!boost::asio::detail::win_iocp_operation::complete(boost::asio::detail::win_iocp_io_service & owner, const boost::system::error_code & 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 & ec) Line 402 C++ hello.wt.exe!boost::asio::detail::win_iocp_io_service::run(boost::system::error_code & ec) Line 161 C++ hello.wt.exe!boost::asio::io_service::run() Line 59 C++
I can reproduce this quite easily, please ask if you need more information.
Change History (6)
follow-up: 2 comment:1 by , 9 years ago
comment:2 by , 9 years ago
Replying to smueller@…:
This ticket looks like it may be the same as #8933. Shane Powell, who opened that ticket, made a simple patch that addressed the issue. It might work for you as it did for me.
I applied the patch, and it seems to solve the issue. Thank you for your suggestion!
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.
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.
follow-up: 4 comment:3 by , 9 years ago
This looks like it may be the same underlying cause as https://svn.boost.org/trac/boost/ticket/8967
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.
comment:4 by , 9 years ago
Replying to anonymous:
This looks like it may be the same underlying cause as https://svn.boost.org/trac/boost/ticket/8967
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.
The issues in #8967 are for the TCP/IP implementation only. #8933 deals with potentially all async_read instantiations under Windows.
comment:5 by , 9 years ago
Bug #8669 is also related - 64Kb max transfer size, plus it can ignore all but the first buffer.
This ticket looks like it may be the same as #8933. Shane Powell, who opened that ticket, made a simple patch that addressed the issue. It might work for you as it did for me.