[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/15] Hurd signals: fix sigwait() for global signals
From: |
Jeremie Koenig |
Subject: |
Re: [PATCH 11/15] Hurd signals: fix sigwait() for global signals |
Date: |
Wed, 20 Jul 2011 03:51:23 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Jul 03, 2011 at 02:32:00AM +0200, Samuel Thibault wrote:
> Jeremie Koenig, le Wed 29 Jun 2011 18:30:23 +0200, a écrit :
> > * sysdeps/mach/hurd/sigwait.c (__sigwait): Change the blocking mask
> > temporarily so that we catch global as well as thread-specific signals.
>
> Mmm, this is unsafe: if yet another signal arrives between the
> setjmp return and locking ss, it will be processed instead of being
> blocked.
The attached patch fixes this: the blocking mask is restored by the
preemptor rather than by sigwait() itself.
While testing it I stumbled upon another (long-standing) bug whereby
sigwait does not clear a signal which was pending prior to calling it.
The other attached patch fixes that.
--
Jeremie Koenig <jk@jk.fr.eu.org>
http://jk.fr.eu.org
sigwait-race.diff
Description: Text Data
sigwait-pending.diff
Description: Text Data