Boost logo

Boost Users :

Subject: [Boost-users] Problem with asych_write() when sending more than 65536 bytes data on Solaris
From: Ranadheer (p_ranadheer_at_[hidden])
Date: 2012-04-13 13:17:21


We are observing one weird problem when sending message of size more than
65536 bytes using boost asynch_write on Solaris (though the problem is not
observed on Linux). We are using boost version 1.47 with studio 12 CC
compiler (on Solaris) and g++ 4.4.3 (on Linux).

When a message of size more than 65536 (sometimes we are observing the issue
with around 50K bytes size also but with 65536 bytes the issue is always
reproducible) is sent, the message is delivered correctly to the receiver.
But once the message is sent, the io service thread on the sender side goes
into busy-wait loop. "truss" on the sender pid shows the following calls
continuously.

/6: recvmsg(57, 0xFFFFFD7FEB9FDDF0, 0) Err#11 EAGAIN
/6: write(13, " 9\0\0\019\0\0\0", 8) = 8
/6: ioctl(13, DP_POLL, 0xFFFFFD7FEB9FE460) = 1
/6: recvmsg(57, 0xFFFFFD7FEB9FDDF0, 0) Err#11 EAGAIN
/6: write(13, " 9\0\0\019\0\0\0", 8) = 8
/6: ioctl(13, DP_POLL, 0xFFFFFD7FEB9FE460) = 1
/6: recvmsg(57, 0xFFFFFD7FEB9FDDF0, 0) Err#11 EAGAIN
/6: write(13, " 9\0\0\019\0\0\0", 8) = 8
/6: ioctl(13, DP_POLL, 0xFFFFFD7FEB9FE460) = 1
/6: recvmsg(57, 0xFFFFFD7FEB9FDDF0, 0) Err#11 EAGAIN
/6: write(13, " 9\0\0\019\0\0\0", 8) = 8
/6: ioctl(13, DP_POLL, 0xFFFFFD7FEB9FE460) = 1
/6: recvmsg(57, 0xFFFFFD7FEB9FDDF0, 0) Err#11 EAGAIN
/6: write(13, " 9\0\0\019\0\0\0", 8) = 8
/6: ioctl(13, DP_POLL, 0xFFFFFD7FEB9FE460) = 1

"lsof" shows that the socket descriptor 57 above is the socket descriptor
corrected to the receiver.

Thread 6 here is the ioservice thread whose stack trace is -

thread t_at_6 -- ????????
                  thread_proxy
                  boost::detail::thread_data<>::run
                  des::tunnel::ServiceScheduler::processServiceWork
                  boost::asio::io_service::run
                  boost::asio::detail::task_io_service::run
                  boost::asio::detail::task_io_service::do_one
                  boost::asio::detail::dev_poll_reactor::run

The busy-wait loop continues until we stop the receiver.
Also, as mentioned, the issue is always reproducible if the size of the
message more than 65536 (2^16) bytes and sender and receiver are running on
2 different Solaris hosts. If both sender and receiver are running on same
Solaris host then the issue is always reproducible with size 131067 (2^17).

Can someone throw some light on why the ioservice thread here is
continuously trying to read from the receiver though it has successfully
sent the message and receiver is not actually writing anything on the
socket. Please let me know if anyone came across this problem or suggest any
solution.

Thanks
Ranadheer

--
View this message in context: http://boost.2283326.n4.nabble.com/Problem-with-asych-write-when-sending-more-than-65536-bytes-data-on-Solaris-tp4555454p4555454.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net