This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: signals: Bug or manpage inconsistency?
- From: Linus Torvalds <torvalds at linux-foundation dot org>
- To: Thomas Gleixner <tglx at linutronix dot de>
- Cc: LKML <linux-kernel at vger dot kernel dot org>, Oleg Nesterov <oleg at redhat dot com>, Peter Zijlstra <peterz at infradead dot org>, Ingo Molnar <mingo at kernel dot org>, Michael Kerrisk <mtk dot manpages at gmail dot com>, linux-man at vger dot kernel dot org, libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 30 May 2017 10:04:01 -0700
- Subject: Re: signals: Bug or manpage inconsistency?
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.1705301402270.1950@nanos>
On Tue, May 30, 2017 at 6:21 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> Linus, any recollection?
>
> IMO, it's perfectly reasonable to discard ignored signals even when the
> signal is in the blocked mask. When its unblocked and SIG_IGN is replaced
> then the next signal will be delivered. But hell knows, how much user space
> depends on this weird behaviour by now.
Is there any real reason you care? Because clearly we're doing what
POSIX allows, and I'd be nervous about changing existing behavior.
There are various races wrt signals that happen particularly around
fork/exec, and the way that programs handle those races is to block
signals. I don't know that anybody cares about the exact semantics of
this, but I could *imagine* that they do.
Our current behavior is actually very nice: blocking a signal
basically guarantees that you're now "atomic" wrt that signal. You
won't lose signaling events after the blocking, unless you explicitly
throw them away.
So I would suggest *not* changing the semantics unless you have a
major real reason for wanting to do that.
Linus