Boost C++ Libraries: Ticket #8738: Signal number = 0 in signal_set handler. https://svn.boost.org/trac10/ticket/8738 <p> In boost/asio/detail/impl/signal_set_service.ipp, if signal occured, but currently handlers queue is empty, signal_set_service will increment undelivered_ variable, but not save signal number. After what, if new handler will added, it will be called with zero signal number immediately, and undelivered_ decremented: </p> <blockquote> <p> if (reg-&gt;undelivered_ &gt; 0) { </p> <blockquote> <p> --reg-&gt;undelivered_; io_service_.post_deferred_completion(op); return; </p> </blockquote> <p> } </p> </blockquote> <p> but signal number doesn't set (op-&gt;signal_number_ == 0 in this place). </p> <p> I think, it's bug :) </p> <p> It's can be reproduced with small test utility (in attachment): compile it, start, and post to it 10-15 SIGHUP's (kill -s SIGHUP &lt;pid&gt; | kill -s SIGHUP &lt;pid&gt; | kill -s SIGHUP &lt;pid&gt; | kill -s SIGHUP &lt;pid&gt; ...). In stdout you will see: </p> <p> signal 1 received signal 1 received signal 1 received signal 1 received signal 1 received signal 1 received signal 1 received signal 1 received signal 0 received signal 1 received signal 1 received signal 1 received signal 1 received signal 0 received signal 1 received </p> <p> In some cases signal number is zero. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8738 Trac 1.4.3 alxn1@… Thu, 27 Jun 2013 11:57:05 GMT attachment set https://svn.boost.org/trac10/ticket/8738 https://svn.boost.org/trac10/ticket/8738 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">asio_bug.cpp</span> </li> </ul> <p> boost::asio::signal_set zero signal number bug. </p> Ticket chris_kohlhoff Mon, 30 Sep 2013 23:47:47 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8738#comment:1 https://svn.boost.org/trac10/ticket/8738#comment:1 <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> Fixed on trunk in <a class="changeset" href="https://svn.boost.org/trac10/changeset/85746" title="Ensure signal number is correctly passed to the completion handler ...">[85746]</a>. Merged to release in <a class="changeset" href="https://svn.boost.org/trac10/changeset/85838" title="Merge asio from trunk. ...">[85838]</a> </p> Ticket