From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id 034EC3858C74 for ; Wed, 21 Sep 2022 15:24:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 034EC3858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x235.google.com with SMTP id m81so8495696oia.1 for ; Wed, 21 Sep 2022 08:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=bflXrftOsgjhwxoFWDhKaZTtHwGcQCzro/PbQ7vXyUU=; b=tExUNXWlk9INR3ZdDE263WT6ijIN8wis2N92XYCukfqIBpsprYVjWXtoCwb1FjREua LIU4xoEE2jEEbYLRcsdeO2cO3MBLqyUFa/MKKbses377Ao0PqufQATmK82p7apjC47Le NTR7CwJ/I1Dux2Ef56NC3vBp54Ewhfzrt313N6YkkHDWNL5Lz1ZNJBeV22TODiwL9rSm Z47av1mi1MWBLX42GVeEInaw/EtkKsBLe0DV0JqmlJduZjYTrF/Rsy9RhzF6IHZMuWYs UnSEwN77QFdrBjdlI0V2NbCQbq2d/Q8IX2TvDFS7IfAYVzsb0sQK1fBRE6YKbzijuOJ0 wQzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=bflXrftOsgjhwxoFWDhKaZTtHwGcQCzro/PbQ7vXyUU=; b=Pi4ch1UK56eHqr3hbZrg7E57JItSVHzWGL9YmIiT3GWNIV2nO8x5Oo/XfHCSML3DrC w0eRn1OoOC+YzmSiQk7zQn/JTgnrbLNa2WEVugvLr3Pl8F/adhGV2ZA3ZZVy3GnsqU4Y +NeTS31KZ8rQg8UiynwuiyaaE4f2jg3IBP2ljV3zUsclNd0oWvsA0fUXIvM0s8iY68si GeQrhu3KyKkM9bIBaecviEiCXcTDiIEkR9z+cnIaf8Lj67ccGN3L24rOCSkpcLTwWahW dVc7/vxIptb8Hz5Y0i+IlySasVrXoPVl/qrtePFxfqBVxozQ99DeMUtEHcefemKRzIjA eNAg== X-Gm-Message-State: ACrzQf3BSVYZEP2mBrutMQkUuAkbpks0+dP76UGKc2pfOVdbu7dZ8Ypb fNkjmEcY/rU+qubYstfeVtKEIOf+RjCShnKo X-Google-Smtp-Source: AMsMyM60q3hxqEtxpsoQLuP9wWFad9r1v1359gaYTXUMhAvuYnGQ1H2o7R5ClTXMTjEi68jsLt+UCA== X-Received: by 2002:a05:6808:602:b0:350:36a1:ea51 with SMTP id y2-20020a056808060200b0035036a1ea51mr4230149oih.28.1663773892306; Wed, 21 Sep 2022 08:24:52 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:c266:cc93:9f8:1eba:d2e8? ([2804:1b3:a7c1:c266:cc93:9f8:1eba:d2e8]) by smtp.gmail.com with ESMTPSA id t12-20020a056870e74c00b0012752d3212fsm1650661oak.53.2022.09.21.08.24.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Sep 2022 08:24:51 -0700 (PDT) Message-ID: <5bcba9d3-7bdd-1855-afb7-1f9d63014842@linaro.org> Date: Wed, 21 Sep 2022 12:24:49 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: posix_spawn: parent can get stuck in uninterruptible sleep if child receives SIGTSTP early enough Content-Language: en-US To: Florian Weimer Cc: Adhemerval Zanella Netto via Libc-help , Rain References: <2921668c-773e-465d-9480-0abb6f979bf9@www.fastmail.com> <7727e4de-a8da-1e6b-4d7c-68a132750996@linaro.org> <64917a2f-788b-4695-b799-63bbb8a4873f@www.fastmail.com> <87tu64w33v.fsf@oldenburg.str.redhat.com> <7c356365-34db-cc00-bb92-0e55e7a89118@linaro.org> <877d27vbdx.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <877d27vbdx.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 13/09/22 07:04, Florian Weimer wrote: > * Adhemerval Zanella Netto: > >> On 22/08/22 15:21, Florian Weimer wrote: >>> * Adhemerval Zanella Netto via Libc-help: >>> >>>> Right, my mistake. I understood the issue better now, although I am >>>> still puzzled why SIGTSTP is only being triggered on sigprocmask (sing >>>> default action is still to stop PROCESS). >>> >>> I think it's a maskable stop, not an unmaskable one, like SIGSTOP. >> >> Yeah, we do block the signal on parent (internal_signal_block_all). >> >>> >>> This looks a vfork-specific bug that can't happen with fork. I don't >>> see how to fix it in a generic fashion because we can't unblock SIGTSTP >>> and launch the new process in an atomic fashion. >> >> We might ask for a new clone3 field to define the default signal mask on >> process start (and thus omit the final sigprocmask before execve). > > It might already possible to fix this using io_uring. Unfortunately, I > didn't attend the LPC presentation. Is there anything that prevents to avoid using CLONE_VFORK? The code already uses a allocated stack and do synchronizes with waitpid.