[Boost-bugs] [Boost C++ Libraries] #8738: Signal number = 0 in signal_set handler.

Subject: [Boost-bugs] [Boost C++ Libraries] #8738: Signal number = 0 in signal_set handler.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-27 11:56:27


#8738: Signal number = 0 in signal_set handler.
-----------------------------------+----------------------------
 Reporter: alxn1@… | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: asio signal_set signo |
-----------------------------------+----------------------------
 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:

     if (reg->undelivered_ > 0)
     {
       --reg->undelivered_;
       io_service_.post_deferred_completion(op);
       return;
     }

 but signal number doesn't set (op->signal_number_ == 0 in this place).

 I think, it's bug :)

 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 <pid> | kill -s
 SIGHUP <pid> | kill -s SIGHUP <pid> | kill -s SIGHUP <pid> ...).
 In stdout you will see:

 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

 In some cases signal number is zero.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8738>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC