All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Korty <joe.korty@ccur.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>, Jiri Kosina <jkosina@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [BUG, TEST PATCH] stallout race between SIGCONT and SIGSTOP
Date: Wed, 24 Sep 2008 11:19:33 -0400	[thread overview]
Message-ID: <20080924151933.GA17531@tsunami.ccur.com> (raw)
In-Reply-To: <20080924150541.GA119@tv-sign.ru>

On Wed, Sep 24, 2008 at 11:05:41AM -0400, Oleg Nesterov wrote:
> Joe says:
>> So it looks like the test is in error, not the kernel.
> 
> and I am happy to agree.
> I think sigaction/10-1.c should be fixed, please see the patch below.

A year or two ago I sent to Intel some OpenPosixTestSuite fixes, and they
were accepted.  Send it in (to the people listed in the comments at the
front of the .c file), hopefully they are still at Intel.


> Now, since SIGCHLD is a non-rt signal, the second SIGCHLD is lost,
> and wait_until_we_receive_CLD_STOPPED() hangs.
> 
> I did the test patch to be sure:
> 
>         --- 26-rc2/kernel/signal.c~     2008-09-20 20:37:52.000000000 +0400
>         +++ 26-rc2/kernel/signal.c      2008-09-24 18:43:34.000000000 +0400
>         @@ -808,7 +808,7 @@ static int send_signal(int sig, struct s
>                  * exactly one non-rt signal, so that we can get more
>                  * detailed information about the cause of the signal.
>                  */
>         -       if (legacy_queue(pending, sig))
>         +       if (sig != SIGCHLD && legacy_queue(pending, sig))
>                         return 0;
>                 /*
>                  * fast-pathed signals for kernel-internal things like SIGSTOP
> 
> and now your test-case doesn't hang.

Very interesting!  I am not sure this is Posix conformant, as Posix
seems to say that posting a SIGSTOP or SIGCHLD clears out all pending
SIGSTOPs or SIGCHLDs, so queueing the SIGCHLD might violate the standard.
Still it might be workable as it would be hard to see, from userspace, any
behavioral difference between queueing (possibly illegal) and synchronous
operation (which seems legal), both of which service all SIGCONTs and
SIGSTOPs without loss.

Joe

  reply	other threads:[~2008-09-24 15:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-23 15:53 [BUG, TEST PATCH] stallout race between SIGCONT and SIGSTOP Joe Korty
2008-09-23 16:35 ` Oleg Nesterov
2008-09-24 15:05   ` Oleg Nesterov
2008-09-24 15:19     ` Joe Korty [this message]
2008-09-24 15:56       ` Oleg Nesterov
2008-09-24 17:11         ` Joe Korty
2008-09-24 17:34           ` Oleg Nesterov

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=20080924151933.GA17531@tsunami.ccur.com \
    --to=joe.korty@ccur.com \
    --cc=akpm@linux-foundation.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=roland@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.