From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id 6E8AE3858C50 for ; Mon, 2 May 2022 19:54:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E8AE3858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru Received: from mail.ispras.ru (unknown [83.149.199.84]) by mail.ispras.ru (Postfix) with ESMTPSA id 451E240D403D; Mon, 2 May 2022 19:54:25 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 02 May 2022 22:54:25 +0300 From: Alexey Izbyshev To: Adhemerval Zanella Cc: Florian Weimer , libc-alpha@sourceware.org Subject: Re: [PATCH] linux: Fallback to fork and exec for clone fail on posix_spawn (BZ#29115) In-Reply-To: References: <20220502180605.1510951-1-adhemerval.zanella@linaro.org> User-Agent: Roundcube Webmail/1.4.4 Message-ID: <8e71f54e0fdf9f73393f5ea3e529d036@ispras.ru> X-Sender: izbyshev@ispras.ru Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2022 19:54:27 -0000 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