public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Rohland <cr@sap.com>
To: Paul Menage <pmenage@ensim.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] Pollable /proc/<pid>/ - avoid SIGCHLD/poll() races
Date: 04 Oct 2001 10:59:07 +0200	[thread overview]
Message-ID: <m34rpfpyqs.fsf@linux.local> (raw)
In-Reply-To: <E15p3JS-0000ko-00@pmenage-dt.ensim.com>
In-Reply-To: <E15p3JS-0000ko-00@pmenage-dt.ensim.com>

Hi Paul,

On Thu, 04 Oct 2001, Paul Menage wrote:
> 
> I've recently run across a problem where a server (in this case,
> sshd) can deadlock itself if a SIGCHLD arrives just before it calls
> select(), but after it has checked whether its child_terminated. So
> when the select() is called, the SIGCHLD signal handler has already
> run and set the child_terminated flag, and there's nothing to wake
> the select().
> 
> The only real user-space solution to this is to have the SIGCHLD
> handler somehow cause the select() to return immediately

... or implement pselect:
http://mesh.eecs.umich.edu/cgi-bin/man2html/usr/share/man/man2/select.2.gz

or use sigsetjmp/siglongjmp

Both would be portable and not special to child handling.

Greetings
		Christoph



  reply	other threads:[~2001-10-04  8:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-04  7:52 [PATCH][RFC] Pollable /proc/<pid>/ - avoid SIGCHLD/poll() races Paul Menage
2001-10-04  8:59 ` Christoph Rohland [this message]
2001-10-04  9:31   ` Paul Menage
2001-10-04 10:25     ` Christoph Rohland
2001-10-13 15:44     ` Jamie Lokier
2001-10-04 14:18 ` Mattias Engdegård
2001-10-04 20:39   ` Paul Menage
2001-10-05  9:36     ` Mattias Engdegård
2001-10-13 15:36   ` Jamie Lokier
2001-10-14  2:25     ` John Alvord

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=m34rpfpyqs.fsf@linux.local \
    --to=cr@sap.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmenage@ensim.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