Messages in this thread | | | Date | Wed, 12 Feb 2003 13:11:09 -0800 | From | Roland McGrath <> | Subject | Re: another subtle signals issue |
| |
> Btw, Roland, instead of your previous patch I would prefer something that > just makes "sig_ignored()" test the state of the signal better. Ie > something like the appended.
This should be fine (almost). POSIX leaves it unspecified whether a blocked, ignored signal is left pending or not. The only thing it requires is that setting a blocked signal to SIG_IGN clears any pending signal, and sigaction already does that.
When I started hacking on this, I only looked at the old new code (i.e. Ingo's thread group rewrite) not the old old code (i.e. 2.4). Everything that was not wrong I left as it was, and bailing early on SIG_IGN signals without regard to blocking is what that code did when I started with it. Bailing early can avoid going through the loop and possibly perturbing the load balancing state, so I had assumed Ingo did it intentionally as an optimization.
Your patch as is won't fix the ignored-SIG_DFL-interrupts bug in the MT case. That is, in __group_send_sig_info if P blocks the signal but some other thread does not, then the that thread will get woken up and be subject to all those problems. So you need another check in or after the loop, or to move the sig_ignored use after the loop. After the loop or in the loop exit condition, you can't get there if the signal is blocked on T, so for that test you can omit the blocked and ptrace checks that your sig_ignored does.
I don't see any other problems with doing this instead of just the checks inserted my previous patch.
Enjoy, Roland - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |