public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Alexey Izbyshev <izbyshev@ispras.ru>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] linux: Fallback to fork and exec for clone fail on posix_spawn (BZ#29115)
Date: Mon, 02 May 2022 22:54:25 +0300	[thread overview]
Message-ID: <8e71f54e0fdf9f73393f5ea3e529d036@ispras.ru> (raw)
In-Reply-To: <c994c136-aa64-b3fb-1859-289c17921db7@linaro.org>

On 2022-05-02 22:42, Adhemerval Zanella wrote:
> On 02/05/2022 16:15, Alexey Izbyshev wrote:
>> On 2022-05-02 21:06, Adhemerval Zanella wrote:
>>> +      while (__write_nocancel (args->pipe[1], &ret, sizeof (ret)) < 
>>> 0);
>> 
>> If the parent is killed, write() will fail with EPIPE, so this loop 
>> will become infinite. Maybe check for EPIPE and break?
> 
> We block all signals (__libc_signal_block_all), so the parent will be
> only killed
> by signals that can no be caught (SIGKILL).  Same for SIGPIPE.

The parent can indeed only be killed by SIGKILL, or simply exit from 
another thread, but how exactly it dies doesn't matter. But signals are 
already unblocked at this point in the child, so if SIGPIPE was ignored 
in the parent, it's ignored now in the child and is unblocked, hence 
write() can fail with EPIPE.

Alexey

  reply	other threads:[~2022-05-02 19:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 18:06 Adhemerval Zanella
2022-05-02 19:15 ` Alexey Izbyshev
2022-05-02 19:30   ` Florian Weimer
2022-05-02 19:37     ` Alexey Izbyshev
2022-05-02 20:05       ` Florian Weimer
2022-05-02 19:42   ` Adhemerval Zanella
2022-05-02 19:54     ` Alexey Izbyshev [this message]
2022-05-02 20:02       ` Adhemerval Zanella
2022-05-02 20:08         ` Alexey Izbyshev
2022-05-02 20:09           ` Adhemerval Zanella
2022-05-02 19:57     ` Adhemerval Zanella
2022-05-02 20:02       ` Alexey Izbyshev
2022-05-02 20:04         ` 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

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

  git send-email \
    --in-reply-to=8e71f54e0fdf9f73393f5ea3e529d036@ispras.ru \
    --to=izbyshev@ispras.ru \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --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).