Opened 9 years ago
Closed 9 years ago
#8738 closed Bugs (fixed)
Signal number = 0 in signal_set handler.
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | asio signal_set signo | Cc: |
Description
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.
Attachments (1)
Change History (2)
by , 9 years ago
Attachment: | asio_bug.cpp added |
---|
comment:1 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
boost::asio::signal_set zero signal number bug.