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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 3F8F8385740A for ; Fri, 9 Jul 2021 22:10:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3F8F8385740A Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-mqJD1waeN0iDOa76D2vo8A-1; Fri, 09 Jul 2021 18:10:22 -0400 X-MC-Unique: mqJD1waeN0iDOa76D2vo8A-1 Received: by mail-qk1-f198.google.com with SMTP id r190-20020a375dc70000b02903acea04c19fso7392923qkb.8 for ; Fri, 09 Jul 2021 15:10:21 -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:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=bnKHnXJzejZA/3mWR+GvRh0arsd7504HDKi+zLurU48=; b=fYMC72xwZlylkGfxc1n5YAqpt/KcLB/UTTDWTq2k4tJMFHwJnJrpoCGexeeymz70mF Watl5YEC6o4pKAOkGEbYPWITuaoYoYaCOhM0bw9a9mnlAzvtqYXX/ynRhF/QMmf5gkdr segp4fUcanpWHWuErdoFTmQw5Y+eHBy0jGJRmbXA4hef98XtqjOHrBV5gg7H7W5vxIuY EQV/+2zQd3rOPFKd2yQXZTH8Xp4bWlY1mQ5EXzbikpMsYGaqEr7Ozckd7zoMGxP2KIkj BXXLsR24W4hoeAq2qC6VUKpmE7d5KVEa5yGrN2W2J0HbuggmXRMPAn4lz3XWLohkO/Hg ErAw== X-Gm-Message-State: AOAM531CsMddJd/Irn4ZOUZmJm6j+zPE2PJNmSAYXK9Ue6PRQkrA897a 1+agz0lN80R46mF6z5zqAKrKz1c0nDAQIJjcCgyKmOeRiWP8Io4xWH0LpdiLW9aLN0+XYUewScW 16ZVQiDdlh/ewv7UI9spqZUmn4GpbQ7qy9ZzNkGK5M4R5Wf6uIaOI69AIDVPNGBN8/lFRzQ== X-Received: by 2002:a05:6214:1d0c:: with SMTP id e12mr38027301qvd.40.1625868621421; Fri, 09 Jul 2021 15:10:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/rQUfYygB2qJ6HV6Og/bmHI2OfRHWUyRN/a+xihPtkcj8NWVX0CeRzQ7KjZjYndepxjIh9w== X-Received: by 2002:a05:6214:1d0c:: with SMTP id e12mr38027285qvd.40.1625868621206; Fri, 09 Jul 2021 15:10:21 -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 k125sm3121071qkf.16.2021.07.09.15.10.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Jul 2021 15:10:20 -0700 (PDT) Subject: Re: [PATCH] support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) To: "H.J. Lu" , libc-alpha@sourceware.org References: <20210709213831.1477694-1-hjl.tools@gmail.com> From: Carlos O'Donell Organization: Red Hat Message-ID: Date: Fri, 9 Jul 2021 18:10:19 -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: <20210709213831.1477694-1-hjl.tools@gmail.com> 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.0 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: Fri, 09 Jul 2021 22:10:24 -0000 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. Reviewed-by: Carlos O'Donell > --- > support/support_stack_alloc.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/support/support_stack_alloc.c b/support/support_stack_alloc.c > index 03494dd185..b05ae08968 100644 > --- a/support/support_stack_alloc.c > +++ b/support/support_stack_alloc.c > @@ -39,10 +39,11 @@ support_stack_alloc (size_t size) > if (pagesize == -1) > FAIL_EXIT1 ("sysconf (_SC_PAGESIZE): %m\n"); > > - /* Always supply at least MINSIGSTKSZ 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 + MINSIGSTKSZ, pagesize); > + /* Always supply at least sysconf (_SC_MINSIGSTKSZ) 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), > + pagesize); > > /* The guard bands need to be large enough to intercept offset > accesses from a stack address that might otherwise hit another > -- Cheers, Carlos.