public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: 1533963612@qq.com, john.stultz@linaro.org, linux-kernel@vger.kernel.org
Subject: man 7 signal && delivering order
Date: Fri, 31 May 2013 18:04:04 +0200	[thread overview]
Message-ID: <20130531160404.GA30121@redhat.com> (raw)

Hi Michael,

could you please look at

	https://bugzilla.kernel.org/show_bug.cgi?id=58711

?

This part of man 7 signal

       3.  Real-time signals are delivered in a  guaranteed  order.   Multiple
           real-time  signals of the same type are delivered in the order they
           were sent.  If different real-time signals are sent to  a  process,
           they  are  delivered  starting  with  the  lowest-numbered  signal.
           (I.e., low-numbered signals have highest priority.)

looks really confusing.

Yes, the kernel delivers (in fact, the task dequeus) them in order,
but this doesn't mean that the signal handlers will run in the same
order.

And let me repeat, whatever the kernel does, depending on the timing
kill(task, 62) + kill(task, 63) can "call" the signal handlers in any
order (as it seen by task). Unless this task plays with sa_mask or the
sender knows that at least SIG_63 is blocked.

Well. of course we could change dequeue_signal()->next_signal() so that,
say, SIG_63 will be chosen before SIG_62, this will "fix" the test-case.
But at the same time, this will break sigtimedwait().

Oleg.


                 reply	other threads:[~2013-05-31 16:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130531160404.GA30121@redhat.com \
    --to=oleg@redhat.com \
    --cc=1533963612@qq.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox