From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aE7gOJ4BbV/cUAAA0tVLHw (envelope-from ) for ; Thu, 24 Sep 2020 20:29:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WIBDNJ4BbV8mUwAA1q6Kng (envelope-from ) for ; Thu, 24 Sep 2020 20:29:18 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 478DA9403D6 for ; Thu, 24 Sep 2020 20:29:18 +0000 (UTC) Received: from localhost ([::1]:54124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLXrh-0004t2-4M for larch@yhetil.org; Thu, 24 Sep 2020 16:29:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLXrT-0004rC-7z for guix-patches@gnu.org; Thu, 24 Sep 2020 16:29:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLXrS-0005sj-UZ for guix-patches@gnu.org; Thu, 24 Sep 2020 16:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLXrS-0002jF-TP for guix-patches@gnu.org; Thu, 24 Sep 2020 16:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43591] [PATCH core-updates] gnu: glibc-final: Catch all cases of a glibc user not requesting 64-bit offsets and then using readdir. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Sep 2020 20:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43591 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Marius Bakke Cc: 43591@debbugs.gnu.org Received: via spool by 43591-submit@debbugs.gnu.org id=B43591.160097930010432 (code B ref 43591); Thu, 24 Sep 2020 20:29:02 +0000 Received: (at 43591) by debbugs.gnu.org; 24 Sep 2020 20:28:20 +0000 Received: from localhost ([127.0.0.1]:41902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLXqm-0002iC-0d for submit@debbugs.gnu.org; Thu, 24 Sep 2020 16:28:20 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:48392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLXqi-0002i2-P3 for 43591@debbugs.gnu.org; Thu, 24 Sep 2020 16:28:19 -0400 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id E5E8D33683B3; Thu, 24 Sep 2020 22:28:14 +0200 (CEST) Date: Thu, 24 Sep 2020 22:27:11 +0200 From: Danny Milosavljevic Message-ID: <20200924222711.2f22281a@scratchpost.org> In-Reply-To: <87363759at.fsf@gnu.org> References: <20200924141211.21649-1-dannym@scratchpost.org> <87363759at.fsf@gnu.org> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/M0w0kB1M+f=1_ZOjx/uuh5R"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.11 X-TUID: ayb7kpwayd06 --Sig_/M0w0kB1M+f=1_ZOjx/uuh5R Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Marius, On Thu, 24 Sep 2020 20:17:14 +0200 Marius Bakke wrote: > As mentioned in that issue, and which this patch states on no uncertain > terms, a workaround is to use -D_FILE_OFFSET_BITS=3D64 on 32-bit platform= s. Yeah. The problem is how to find all those places where we need to add it, and how to keep finding them as we maintain stuff (read: as upstream changes stuff). > Won't this break _everything_ that uses readdir() without 64-bit > offsets? That's the goal of that patch. Because it won't work at runtime anyway, wh= en run on a guix x86_64 build machine, building for ARM (which is the usual way we build stuff for ARM). Maybe we can find out whether dirent.h is #included for compiling for one of the main Guix platforms (I prefer this latter solution, if possible). It's either that or we stop qemu transparent emulation on the build farm, because the result isn't reliable. This time it was "caught" because of an overabundance of caution on behalf of the glibc people. We won't be so lucky next time. > Or does that @@ string get substituted by the glibc build > system somehow. No. It's specifically made so downstream users of glibc on guix can't use readdir() on 32-bit systems without enabling large file support. It totally could use some more #if about whether it's building stuff for an actual guix main platform (i.e. not on embedded). > Can you file a bug report upstream about the duplicate definition(s)? It's not really a problem for them. But I can try anyway. > Enforcing this restriction in glibc feels rather sledgehammer-y. Would > it make sense to introduce a GCC warning instead? I'm sure there are > legitimate uses of smaller file offsets (i.e. embedded). A GCC warning > will still break -Werror, but that's a lot more manageable than breaking > almost every use of readdir() on 32-bit platforms. I thought about a gcc #warning. But I don't want it to warn when readdir isn't used in the first place but dirent.h ended up being included by some dependency. I guess we could use a deprecation warning on readdir() instea= d. Can this warning print a custom message? What do you think? In any case, I'd like to have some overview of how bad the problem is and thus I'd like to have a wip branch with this patch being built entirely for 32 bits via x86_64 (not sure whether that includes i686 btw). Is it possible to force using these x86_64 machines in the build farm? >I'm sure there are legitimate uses of smaller file offsets (i.e. embedded). On guix? With our glibc? Do we support that? >A GCC warning will still break -Werror, but that's a lot more manageable >than breaking almost every use of readdir() on 32-bit platforms. These uses of readdir() are not reliable the way we are building guix on cuirass. But I'm all for refining this patch, if there are suggestions on how. Actually, I think a warning is not strong enough. This bug made it all the way down to json-c (!) before finally being detected. That should not happ= en. And if the build farm would have selected an actual ARM machine, the build would have succeeded and no one on x86_64 could have reproduced the result. That would have been real bad. --Sig_/M0w0kB1M+f=1_ZOjx/uuh5R Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl9tAR8ACgkQ5xo1VCww uqUQqAgAhPm5IvAyqQ+RtKLzcd/JTSlzR8/lbc6RVhuea0/IiYZJHjFKcY9YTbWs 3c9Rvk0zI8XvzXs8ViLqVRwMDf+fFW/KBFKWgkyfpF784T12m/4epJE/3s4v1ihy UC1WGxS5xTs2PkXcL9aG+FpwV+5zMROV7ge4he0wGJUnB1BtkvYh3PWzVoqeM1Wt +M8I0anOi7NLc3EHWJDCv+RjcRrI1f2HBXlWprc6rxBGnVpRJrtHZSQHrUrTOQF1 IB8YK12qB6FbDy/DZDaMwLiY4x+sonKQ1+CTJkkG6irJ+Xh/MtHgNj9rWVOXzsCE 3RG3MNjdAx3o/08r262LrNxRFITu1w== =9PzS -----END PGP SIGNATURE----- --Sig_/M0w0kB1M+f=1_ZOjx/uuh5R--