Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1653508

Re: signals: Bug or manpage inconsistency?

From Oleg Nesterov <oleg@redhat.com>
Newsgroups linux.kernel
Subject Re: signals: Bug or manpage inconsistency?
Date 2017-05-30 21:20 +0200
Message-ID <tMUQq-2TU-9@gated-at.bofh.it> (permalink)
References <tMPnI-7TL-13@gated-at.bofh.it> <tMS2d-1ag-15@gated-at.bofh.it> <tMSOC-1GK-25@gated-at.bofh.it> <tMSYi-1K4-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 05/30, Linus Torvalds wrote:
>
> On Tue, May 30, 2017 at 10:04 AM, Oleg Nesterov <oleg@redhat.com> wrote:
> >
> > I can't comment, I never tried to understand the rationality behind the current
> > behaviour. But at least the sending path should never drop a blocked SIG_DFL
> > signal, there is no other way to ensure you won't miss a signal during exec.
>
> Note that both SIG_DFL _and_ SIG_IGN are possible after exec,

Yes, if it was already ignored before exec. But ignoring the compatibility the
only important case is when it is SIG_DFL because of flush_signal_handlers().

> SIG_IGN doesn't mean "ignore signal forever". It means "ignore signals
> right now", and I think that our current signal blocking semantics are
> likely the correct ones,

I am not saying it is incorrect, but I agree with Thomas in that this
sigismember(t->blocked) in sig_ignored() doesn't look really nice.

> exactly because it means "when you start
> blocking signals, the kernel will not drop them".

if the process is singe-threaded or the signal is private, or it is blocked
by all threads. Otherwise it will wakeup another thread for no reason, the
signal will be dropped in get_signal().

And again, this doesn't look consistent with do_sigaction(). It even has a
comment which explains that we want to flush the ignored signals, blocked
or not.

Nevermind, I am not trying to argue, and

> So again, I really wouldn't want to change existing semantics unless
> there is a big real reason for it. Our current semantics are not
> wrong.

I certainly agree.

Oleg.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

signals: Bug or manpage inconsistency? Thomas Gleixner <tglx@linutronix.de> - 2017-05-30 15:30 +0200
  Re: signals: Bug or manpage inconsistency? Thomas Gleixner <tglx@linutronix.de> - 2017-05-30 18:20 +0200
    Re: signals: Bug or manpage inconsistency? Oleg Nesterov <oleg@redhat.com> - 2017-05-30 19:10 +0200
      Re: signals: Bug or manpage inconsistency? Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-30 19:20 +0200
        Re: signals: Bug or manpage inconsistency? Oleg Nesterov <oleg@redhat.com> - 2017-05-30 21:20 +0200
        Re: signals: Bug or manpage inconsistency? Thomas Gleixner <tglx@linutronix.de> - 2017-05-30 23:00 +0200
          Re: signals: Bug or manpage inconsistency? ebiederm@xmission.com (Eric W. Biederman) - 2017-05-31 03:00 +0200
            Re: signals: Bug or manpage inconsistency? ebiederm@xmission.com (Eric W. Biederman) - 2017-05-31 03:20 +0200
  Re: signals: Bug or manpage inconsistency? Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-30 19:10 +0200
    Re: signals: Bug or manpage inconsistency? Thomas Gleixner <tglx@linutronix.de> - 2017-05-30 21:40 +0200
      Re: signals: Bug or manpage inconsistency? Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-30 22:00 +0200
        Re: signals: Bug or manpage inconsistency? Thomas Gleixner <tglx@linutronix.de> - 2017-05-30 23:10 +0200
  Re: signals: Bug or manpage inconsistency? "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-05-31 09:00 +0200
  Re: signals: Bug or manpage inconsistency? ebiederm@xmission.com (Eric W. Biederman) - 2017-06-01 09:10 +0200

csiph-web