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.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,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 692731F8C6 for ; Fri, 9 Jul 2021 21:38:55 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 613763994800 for ; Fri, 9 Jul 2021 21:38:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 613763994800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625866734; bh=JyXTIAN859EnsOo9qUAirX37Ei1sI61MYQ/fHFUpITU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=v8A9pBjhl9QNy52HlJoNuxIk7LTCJRSfDeXgvv3/ekntbqMRuy/tBv9m0/BGZs74B GzPfxvdfZKnm/Ilz8bOiHF5j26FyN9iInXRE0dvAjGQu2EF5aBJDE1VXNsHrDVR4Mb Cn79hNjklyNy1DEFYWwbroMCnLTxJq3e/r3d073w= Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id ECE90385740A for ; Fri, 9 Jul 2021 21:38:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ECE90385740A Received: by mail-pj1-x1030.google.com with SMTP id l11so6454710pji.5 for ; Fri, 09 Jul 2021 14:38:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=JyXTIAN859EnsOo9qUAirX37Ei1sI61MYQ/fHFUpITU=; b=GP9yO3J8QmP6IEv6Df9vy+h8O4px81ICD3lKbV5ynej3hwl1x6e4hnONSXkrKnig0v 2sKHwDGElg+meZ06CD9AeKJDjayr084Cak6ki6auQn5ctUMT0W3LGVQpxD5m0+P0cfu/ 0U92vD9MK52EApw4kU2LxnotGmJ9WmVfEDh4bQTq48hgQI5BAsmb1yme//PMqGoiiyn1 clOQxL91txoeoW2++/EbJZIu6vUPInWZXZM/a0Jb2LJo0W4LsCknF2k4+s2xwFM077Df hK17Eh4v5tV5+tn7fbJDVhA9rTTL/e4b9tI6FKpdG0aBL4AiKmFrynd2sQ4rg+TkuuUZ mtEw== X-Gm-Message-State: AOAM532ig9I6/9CJYllEao/1OiAE7Z/90GHmwNeg/hk0SR608NkyBEce RsLVUrEZ9n2Q3JVtSbsjqxBt1aNijBU= X-Google-Smtp-Source: ABdhPJyW1XeRFkT/UgohLcJUQATCau64yFYarm68cCMHvzS/2IXR24BrEoT51M0u9Hy7JqrlHGAkSg== X-Received: by 2002:a17:90b:b12:: with SMTP id bf18mr931879pjb.74.1625866713001; Fri, 09 Jul 2021 14:38:33 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.56.39.115]) by smtp.gmail.com with ESMTPSA id d2sm8679735pgh.59.2021.07.09.14.38.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 14:38:32 -0700 (PDT) Received: from gnu-cfl-2.. (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 60EB6C00CD for ; Fri, 9 Jul 2021 14:38:31 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH] support: Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) Date: Fri, 9 Jul 2021 14:38:31 -0700 Message-Id: <20210709213831.1477694-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" Replace MINSIGSTKSZ with sysconf (_SC_MINSIGSTKSZ) since the constant MINSIGSTKSZ used in glibc build may be too small. --- 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 -- 2.31.1