From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by sourceware.org (Postfix) with ESMTPS id 433023858D28 for ; Tue, 1 Aug 2023 13:51:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 433023858D28 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-oa1-x36.google.com with SMTP id 586e51a60fabf-1ba5cda3530so4325406fac.3 for ; Tue, 01 Aug 2023 06:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690897904; x=1691502704; 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:message-id:reply-to; bh=hodLULYrKslV5QZRm3dZ9TOnnVdMPJFMStWqBx81Rkc=; b=PimIVzfuuNbc+FyzvOt1h4cvkiPL72Fk/IO2FBBQu9wUJYocM7vcQV/MfW7xxY0k1q TYmqCCyc3A9cq9wK3ULuq2gYC5NZSUoqFk9fA0k1hezKMm6DZl0a11Bs4VIpOFJ+Asjm W20A/NYTsDkqZBCU8Z9QzcDF6/T6Duw2193HegnkvqG7YrubbMaoefFHlC9dG6yhAA3l al6XUtPZXhPZ7g3KXy4nf/KqF5onlfioK8k6o5jiHgF+AJKy6IALSoHy/SxaLclVWstL Fge2l48DInjxvOSsKMgD7yVPyLwGxnswCKZDac0LNVycQDhtZh1bgGZEx5EBQV/HTO6c Hobw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690897904; x=1691502704; 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:message-id :reply-to; bh=hodLULYrKslV5QZRm3dZ9TOnnVdMPJFMStWqBx81Rkc=; b=JEa4MPe3IVXt48ywIX56Cix0ue9htAqr6B3rP51wDPMbWe8ee0IUNvmoJnZvszcoTz YW9GkIsh7+GYqgPu2GEqJigdnXeMIowhVLH7w8UA974O7I8caIbw5C8aBmeqiUpoYmgw nHA3tVP6zkeaPHT4dvzkaXJALt9lL0NXEiAE3VFWZbZdfSdxizyIrLW4wba/dxXkk6oa w4t86mdXqrYGY93Am6mKW6YPwRqWntSw+9A6oRonBtey14JwgTWEhOH3TPnU/Ojc91cx PNXRdTdkXc7OppLkrcyjRFr0NaRhXGrCNMoj2BYMFIDqwXfZih3BSanCr1v8Lu2yhAOe za4g== X-Gm-Message-State: ABy/qLaLzY29P2hZLwVeQ0B9HYCmwsv31XpsS3Rf+8TIQj6X1Hn3T81n XiavV8uDuGoUjKOlPrZzYg6dBA== X-Google-Smtp-Source: APBJJlH8ts8aWYxTjtL+5j+oUwBIcaQvTHM3ghOmicyWN9X8WcVyg49hDcryGTRXyHPEKXWJBMN7ZQ== X-Received: by 2002:a05:6871:612:b0:1b4:6d3b:3e15 with SMTP id w18-20020a056871061200b001b46d3b3e15mr13996938oan.3.1690897904598; Tue, 01 Aug 2023 06:51:44 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:440b:a49a:e567:9a27:3db8? ([2804:1b3:a7c1:440b:a49a:e567:9a27:3db8]) by smtp.gmail.com with ESMTPSA id ea18-20020a056870071200b001bb81299cf5sm5552275oab.6.2023.08.01.06.51.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 06:51:43 -0700 (PDT) Message-ID: <40947004-fcac-d50c-feea-3a6512a10d69@linaro.org> Date: Tue, 1 Aug 2023 10:51:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 1/2] setjmp: Use BSD sematic as default for setjmp Content-Language: en-US To: Florian Weimer , Adhemerval Zanella via Libc-alpha Cc: Carlos O'Donell References: <20230731171900.4065501-1-adhemerval.zanella@linaro.org> <20230731171900.4065501-2-adhemerval.zanella@linaro.org> <871qgn5fds.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <871qgn5fds.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.1 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,T_SCC_BODY_TEXT_LINE 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 01/08/23 05:35, Florian Weimer wrote: > * Adhemerval Zanella via Libc-alpha: > >> POSIX relaxed the relation of setjmp/longjmp and the signal mask >> save/restore, meaning that setjmp does not require to be routed to >> _setjmp to be standard compliant. >> >> This is done to avoid breakage of SIGABRT handlers, since to fully >> make abort AS-safe, it is required to remove the recurisve lock >> used to unblock SIGABRT prior raised the signal. >> >> Also, it allows caller to actually use setjmp, since from >> 7011c2622fe3e10a29dbe74f06aaebd07710127d the symbol is unconditionally >> routed to _setjmp. > > Doesn't this have non-trivial performance impact? Yes, it is two extra sigprocmask to get/set the signal mask. This is not *strictly* required, but the SIGABRT on abort generates racy conditions on process creation and. This patch can be dropped, but it would mean that to get expected semantic for abort handlers will need to use sigsetjmp (..., 1) instead of setjmp.