unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] manual: don't ignore SIGCHLD when calling waitpid
Date: Wed, 17 Apr 2019 12:44:49 -0700	[thread overview]
Message-ID: <d15fee79-0aad-bcf0-6ff8-aa34f92f69a1@cs.ucla.edu> (raw)
In-Reply-To: <4498cfca-28d0-f868-b46c-562050447bf5@linaro.org>

On 4/17/19 12:05 PM, Adhemerval Zanella wrote:
> My understanding of the example is for interactive shells (shell_is_interactive),
> the idea is only to get child information to the explicit launched processes done
> by launch_process, so ignoring and reseting SIGCHLD seems ok.

Sure, but the problem is that launch_process is used only in the child,
which means the parent shell always ignores SIGCHLD, so if the parent
calls do_job_notification it won't get any info about children. Perhaps
this could be fixed by documenting do_job_notification as requiring that
SIGCHLD be reenabled before calling it, but that's pretty confusing.

Also the proposed change to the manual is not enough, as there's other
text saying that the sample shell program ignores SIGCHLD. Presumably
this is to avoid races in the parent shell. But if SIGCHLD causes races
in the parent, then the parent typically should block SIGCHLD instead of
ignoring it and similarly for the other signals - otherwise the fact
that the signals arrived will be lost. So the whole example needs to be
rethought.


  reply	other threads:[~2019-04-17 19:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 14:35 [PATCH] manual: don't ignore SIGCHLD when calling waitpid Simon Ser
2019-04-17 18:34 ` Simon Ser
2019-04-17 19:05   ` Adhemerval Zanella
2019-04-17 19:44     ` Paul Eggert [this message]
2019-04-17 20:07       ` Adhemerval Zanella

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=d15fee79-0aad-bcf0-6ff8-aa34f92f69a1@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).