Modify

Ticket #8738 (closed Bugs: fixed)

Opened 10 months ago

Last modified 7 months ago

Signal number = 0 in signal_set handler.

Reported by: alxn1@… 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

asio_bug.cpp Download (568 bytes) - added by alxn1@… 10 months ago.
boost::asio::signal_set zero signal number bug.

Change History

Changed 10 months ago by alxn1@…

boost::asio::signal_set zero signal number bug.

comment:1 Changed 7 months ago by chris_kohlhoff

  • Status changed from new to closed
  • Resolution set to fixed

Fixed on trunk in [85746]. Merged to release in [85838]

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.