On Mon, 2009-03-23 at 13:46 +0000, Dave Martin wrote:

> Could there be an atomic update problem with signals_caught?  Just a
> thought...  it looks like a signal could come in in the middle of
> checking/clearing signals_caught.  I'm not sure whether this problem
> really exists though, without spending longer trying to understand the
> code.
> 
There should be no race with the increment, since the signal handler
inherently blocks other emissions of the same signal until it completes.

Looking at the code though, there could well be a race when resetting
them - the signals_caught array should be somehow copied and set to zero
in an atomic way (procmask?).  Otherwise if the signal happens between
the handler being checked and the array being reset, it will be lost.

> signals_caught[signum]++ will be atomic on certain architectures such as
> i386, but it is not atomic on ARM.  Should be atomic on x86_64 though...
> 
signals_caught is specifically declared as sigatomic_t to *be* atomic -
or is this missing from ARM?

Scott
-- 
Scott James Remnant
[email protected]

-- 
init stops respawning terminal logins after while
https://bugs.launchpad.net/bugs/347205
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to