From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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" Cc: GNU C Library References: <20210709213831.1477694-1-hjl.tools@gmail.com> From: Carlos O'Donell 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-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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: Sun, 11 Jul 2021 14:44:15 -0000 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.