From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id E306C3857C50 for ; Wed, 24 Mar 2021 13:04:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E306C3857C50 Received: by mail-qk1-x731.google.com with SMTP id v70so17854679qkb.8 for ; Wed, 24 Mar 2021 06:04:53 -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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6kGaiyOysXCQBGUrxVW2LEg3Ytd932ZI5vXl+08Zgb0=; b=Yjm5xWLY4KVqjqpJrFyKCwXhEeerSpo30wdhlfHy4p7/RvUrRYMcastvHNSM3udzcm /K/BDwuNAt/pyRLF4GcPJvF4K+GWUSwobBOPSLeiwVi0/Nm3fwfZmBVnbR9spXc1JdYs I9WH5S8lHs7dHvRGE6VXWJDWLJlIdusYsL6GR6MovLrtyBvgxHFymBsPwuEc9VBDPk4p LWr9yoi4I3nNBliTXkSLt7cbfDYac7yp71e8F6KvOEXgCt21Jvx9cz0wCMQd0C9r1lq5 cFJjehQfaHujPcjFB4M/esVXR1zUFKJs9ZvYe1acrlqAcEV65FjH0cedQACO4cSKDHGx oW4A== X-Gm-Message-State: AOAM532VHeWTesCg7WFjI6STS6j+CY0hYsBRa+YPYI4obVr08k3RbGW8 KE/+RZzuxA7mNuZGRYfT5IikLw== X-Google-Smtp-Source: ABdhPJwkfGmjPtwgtfS0mTeyDlLkPmjUOLi1ZeRXTU3AztdWKdhKJc5vOWIzX/Sft0dGyJDSiDww5A== X-Received: by 2002:ae9:f70a:: with SMTP id s10mr2939694qkg.468.1616591093478; Wed, 24 Mar 2021 06:04:53 -0700 (PDT) Received: from [192.168.1.132] ([177.194.41.149]) by smtp.gmail.com with ESMTPSA id j6sm1605209qkm.81.2021.03.24.06.04.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Mar 2021 06:04:53 -0700 (PDT) Subject: Re: [PATCH] stdlib: Fix BZ #26241 testcase on GNU/Hurd To: Samuel Thibault , libc-alpha@sourceware.org Cc: commit-hurd@gnu.org References: <20210324003822.341322-1-samuel.thibault@ens-lyon.org> From: Adhemerval Zanella Message-ID: Date: Wed, 24 Mar 2021 10:04:51 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210324003822.341322-1-samuel.thibault@ens-lyon.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Wed, 24 Mar 2021 13:04:55 -0000 On 23/03/2021 21:38, Samuel Thibault wrote: > GNU/Hurd's readlink system call is partly implemented in userspace, which > also allocates a buffer on the stack for the result, and thus needs one > more path. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > stdlib/tst-canon-bz26341.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/stdlib/tst-canon-bz26341.c b/stdlib/tst-canon-bz26341.c > index 6d054596b5..0ddd9aed15 100644 > --- a/stdlib/tst-canon-bz26341.c > +++ b/stdlib/tst-canon-bz26341.c > @@ -72,10 +72,11 @@ do_realpath (void *arg) > If realpath uses more than 2 * PATH_MAX plus some slack it will trigger > a stackoverflow. */ > > + const size_t syscall_usage = 1 * PATH_MAX + 1024; Could you also add a comment from where this come from on the description above? > const size_t realpath_usage = 2 * PATH_MAX + 1024; > const size_t thread_usage = 1 * PATH_MAX + 1024; > size_t stack_size = support_small_thread_stack_size () > - - realpath_usage - thread_usage; > + - syscall_usage - realpath_usage - thread_usage; > char stack[stack_size]; > char *resolved = stack + stack_size - thread_usage + 1024; > >