Boost C++ Libraries: Ticket #5021: io_service destructor hangs on Mac OS X https://svn.boost.org/trac10/ticket/5021 <p> Sometimes, when destroying an io_service object on Mac OS X, my application is locked indefinitely. I have the feeling this happens when I destroy the io_service object right at the time when something's wrong with my network connection. </p> <p> I have attached Instruments, and this seems to point that it's stuck in the destructor of pipe_secet_interrupter(), in the call to close() (See screenshot attached). </p> <p> Is there something that can be done to avoid this? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5021 Trac 1.4.3 Remko Tronçon <remko@…> Fri, 24 Dec 2010 22:33:18 GMT attachment set https://svn.boost.org/trac10/ticket/5021 https://svn.boost.org/trac10/ticket/5021 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">BoostAsioBug.png</span> </li> </ul> <p> Profile data from hanging process </p> Ticket Remko Tronçon <remko@…> Sun, 26 Dec 2010 23:02:28 GMT <link>https://svn.boost.org/trac10/ticket/5021#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:1</guid> <description> <p> FYI, this also seems to happen in healthy network conditions, and other users of our application have reported the same issue (also on Mac OS X), with the same profile trace. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Thu, 06 Jan 2011 11:21:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:2</guid> <description> <p> Possibly a Mac OS bug, e.g. see <a class="ext-link" href="http://bugs.python.org/issue7401"><span class="icon">​</span>http://bugs.python.org/issue7401</a>. </p> <p> What happens if you modify: </p> <pre class="wiki">asio/detail/select_interrupter.hpp asio/detail/socket_select_interrupter.hpp asio/detail/impl/socket_select_interrupter.ipp </pre><p> so that socket_select_interrupter is used on Mac OS X? </p> </description> <category>Ticket</category> </item> <item> <author>Remko Tronçon <remko@…></author> <pubDate>Sat, 15 Jan 2011 16:10:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:3</guid> <description> <p> The test program in that report doesn't seem to exhibit the problem here, but the description of the problem sounds plausible. </p> <p> Since it's hard for me to reproduce the problem, I changed our code to ensure that close() and write() are never called simultaneously, and will check with the user later if he still has the problem. </p> <p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <author>Remko Tronçon <remko@…></author> <pubDate>Thu, 20 Jan 2011 09:23:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:4</guid> <description> <p> Several users have still reported the same problem, after changing the code to ensure that nothing is done on the socket from different threads simultaniously. It seems to be a different issue than the one from the python tracker? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Thu, 20 Jan 2011 09:58:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:5</guid> <description> <p> Did you try changing the select_interrupter? </p> </description> <category>Ticket</category> </item> <item> <author>Remko Tronçon <remko@…></author> <pubDate>Thu, 20 Jan 2011 20:46:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:6</guid> <description> <p> Hi Chris, </p> <p> Same problem it seems: </p> <pre class="wiki">017 2659 Thread_1779307 DispatchQueue_1: com.apple.main-thread (serial) 018 2659 start 019 2659 main 020 2659 Swift::QtSwift::~QtSwift() 021 2659 Swift::BoostNetworkFactories::~BoostNetworkFactories() 022 2659 Swift::BoostIOServiceThread::~BoostIOServiceThread() 023 2659 boost::asio::io_service::~io_service() 024 2659 boost::asio::detail::service_registry::~service_registry() 025 2659 boost::asio::detail::service_registry::destroy(boost::asio::io_service::service*) 026 2659 boost::asio::detail::kqueue_reactor::~kqueue_reactor() 027 2659 boost::asio::detail::socket_select_interrupter::~socket_select_interrupter() 028 2659 boost::asio::detail::socket_ops::close(int, unsigned char&amp;, bool, boost::system::error_code&amp;) 029 2659 close </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Thu, 20 Jan 2011 21:04:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:7</guid> <description> <p> All I can suggest is that you change the select_interrupter's destructor (pipe or socket, whichever is easier to test) to call reset() before it closes the descriptors. Let me know if that makes any difference, thanks. </p> </description> <category>Ticket</category> </item> <item> <author>Remko Tronçon <remko@…></author> <pubDate>Thu, 20 Jan 2011 21:56:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:8</guid> <description> <p> Calling reset() doesn't help. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Thu, 20 Jan 2011 23:52:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:9</guid> <description> <p> Well, I'm afraid that unless you can cut it down to a small test case there's little I can do. </p> <p> BTW, you never mentioned which version of Mac OS X is involved. Is there any pattern there? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Fri, 21 Jan 2011 00:06:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:10</guid> <description> <p> You might also want to see what happens if you disable kqueue (by building with BOOST_ASIO_DISABLE_KQUEUE defined). </p> </description> <category>Ticket</category> </item> <item> <author>Remko Tronçon <remko@…></author> <pubDate>Sat, 22 Jan 2011 10:11:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:11</guid> <description> <p> Cutting it down will probably be hard, since I can't reproduce it myself. The OS X version is the latest (10.6.6 i believe). </p> <p> Disabling kqueue seems to make the problem go away. Does this help anything? </p> </description> <category>Ticket</category> </item> <item> <author>Remko Tronçon <remko@…></author> <pubDate>Sat, 22 Jan 2011 10:20:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:12</guid> <description> <p> Maybe useful: it seems the program from the Python tracker also gets stuck in close() for the user that is reporting the problem. For the test program, it's not in an uninterruptable sleep though, whereas it is for our application. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Sat, 22 Jan 2011 10:55:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:13</guid> <description> <p> Hmmm, if it's kqueue related, perhaps the interrupter's descriptor needs to be explicitly removed from the kqueue before closing: </p> <pre class="wiki"> --- kqueue_reactor.ipp 24 Oct 2010 04:03:09 -0000 1.1.2.7 +++ kqueue_reactor.ipp 22 Jan 2011 10:52:47 -0000 @@ -54,6 +54,11 @@ kqueue_reactor::~kqueue_reactor() { + struct kevent event; + BOOST_ASIO_KQUEUE_EV_SET(&amp;event, interrupter_.read_descriptor(), + EVFILT_READ, EV_DELETE, 0, 0, &amp;interrupter_); + ::kevent(kqueue_fd_, &amp;event, 1, 0, 0, 0); + close(kqueue_fd_); } </pre><p> Just a stab in the dark really, but probably worth trying. </p> </description> <category>Ticket</category> </item> <item> <author>Remko Tronçon <remko@…></author> <pubDate>Sat, 22 Jan 2011 11:40:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:14</guid> <description> <p> Nope, that doesn't seem to help :-( </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Sat, 22 Jan 2011 11:56:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:15</guid> <description> <p> Sadly, I think that means you'll need to disable kqueue for the moment. It smells like it could be an OS bug. However, I don't know what support channels Apple provides for this sort of thing. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Remko</dc:creator> <pubDate>Fri, 28 Jan 2011 23:15:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:16</guid> <description> <p> I fixed a destruction order problem in our application where a timer was being destructed after the io_service object was destroyed. Making sure the io_service stays alive until the last timer goes away seems to have made the loop disappear. </p> </description> <category>Ticket</category> </item> <item> <author>arvid@…</author> <pubDate>Thu, 17 Feb 2011 07:16:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:17</guid> <description> <p> I have a similar issue in libtorrent on Mac OS X 10.6.5, built as 64 bit. I'm not sure about what might have made this start to happen, but it appears to have started around the time when I merged uTP support into trunk, which essentially mean a lot more traffic (and events) over a single udp socket. It seems to somehow be related to busyness, as it seems to be more likely to hang when it's been running for a while (an hour or so). It hangs here (I'm on boost 1.44): </p> <pre class="wiki">Call graph: 2674 libtorrent::session::~session() 2674 boost::shared_ptr&lt;libtorrent::aux::session_impl&gt;::~shared_ptr() 2674 boost::detail::shared_count::~shared_count() 2674 boost::detail::sp_counted_base::release() 2674 boost::detail::sp_counted_impl_p&lt;libtorrent::aux::session_impl&gt;::dispose() 2674 void boost::checked_delete&lt;libtorrent::aux::session_impl&gt;(libtorrent::aux::session_impl*) 2674 libtorrent::aux::session_impl::~session_impl() 2674 boost::asio::io_service::~io_service() 2674 boost::asio::detail::service_registry::~service_registry() 2674 boost::asio::detail::service_registry::destroy(boost::asio::io_service::service*) 2674 boost::asio::detail::kqueue_reactor::~kqueue_reactor() 2674 boost::asio::detail::pipe_select_interrupter::~pipe_select_interrupter() 2674 close </pre><p> This is the last thread alive at this point, so I don't think it's related to multithreading. </p> <p> It definitely seems like an OS bug to me. close() isn't ever supposed to hang indefinitely, right? </p> </description> <category>Ticket</category> </item> <item> <author>Remko Tronçon <remko@…></author> <pubDate>Thu, 17 Feb 2011 07:29:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:18</guid> <description> <p> Arvid, </p> <p> I can at least confirm that we didn't have reports of the problem anymore since we avoided calling close() after destroying the io_service object. If you're sure your session shared_ptr isn't accidentally kept alive longer than io_service (a shared_ptr pitfall we fell into), maybe your problem is slightly different. </p> </description> <category>Ticket</category> </item> <item> <author>aastolfi@…</author> <pubDate>Wed, 23 Feb 2011 17:05:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:19</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5021#comment:9" title="Comment 9">chris_kohlhoff</a>: </p> <blockquote class="citation"> <p> Well, I'm afraid that unless you can cut it down to a small test case there's little I can do. </p> <p> BTW, you never mentioned which version of Mac OS X is involved. Is there any pattern there? </p> </blockquote> <p> I've run into the same problem on Mac OS X 10.6.4 </p> <p> Attaching simplified repro code (repro.cpp); note in the comments there are a few places that seem to be crucial to reproducing the hang. </p> </description> <category>Ticket</category> </item> <item> <author>aastolfi@…</author> <pubDate>Wed, 23 Feb 2011 17:09:05 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5021 https://svn.boost.org/trac10/ticket/5021 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">repro.zip</span> </li> </ul> <p> reproduction case (zipped .cpp file) </p> Ticket chris_kohlhoff Wed, 23 Feb 2011 23:26:36 GMT <link>https://svn.boost.org/trac10/ticket/5021#comment:20 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:20</guid> <description> <p> Thank you for the test case. I was able to reproduce the issue on several different Mac OS X 10.6 systems. It seems to be an OS bug triggered by the use of EV_ONESHOT. Please try the following diff to see if it fixes the problem for you, and doesn't cause any other problems. (Note that you may need to apply the diff by hand since it is made against the trunk.) </p> <pre class="wiki">Index: boost/asio/detail/impl/kqueue_reactor.ipp =================================================================== --- boost/asio/detail/impl/kqueue_reactor.ipp (revision 69227) +++ boost/asio/detail/impl/kqueue_reactor.ipp (working copy) @@ -47,9 +47,9 @@ interrupter_(), shutdown_(false) { - // The interrupter is put into a permanently readable state. Whenever we - // want to interrupt the blocked kevent call we register a one-shot read - // operation against the descriptor. + // The interrupter is put into a permanently readable state. Whenever we want + // to interrupt the blocked kevent call we register a read operation against + // the descriptor. interrupter_.interrupt(); } @@ -108,15 +108,15 @@ { case read_op: BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); break; case write_op: BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_WRITE, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); break; case except_op: BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, EV_OOBAND, 0, descriptor_data); + EV_ADD | EV_CLEAR, EV_OOBAND, 0, descriptor_data); break; } ::kevent(kqueue_fd_, &amp;event, 1, 0, 0, 0); @@ -170,17 +170,17 @@ { case read_op: BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); break; case write_op: BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_WRITE, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); break; case except_op: if (!descriptor_data-&gt;op_queue_[read_op].empty()) return; // Already registered for read events. BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, EV_OOBAND, 0, descriptor_data); + EV_ADD | EV_CLEAR, EV_OOBAND, 0, descriptor_data); break; } @@ -290,7 +290,7 @@ if (ptr == &amp;interrupter_) { // No need to reset the interrupter since we're leaving the descriptor - // in a ready-to-read state and relying on one-shot notifications. + // in a ready-to-read state and relying on edge-triggered notifications. } else { @@ -339,17 +339,17 @@ case EVFILT_READ: if (!descriptor_data-&gt;op_queue_[read_op].empty()) BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); else if (!descriptor_data-&gt;op_queue_[except_op].empty()) BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, EV_OOBAND, 0, descriptor_data); + EV_ADD | EV_CLEAR, EV_OOBAND, 0, descriptor_data); else continue; break; case EVFILT_WRITE: if (!descriptor_data-&gt;op_queue_[write_op].empty()) BOOST_ASIO_KQUEUE_EV_SET(&amp;event, descriptor, EVFILT_WRITE, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); else continue; break; @@ -381,7 +381,7 @@ { struct kevent event; BOOST_ASIO_KQUEUE_EV_SET(&amp;event, interrupter_.read_descriptor(), - EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, &amp;interrupter_); + EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, &amp;interrupter_); ::kevent(kqueue_fd_, &amp;event, 1, 0, 0, 0); } </pre> </description> <category>Ticket</category> </item> <item> <author>aastolfi@…</author> <pubDate>Thu, 24 Feb 2011 14:21:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:21 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:21</guid> <description> <p> Thanks, Chris, for the quick turn around on this. I'll apply the patch and retry my original test case to verify. </p> <p> --Tony </p> </description> <category>Ticket</category> </item> <item> <author>aastolfi@…</author> <pubDate>Thu, 24 Feb 2011 16:39:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:22 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:22</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5021#comment:21" title="Comment 21">aastolfi@…</a>: </p> <blockquote class="citation"> <p> Thanks, Chris, for the quick turn around on this. I'll apply the patch and retry my original test case to verify. </p> <p> --Tony </p> </blockquote> <p> All tests are now passing; I've been running them continuously for the last 3 hours or so. Before, I'd see a failure within a couple minutes. </p> <p> Thanks again. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Wed, 02 Mar 2011 08:28:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5021#comment:23 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5021#comment:23</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/69467" title="* Add support for the fork() system call. Programs that use fork must ...">[69467]</a>) * Add support for the fork() system call. Programs that use fork must call </p> <blockquote> <p> io_service.notify_fork() at the appropriate times. Two new examples have been added showing how to use this feature. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3238" title="#3238: Bugs: asio, kqueue_reactor, result of kevent() isn't checked for error (closed: fixed)">#3238</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4162" title="#4162: Feature Requests: io_service can't be used correctly after fork(). (closed: fixed)">#4162</a>. </p> </blockquote> <ul><li>Clean up the handling of errors reported by the close() system call. In particular, assume that most operating systems won't have close() fail with EWOULDBLOCK, but if it does then set blocking mode and restart the call. If any other error occurs we assume the descriptor is closed. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3307" title="#3307: Bugs: Stream descriptor blocking state set on close (closed: fixed)">#3307</a>. </li></ul><ul><li>EV_ONESHOT seems to cause problems on some versions of Mac OS X, with the io_service destructor getting stuck inside the close() system call. Use EV_CLEAR instead. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5021" title="#5021: Bugs: io_service destructor hangs on Mac OS X (closed: fixed)">#5021</a>. </li></ul><ul><li>Include function name in exception what() messages. </li></ul><ul><li>Fix insufficient initialisers warning with MinGW. </li></ul><ul><li>Make the shutdown_service() member functions private. </li></ul><ul><li>Add archetypes for testing socket option functions. </li></ul><ul><li>Add missing lock in signal_set_service::cancel(). </li></ul><ul><li>Fix copy/paste error in <a class="missing wiki">SignalHandler</a> example. </li></ul><ul><li>The signal header needs to be included in signal_set_service.hpp so that we can use constants like NSIG and SIGRTMAX. </li></ul><ul><li>Don't use Boost.Thread's convenience header. Use the header file that is specifically for the boost::thread class instead. </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Tue, 08 Mar 2011 11:07:15 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5021#comment:24 https://svn.boost.org/trac10/ticket/5021#comment:24 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/69680" title="Merge selected bug fixes from trunk: * Fixed a compile error on some ...">[69680]</a>) Merge selected bug fixes from trunk: </p> <ul><li>Fixed a compile error on some versions of g++ due to anonymous enums. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4883" title="#4883: Patches: epoll_reactor.hpp doesn`t compile with some versions of gcc (closed: fixed)">#4883</a>. </li></ul><ul><li>Fixed a bug in asio::streambuf where the consume() function did not always update the internal buffer pointers correctly. The problem may occur when the asio::streambuf is filled with data using the standard C++ member functions such as sputn(). (Note: the problem does not manifest when the streambuf is populated by the Asio free functions read(), async_read(), read_until() or async_read_until().) </li></ul><ul><li>EV_ONESHOT seems to cause problems on some versions of Mac OS X, with the io_service destructor getting stuck inside the close() system call. Use EV_CLEAR instead. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5021" title="#5021: Bugs: io_service destructor hangs on Mac OS X (closed: fixed)">#5021</a>. </li></ul><ul><li>Fixed a bug on kqueue-based platforms, where reactor read operations that return false from their perform() function are not correctly re-registered with kqueue. </li></ul><ul><li>Fixed the linger socket option on non-Windows platforms. </li></ul><ul><li>Fixed function name in comment for asio::placeholders::iterator. </li></ul> Ticket