This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 04/15] Hurd signals: refactor check_pending_signals
- From: Jérémie Koenig <jk at jk dot fr dot eu dot org>
- To: libc-alpha at sourceware dot org, bug-hurd at gnu dot org, Roland McGrath <roland at hack dot frob dot com>
- Date: Fri, 22 Jul 2011 16:37:36 +0200
- Subject: Re: [PATCH 04/15] Hurd signals: refactor check_pending_signals
- References: <1309365027-4774-1-git-send-email-jk@jk.fr.eu.org><1309365027-4774-5-git-send-email-jk@jk.fr.eu.org><20110702223421.GG11935@const.famille.thibault.fr><20110703193001.GA16517@jk.fr.eu.org>
2011/7/3 Jeremie Koenig <jk@jk.fr.eu.org>:
> On Sun, Jul 03, 2011 at 12:34:22AM +0200, Samuel Thibault wrote:
>> There is just one change that would be worth mentioning in the changelog:
>>
>> > - ? ? ? ? ? ? ? ? /* We "deliver" immediately pending blocked signals whose
>> > - ? ? ? ? ? ? ? ? ? ?action might be to ignore, so that if ignored they are
>> > - ? ? ? ? ? ? ? ? ? ?dropped right away. ?*/
>> > - ? ? ? ? ? ? ? ? || ss->actions[signo].sa_handler == SIG_IGN
>> > - ? ? ? ? ? ? ? ? || ss->actions[signo].sa_handler == SIG_DFL))
>>
>> This is not done any more. ?Actually I believe it is more correct.
>
> Note that this example still does not terminate after the patch, because
> ignored signals are never actually marked pending:
>
> (hurd/hurdsig.c)
> | ? if (act != ignore && ? ? ? ? ?/* Signals ignored now are forgotten now. ?*/
Dropped by the attached patch.
--
Jérémie Koenig <jk@jk.fr.eu.org>
http://jk.fr.eu.org/
commit 8e87205e2f8bd8ce8fca2eba75f7695394351f24
Author: Jeremie Koenig <jk@jk.fr.eu.org>
Date: Wed Jul 20 02:23:13 2011 +0000
Hurd signals: don't drop blocked ignored signals
Although POSIX tolerates the current approach, it is more consistent
to wait for ignored signals to be unblocked before we deliver them.
* hurd/hurdsig.c (post_signal): Don't drop blocked ignored signals.
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 67037e8..44e067c 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -859,9 +859,7 @@ post_signal (struct hurd_sigstate *ss,
}
/* Handle receipt of a blocked signal, or any signal while stopped. */
- if (act != ignore && /* Signals ignored now are forgotten now. */
- __sigismember (&blocked, signo) ||
- (signo != SIGKILL && _hurd_stopped))
+ if (__sigismember (&blocked, signo) || (signo != SIGKILL && _hurd_stopped))
{
mark_pending ();
act = ignore;