From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by sourceware.org (Postfix) with ESMTPS id 2A71B386F47A for ; Tue, 9 Mar 2021 15:46:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2A71B386F47A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=panix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zackw@panix.com Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4Dw01h4ffPzFwn for ; Tue, 9 Mar 2021 10:46:32 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1615304792; bh=fbb6TMRwYwRPbauC9H41kyXT6ajhbH+j8+KaYoyMyAg=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=SrUZeWVhfC2+sJS0zRcnfdRnyA/UhvwcHWovVRMluBTsGpaH/0fnqRQfi9LMIt2bg 2/hagmg8Iykd0AJ3tLIvp9WSOYSfms1zcmSqU5nEkPFyphemneH4mOIm/DjW6hK/b9 XR3+RD1vqqy9TgM9iM0Wc9G7KIZ+yeCq4VQ3PUGE= Received: by mail-ej1-f41.google.com with SMTP id bm21so28945123ejb.4 for ; Tue, 09 Mar 2021 07:46:32 -0800 (PST) X-Gm-Message-State: AOAM532ceCSlWg6MtbUpDf6R9ds0b+pmA49ZLnazxK/wZC5ngfaQxPPW 7k2z2kxhRyGNjvYK83c2J06VextZPLVqLYMR+bs= X-Google-Smtp-Source: ABdhPJxUCJowCkuok/QKuRxRNPXAurnirFp8n/vM1KsVoy5iiHrE9/s3k0itVF48SIUIll0Li/+T35la+vzSZAsfrT8= X-Received: by 2002:a17:907:2661:: with SMTP id ci1mr20851615ejc.403.1615304791551; Tue, 09 Mar 2021 07:46:31 -0800 (PST) MIME-Version: 1.0 References: <1841269.IEpri3ZHvQ@omega> <6ea9c6e1-40dc-19c9-397d-0d812903bd7e@redhat.com> In-Reply-To: <6ea9c6e1-40dc-19c9-397d-0d812903bd7e@redhat.com> From: Zack Weinberg Date: Tue, 9 Mar 2021 10:46:20 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: SIGSTKSZ is now a run-time variable To: glibc list , "H.J. Lu" , Florian Weimer Cc: Bruno Haible , Carol Bouchard , bug-m4@gnu.org, Eric Blake , "austin-group-l@opengroup.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 09 Mar 2021 15:46:34 -0000 On Tue, Mar 9, 2021 at 10:23 AM Eric Blake via Libc-alpha wrote: > [adding glibc and Austin group lists] > On 3/6/21 12:50 PM, Bruno Haible wrote: > > Besides being invalid, it is also not needed. The alternate signal stack > > needs to be dimensioned according to the CPU and ABI that is in use. For example, > > SPARC processors tend to use much more stack space than x86 per function > > invocation. Similarly, 64-bit execution on a bi-arch CPU tends to use more stack > > space than 32-bit execution, because return addresses and other pointers are > > 64-bit vs. 32-bit large. But once you have fixed the CPU and the ABI, there is > > no ambiguity any more. The rationale for this change, from the glibc side, is that various CPU architectures (notably x86 and ARM, as I understand it) have been adding extensions that break the above premises. The amount of space required by the ucontext_t object (third argument to a SA_SIGINFO signal handler) depends not only on the ISA and ABI but on the exact set of ISA extensions that are available on the model of CPU that happens to be running the program today. Moreover, some of these extensions require a great deal of space to store e.g. large SIMD vector registers -- more than will fit in the fairly small MINSIGSTKSZ we've historically provided (usually something like 2048 bytes). And there isn't anywhere else we / the kernel can save this state. I was worried about exactly this kind of breakage when the patches were originally being discussed, but _something_ has to give here and I don't know what else it could be. cc:ing H.J. and Florian, who were more deeply involved. zw