From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.5 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E1FD31F8C6 for ; Sun, 11 Jul 2021 14:44:35 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 88254384F020 for ; Sun, 11 Jul 2021 14:44:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88254384F020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626014674; bh=H0VlCdvdnAV65M3n64bH65upn8tCGCAOhfqXhTFjK7U=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=YOjP+CES+nHZEv/SoQM1QNaXOzyQSYwhLvmsRpy+GHs1zNuzcQDpo/JCFVewgUWdb 5r8EbsQ1JeABvN5r/q5YI9sOqWrJUBBQ3ec8T6TFnb775X1iEevgu8fvQIWGfSNDWh eLeBmP8yRuPHIk7CMlj0nt7Nq0qthJl+lWi+6bLY= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id B60B33854833 for ; Sun, 11 Jul 2021 14:44:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B60B33854833 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-577-_sLqYyYyPfWqFypI7ZSugQ-1; Sun, 11 Jul 2021 10:44:13 -0400 X-MC-Unique: _sLqYyYyPfWqFypI7ZSugQ-1 Received: by mail-qv1-f70.google.com with SMTP id u40-20020a0cb9280000b0290290c3a9f6f1so11651346qvf.0 for ; Sun, 11 Jul 2021 07:44:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=H0VlCdvdnAV65M3n64bH65upn8tCGCAOhfqXhTFjK7U=; b=McO/LUHUc2C8VsvUN8X4EK0GlxFwQR17TQIYJloaunHtZVclNM3LHTmt/4VhH+7JnK e0pLMOjNMkYGqXr1sbNmF3T91YikG831lqZ3JvHUWrbexnj6ekADQ6z7IHJo80YwgozG pgH9c/mNEePgRQnrBWw6wEFpwZiC9y7gjwJ7kK31v4pzPD5SGwzZm7EBhGmO31T4WZhO 6iQgt9Lz/cM7s0APfdxYsKbbbl2G0aEf5RuD8YagIn97RdHD5TLxv9ONrQ6HHA7f3+x5 RrHF7FYQIS5asv1xV3z8h/7nPGFAAhJOM2KYHgs3fA5aVbr78cxoqeFQVSyjc8abapEq r3ow== X-Gm-Message-State: AOAM530qTWnFC7s+5SX+abyacz/j+iLbRmNvxXtnOxRuTFq+ib2viTHu EHMCm2frvYavnulQOIgeUSyV8GZfcFiZS5hw9foSPslSy4KEw6WFT8sVItOH9bvJB1OkOtfQhJe /5X8MO8tI+cKBqnSYbVUz6DqKx9Ovr8L7T7r9ksMMGidCbf4hp9KxLr9l2WkYvERIICe08g== X-Received: by 2002:a05:6214:1c1:: with SMTP id c1mr37637941qvt.37.1626014652913; Sun, 11 Jul 2021 07:44:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKksMH463JV5M6akuvrgUXrJAeDzJpg8pUgLP0Xo6GHnsi6P+8P4neOUJFJTQVOAMUQ9k0WA== X-Received: by 2002:a05:6214:1c1:: with SMTP id c1mr37637925qvt.37.1626014652662; Sun, 11 Jul 2021 07:44:12 -0700 (PDT) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id u11sm2147281qkk.72.2021.07.11.07.44.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 11 Jul 2021 07:44:12 -0700 (PDT) Subject: Re: [PATCH] support: Replace _SC_MINSIGSTKSZ with _SC_SIGSTKSZ To: "H.J. Lu" References: <20210709213831.1477694-1-hjl.tools@gmail.com> Organization: Red Hat Message-ID: <0164a1d6-26b9-ce89-42d5-14336d1796d1@redhat.com> Date: Sun, 11 Jul 2021 10:44:11 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , From: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Cc: GNU C Library Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 7/10/21 2:10 PM, H.J. Lu wrote: > On Fri, Jul 9, 2021 at 3:10 PM Carlos O'Donell wrote: >> >> On 7/9/21 5:38 PM, H.J. Lu via Libc-alpha wrote: >>> Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) since the constant >>> MINSIGSTKSZ used in glibc build may be too small. >> >> LGTM. It's good to explicitly convert to using sysconf in support/* code. > > I used the wrong _SC_XXX. _SC_MINSIGSTKSZ is for the empty > signal handler. sysconf (_SC_SIGSTKSZ) returns the suggested > minimum number of bytes of stack space required for a signal stack. > > OK for master? LGTM. This still goes in the right direction, even if we need more stack space for testing. Reviewed-by: Carlos O'Donell > From 1b30a2708f2bc8a7161c19737ac5f5927803ffc9 Mon Sep 17 00:00:00 2001 > From: "H.J. Lu" > Date: Sat, 10 Jul 2021 10:56:50 -0700 > Subject: [PATCH] support: Replace _SC_MINSIGSTKSZ with _SC_SIGSTKSZ > > Replace _SC_MINSIGSTKSZ with _SC_SIGSTKSZ since sysconf (_SC_MINSIGSTKSZ) > returns the minimum number of bytes of free stack space required in order > to guarantee successful, non-nested handling of a single signal whose > handler is an empty function while sysconf (_SC_SIGSTKSZ) returns the > suggested minimum number of bytes of stack space required for a signal > stack. > --- > support/support_stack_alloc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/support/support_stack_alloc.c b/support/support_stack_alloc.c > index b05ae08968..62eee84573 100644 > --- a/support/support_stack_alloc.c > +++ b/support/support_stack_alloc.c > @@ -39,10 +39,10 @@ support_stack_alloc (size_t size) > if (pagesize == -1) > FAIL_EXIT1 ("sysconf (_SC_PAGESIZE): %m\n"); > > - /* Always supply at least sysconf (_SC_MINSIGSTKSZ) space; passing 0 > + /* Always supply at least sysconf (_SC_SIGSTKSZ) space; passing 0 > as size means only that much space. No matter what the number is, > round it up to a whole number of pages. */ > - size_t stacksize = roundup (size + sysconf (_SC_MINSIGSTKSZ), > + size_t stacksize = roundup (size + sysconf (_SC_SIGSTKSZ), > pagesize); > > /* The guard bands need to be large enough to intercept offset > -- > 2.31.1 > -- Cheers, Carlos.