From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from beige.elm.relay.mailchannels.net (beige.elm.relay.mailchannels.net [23.83.212.16]) by sourceware.org (Postfix) with ESMTPS id C839E3858C3A for ; Sun, 23 Jan 2022 15:19:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C839E3858C3A X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 721C7860F07; Sun, 23 Jan 2022 15:19:55 +0000 (UTC) Received: from pdx1-sub0-mail-a306.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 46A1C8618FE; Sun, 23 Jan 2022 15:19:55 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a306.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.158.127 (trex/6.4.3); Sun, 23 Jan 2022 15:19:55 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Bubble-Cooperative: 63585dca04b19b0d_1642951195360_2750249673 X-MC-Loop-Signature: 1642951195360:215429056 X-MC-Ingress-Time: 1642951195357 Received: from [192.168.1.174] (unknown [1.186.122.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a306.dreamhost.com (Postfix) with ESMTPSA id 4JhcHF4SSzz26; Sun, 23 Jan 2022 07:19:53 -0800 (PST) Message-ID: <2be97fb0-751d-1361-518a-24c131b49a51@sourceware.org> Date: Sun, 23 Jan 2022 20:49:48 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] tst-realpath-toolong: Fix hurd build Content-Language: en-US To: Samuel Thibault Cc: libc-alpha@sourceware.org, joseph@codesourcery.com References: <20220122144523.2221584-1-siddhesh@sourceware.org> <20220123003600.a42uwp67446vlcep@begin> From: Siddhesh Poyarekar In-Reply-To: <20220123003600.a42uwp67446vlcep@begin> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3487.5 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no 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, 23 Jan 2022 15:19:58 -0000 On 23/01/2022 06:06, Samuel Thibault wrote: > Siddhesh Poyarekar via Libc-alpha, le sam. 22 janv. 2022 20:15:23 +0530, a ecrit: >> We don't really need a bigger buffer for realpath since it should fail >> and return NULL. In the bug too, the buffer itself is not accessed; it >> is in fact left untouched. Drop the PATH_MAX use and pass a single char >> address. > > ? realpath assumes that the passed buffer is PATH_MAX-long. When > PATH_MAX is not defined, calling it with a buffer is essentially > undefined. Better just pass NULL. Passing NULL doesn't reproduce the problem because realpath just allocates enough to accommodate the return, even when it exceeds PATH_MAX. It only applies when a non-NULL buffer is supplied. Would you prefer it if I defined PATH_MAX on hurd then, something like: #ifndef PATH_MAX # define PATH_MAX 1024 #endif or do you prefer a more accurate path_max value using pathconf()? The former will be a simpler fix, the latter will be best served by a get_path_max support function, which will be more elaborate but accurate. I'm happy to do either. Thanks, Siddhesh