From unknown Thu Jun 12 08:35:48 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#36823 <36823@debbugs.gnu.org> To: bug#36823 <36823@debbugs.gnu.org> Subject: Status: gcc bug prevents go program from starting newer gcc results in race condition Reply-To: bug#36823 <36823@debbugs.gnu.org> Date: Thu, 12 Jun 2025 15:35:48 +0000 retitle 36823 gcc bug prevents go program from starting newer gcc results i= n race condition reassign 36823 guix submitter 36823 Malte Frank Gerdes severity 36823 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 13:00:59 2019 Received: (at submit) by debbugs.gnu.org; 27 Jul 2019 17:00:59 +0000 Received: from localhost ([127.0.0.1]:45328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrQ42-0005lo-G1 for submit@debbugs.gnu.org; Sat, 27 Jul 2019 13:00:58 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:42409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrPhd-0002u2-7d for submit@debbugs.gnu.org; Sat, 27 Jul 2019 12:37:50 -0400 Received: by mail-wr1-f44.google.com with SMTP id x1so7540903wrr.9 for ; Sat, 27 Jul 2019 09:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=K/+/B50d6HFNAMUK/sYC3jXUFeX9XmXL4AAqPKB9OWM=; b=PmwIaHYlNBo7MMFoI6vmomVOVB7DWnP2/g7wM7VC2VCLXbxBEQxc/jbPX3qtTy9POx rEpjobDLdCRH72Ht0kJ6VX7vecheXz922Mk7CdoCoC4ued2o5T5NBpCg5JWV5UpNEm+X yQYivK+44+hgSOxHxLAlBS5Q1vkhdWm//yV0QLjwZ6gn/4NK3YpxA0f3n1c9MrrrTgVj J+PvAEUfLuXq1JXyfzyEoRnDrDqY7/C3kUT/JWSgS7s+Q5xCQA87sAB8jMPZ2q/tsVwK wEZQ1m78HVL0KA3dMh/1Y/o5+Kpz1B8tJkOExYDBjqsvgCryg40GLsrkFXO1WgDNOj/h MQGw== 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:user-agent :mime-version; bh=K/+/B50d6HFNAMUK/sYC3jXUFeX9XmXL4AAqPKB9OWM=; b=MRIPgSUFdHO3DpVO2Xr1wMJm19KNSLoQXXfCdsHQFvXiDl5Fbkt/mHaUzqHjxM4iA/ P4gYzXhAzFArGo08TmZY+mUjRykhje3lthrbfCra17qd39CtQw6S06y8ZcwNTLuCDhzL tigt7fNJOKFjPH7uRGgGtRMLqQ+yl5/BeE39FXO/Bx3htXt+d74EbS7/v6bFkyrZ39a5 g5nzW0OUHg+ZWff9gaAovFZ0HGUtIUZ/w0wVvzVY+pS7pG+ZJkDAL5x2yz5MjpJfhEbW HQZv7SsjuRzxO3pnyOvMBoqiCtAN2vHHi6CKU5gXZAU779hemwUYuhQXjzgEghnQECz2 INFg== X-Gm-Message-State: APjAAAWHrEzai6UEpXwOH/zBYRKEANMaYf4qPUYwNBXT/fZAUTHVpSML dDs/Kn5m2GWYCmlef3pmIZomxWn0 X-Google-Smtp-Source: APXvYqyhOb7GTLopNIzVYfB6Un1EfZbeN5XbQCWTFpsncsIFYRVnJb7bKxhCrw9w4fzM7OB2slWFJA== X-Received: by 2002:adf:80e1:: with SMTP id 88mr22426383wrl.127.1564245462906; Sat, 27 Jul 2019 09:37:42 -0700 (PDT) Received: from Morphium (ip-95-223-41-27.hsi16.unitymediagroup.de. [95.223.41.27]) by smtp.gmail.com with ESMTPSA id i12sm66136561wrx.61.2019.07.27.09.37.42 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 27 Jul 2019 09:37:42 -0700 (PDT) From: Malte Frank Gerdes To: submit@debbugs.gnu.org Subject: gcc bug prevents go program from starting newer gcc results in race condition Date: Sat, 27 Jul 2019 18:37:41 +0200 Message-ID: <86wog3tove.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 27 Jul 2019 13:00:58 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, The precompiled version of Hugo-extended was not able to find some runtime dependencies: libstdc++.so.6 => not found libgcc_s.so.1 => not found This seems like a version mismatch to me, so i built Hugo with the following command: go build --tags extended Now the error is ( = ypiv8dj4lkvsnm82s639h18l87frrh5g): /gnu/store/-gcc-6.5.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.26' not found The problem seems identical to [1]. I copmiled go-1.4 with gcc:lib from 7, 8 and 9 with no luck (the 9 variant even fails the tests due to a race condition somewhere, i read that in some other bug report but can't find the ID). Error Message at the end. So is there any progress on this? I guess this is necessary to make the execution of hugo-extended (and maybe other programs?) work. [1]: https://stackoverflow.com/questions/52663287/glibcxx-3-4-26-not-found -Malte ##### ../misc/cgo/testsanitizers --- FAIL: TestShared (0.02s) --- FAIL: TestShared/tsan_shared (2.04s) cshared_test.go:71: `/tmp/guix-build-go-1.12.7.drv-0/TestShared821009189/tsan_shared` exited with exit status 66 ================== WARNING: ThreadSanitizer: data race (pid=3613) Write of size 8 at 0x7ffff6095c20 by thread T1: #0 pthread_attr_getstacksize (tsan_shared+0x00000041d5b2) #1 x_cgo_init (libtsan_shared.so+0x0000000968e0) #2 runtime.rt0_go (libtsan_shared.so+0x00000008cb0e) Previous write of size 8 at 0x7ffff6095c20 by main thread: #0 (0x000000000001) Location is stack of thread T1. Thread T1 (tid=3619, running) created by main thread at: #0 pthread_create (tsan_shared+0x00000040dec4) #1 _cgo_try_pthread_create (libtsan_shared.so+0x0000000967a1) #2 x_cgo_sys_thread_create (libtsan_shared.so+0x000000096543) #3 _rt0_amd64_lib (libtsan_shared.so+0x00000008ca16) SUMMARY: ThreadSanitizer: data race ??:0 pthread_attr_getstacksize ================== ================== WARNING: ThreadSanitizer: data race (pid=3613) Read of size 8 at 0x7d080000dfe0 by thread T2: #0 threadentry (libtsan_shared.so+0x000000096b03) Previous write of size 8 at 0x7d080000dfe0 by thread T1: #0 malloc (tsan_shared+0x00000040c2d3) #1 x_cgo_thread_start (libtsan_shared.so+0x00000009716c) #2 runtime.asmcgocall (libtsan_shared.so+0x00000008e546) Location is heap block of size 24 at 0x7d080000dfe0 allocated by thread T1: #0 malloc (tsan_shared+0x00000040c2d3) #1 x_cgo_thread_start (libtsan_shared.so+0x00000009716c) #2 runtime.asmcgocall (libtsan_shared.so+0x00000008e546) Thread T2 (tid=3621, running) created by thread T1 at: #0 pthread_create (tsan_shared+0x00000040dec4) #1 _cgo_try_pthread_create (libtsan_shared.so+0x0000000967a1) #2 _cgo_sys_thread_start (libtsan_shared.so+0x000000096a42) #3 x_cgo_thread_start (libtsan_shared.so+0x0000000971fa) #4 runtime.asmcgocall (libtsan_shared.so+0x00000008e546) Thread T1 (tid=3619, running) created by main thread at: #0 pthread_create (tsan_shared+0x00000040dec4) #1 _cgo_try_pthread_create (libtsan_shared.so+0x0000000967a1) #2 x_cgo_sys_thread_create (libtsan_shared.so+0x000000096543) #3 _rt0_amd64_lib (libtsan_shared.so+0x00000008ca16) SUMMARY: ThreadSanitizer: data race ??:0 threadentry ================== ================== WARNING: ThreadSanitizer: data race (pid=3613) Read of size 8 at 0x7ffff7fcc8b8 by thread T2: #0 threadentry (libtsan_shared.so+0x000000096b36) Previous write of size 8 at 0x7ffff7fcc8b8 by thread T1: #0 x_cgo_init (libtsan_shared.so+0x000000096874) #1 runtime.rt0_go (libtsan_shared.so+0x00000008cb0e) Location is global 'setg_gcc' of size 8 at 0x7ffff7fcc8b8 (libtsan_shared.so+0x00000013a8b8) Thread T2 (tid=3621, running) created by thread T1 at: #0 pthread_create (tsan_shared+0x00000040dec4) #1 _cgo_try_pthread_create (libtsan_shared.so+0x0000000967a1) #2 _cgo_sys_thread_start (libtsan_shared.so+0x000000096a42) #3 x_cgo_thread_start (libtsan_shared.so+0x0000000971fa) #4 runtime.asmcgocall (libtsan_shared.so+0x00000008e546) Thread T1 (tid=3619, running) created by main thread at: #0 pthread_create (tsan_shared+0x00000040dec4) #1 _cgo_try_pthread_create (libtsan_shared.so+0x0000000967a1) #2 x_cgo_sys_thread_create (libtsan_shared.so+0x000000096543) #3 _rt0_amd64_lib (libtsan_shared.so+0x00000008ca16) SUMMARY: ThreadSanitizer: data race ??:0 threadentry ================== ================== WARNING: ThreadSanitizer: data race (pid=3613) Read of size 8 at 0x7d080000df80 by thread T6: #0 threadentry (libtsan_shared.so+0x000000096b03) Previous write of size 8 at 0x7d080000df80 by thread T1: #0 malloc (tsan_shared+0x00000040c2d3) #1 x_cgo_thread_start (libtsan_shared.so+0x00000009716c) #2 runtime.asmcgocall (libtsan_shared.so+0x00000008e507) Location is heap block of size 24 at 0x7d080000df80 allocated by thread T1: #0 malloc (tsan_shared+0x00000040c2d3) #1 x_cgo_thread_start (libtsan_shared.so+0x00000009716c) #2 runtime.asmcgocall (libtsan_shared.so+0x00000008e507) Thread T6 (tid=3625, running) created by thread T1 at: #0 pthread_create (tsan_shared+0x00000040dec4) #1 _cgo_try_pthread_create (libtsan_shared.so+0x0000000967a1) #2 _cgo_sys_thread_start (libtsan_shared.so+0x000000096a42) #3 x_cgo_thread_start (libtsan_shared.so+0x0000000971fa) #4 runtime.asmcgocall (libtsan_shared.so+0x00000008e507) Thread T1 (tid=3619, running) created by main thread at: #0 pthread_create (tsan_shared+0x00000040dec4) #1 _cgo_try_pthread_create (libtsan_shared.so+0x0000000967a1) #2 x_cgo_sys_thread_create (libtsan_shared.so+0x000000096543) #3 _rt0_amd64_lib (libtsan_shared.so+0x00000008ca16) SUMMARY: ThreadSanitizer: data race ??:0 threadentry ================== ThreadSanitizer: reported 4 warnings FAIL From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 13:16:28 2019 Received: (at control) by debbugs.gnu.org; 27 Jul 2019 17:16:28 +0000 Received: from localhost ([127.0.0.1]:45359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrQJ2-0006Jl-0e for submit@debbugs.gnu.org; Sat, 27 Jul 2019 13:16:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrQJ0-0006JV-62 for control@debbugs.gnu.org; Sat, 27 Jul 2019 13:16:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hrQIv-00069B-2z for control@debbugs.gnu.org; Sat, 27 Jul 2019 13:16:21 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hrQIu-00071C-Ky for control@debbugs.gnu.org; Sat, 27 Jul 2019 13:16:20 -0400 Subject: control message for bug 36823 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Sat, 27 Jul 2019 13:16:20 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) reassign 36823 guix From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 04 16:42:02 2021 Received: (at 36823) by debbugs.gnu.org; 4 Jul 2021 20:42:02 +0000 Received: from localhost ([127.0.0.1]:43318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m08wE-00036Z-6F for submit@debbugs.gnu.org; Sun, 04 Jul 2021 16:42:02 -0400 Received: from out2.migadu.com ([188.165.223.204]:17556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m08wB-00036I-3i for 36823@debbugs.gnu.org; Sun, 04 Jul 2021 16:42:00 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1625431317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sYprEYHilqeot5IZBTcN54PSRHKzggDSdn5xsF5VJ8k=; b=QlHKVp6ITawvxwmerEiBHWnLLlgf0kdY9boTU0hSgddHDT6VC9BEDCVWnHNsdgYS/mA2En TJROXIB6HXaafxvKBLonmWr0FI67Zd9yzU9DmqW/5TGjJw2Z0tTtweb7ZgW7v//p38VIpn 96Ck0hU/658VHeoDNcBVa9lSr+xhORU= From: Sarah Morgensen To: Malte Frank Gerdes Subject: Re: bug#36823: gcc bug prevents go program from starting newer gcc results in race condition References: <86wog3tove.fsf@gmail.com> Date: Sun, 04 Jul 2021 13:41:54 -0700 In-Reply-To: <86wog3tove.fsf@gmail.com> (Malte Frank Gerdes's message of "Sat, 27 Jul 2019 18:37:41 +0200") Message-ID: <86fswtak19.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 36823 Cc: 36823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hello, Thanks for the report. Malte Frank Gerdes writes: > Hi, > > The precompiled version of Hugo-extended was not able to find some > runtime dependencies: > libstdc++.so.6 => not found > libgcc_s.so.1 => not found In case you haven't discovered this in the past two years (oops), this is because Guix does not typically work with pre-compiled software that relies on system libraries being in /lib, since there is no system-wide /lib. > This seems like a version mismatch to me, so i built Hugo with the > following command: > go build --tags extended > > Now the error is ( = ypiv8dj4lkvsnm82s639h18l87frrh5g): > /gnu/store/-gcc-6.5.0-lib/lib/libstdc++.so.6: version > `GLIBCXX_3.4.26' not found If I build hugo with gcc-toolchain@7 in my user profile, it works fine. However.... I can still repro this issue with gcc-toolchain@8+: $ go build --tags extended $ ./hugo --help ./hugo: /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./hugo) ./hugo: /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./hugo) This is because gcc 7's libraries are shadowing the newer gcc's libraries: $ readelf -d hugo | grep RUNPATH 0x000000000000001d (RUNPATH) Library runpath: [/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib:/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib:/gnu/store/3h7xd0d47a286b6r9qhz4ybi5iaxkfwi-gcc-11.1.0-lib/lib:/home/sarah/.guix-profile/lib:/gnu/store/3h7xd0d47a286b6r9qhz4ybi5iaxkfwi-gcc-11.1.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.1.0/../../..] If I use patchelf to remove the gcc 7 library dir from RUNPATH, hugo works fine. This is because Go is patched to unconditionally add a runpath to gcc 7's libraries but erroneously does not explicitly set CXX. (See also .) The following patch should explicitly set CXX for Go, so that it always uses the "system" version: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=go-explicitly-set-CXX.patch Content-Description: go-explicitly-set-CXX.patch diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 0318918a37..a27f57aa30 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -395,6 +395,7 @@ in the style of communicating sequential processes (@dfn{CSP}).") ;; FIXME: Some of the .a files are not bit-reproducible. (let* ((output (assoc-ref outputs "out"))) (setenv "CC" (which "gcc")) + (setenv "CXX" (which "g++")) (setenv "GOOS" "linux") (setenv "GOROOT" (dirname (getcwd))) (setenv "GOROOT_FINAL" output) @@ -577,6 +578,7 @@ in the style of communicating sequential processes (@dfn{CSP}).") (loader (string-append (assoc-ref inputs "libc") ,(glibc-dynamic-linker)))) (setenv "CC" (which "gcc")) + (setenv "CXX" (which "g++")) (setenv "GO_LDSO" loader) (setenv "GOOS" "linux") (setenv "GOROOT" (dirname (getcwd))) --=-=-= Content-Type: text/plain Hope that helps, Sarah --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 06 09:16:55 2021 Received: (at 36823) by debbugs.gnu.org; 6 Jul 2021 13:16:55 +0000 Received: from localhost ([127.0.0.1]:47740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0kwZ-0001mG-8C for submit@debbugs.gnu.org; Tue, 06 Jul 2021 09:16:55 -0400 Received: from mail-wm1-f44.google.com ([209.85.128.44]:40800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0kwX-0001ly-Ig for 36823@debbugs.gnu.org; Tue, 06 Jul 2021 09:16:54 -0400 Received: by mail-wm1-f44.google.com with SMTP id h18-20020a05600c3512b029020e4ceb9588so1693889wmq.5 for <36823@debbugs.gnu.org>; Tue, 06 Jul 2021 06:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=IJ5WhwP2NSKeT8eMmZzo6KttmDHhx80Y+pxnaGI3rv0=; b=Up3f/jW5+ft7lt+8/Q88KHRhqSDvHn9gYJUK9lgr1plGT15CgReJIAm6/VCj9PCSnt XFhOiSxqra2MIKNwMPc+DSGNmv8I50fgLm9oTWHxO/lESYpugf3OTZfUWrtTY9RV/ped wZznoFTGvzo5yOW/07roTxOH595jSsmpUk1ALVgRc1WFUiuVj9ca+XQF4rVNo6l9KqEK c1JXjwBEYW91F9E1OLegl1mU8K2OENi6zyEYlNUuLjXgAf5270vkBc3cor8fuvAJTJyW 0fq00ZqhPc3zEQvoF4FS4IJH20anRt/pW+dA2oa7akTrvlAOk1yQSCdIg2xrw0/t8eXW GBug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=IJ5WhwP2NSKeT8eMmZzo6KttmDHhx80Y+pxnaGI3rv0=; b=KHxpj7g3looI81WTq302D61rBFZOimyvRCQpUrzWehrsZOIwr8M7iaztach7mVifNK Sb8OzXRdER8lxnog07Sm/oEZLSRjKSjxVDHECzDhuBWFmXez2DreZYG8blP5U5FUzvEy aWqfOLZevHt4hl246jej6wiW+IptXCXmk8P2rqtCMwmNfusMwOMCN4IpGc4OdGqSWcHe tr91UwKTSRnjt58mbzD8fkq4SR4Q52ymrnj3vANe+ppuHLdIE9k5exKh5TvzttWtIi62 Gdvtd0m4soiaIaWMMzi6z98p4Oi69Gs+kQLq/0Cnle3SQnqSnJiFkm0Q9po0E8S329Q4 2J4Q== X-Gm-Message-State: AOAM532ZbsriEYpaBmkbqgGkCqEHhuPqHwGXN92FGcew+GfQmYRtquGa +m5X/6eIZoebMJnNzT+DceoOl0yjiN4= X-Google-Smtp-Source: ABdhPJwvlO0i5C+b4B4qHOA3KmlahlEmB/mRyuoPKz/W6rFRBxCgKhdgkzySl4WnpyRLnRkG1seN+Q== X-Received: by 2002:a05:600c:3589:: with SMTP id p9mr683459wmq.182.1625577407502; Tue, 06 Jul 2021 06:16:47 -0700 (PDT) Received: from Methadon (ip-95-222-176-180.hsi15.unitymediagroup.de. [95.222.176.180]) by smtp.gmail.com with ESMTPSA id z13sm67684wro.79.2021.07.06.06.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 06:16:47 -0700 (PDT) From: Malte Frank Gerdes To: Sarah Morgensen Subject: Re: bug#36823: gcc bug prevents go program from starting newer gcc results in race condition References: <86wog3tove.fsf@gmail.com> <86fswtak19.fsf@mgsn.dev> Date: Tue, 06 Jul 2021 15:14:30 +0200 In-Reply-To: <86fswtak19.fsf@mgsn.dev> (Sarah Morgensen's message of "Sun, 04 Jul 2021 13:41:54 -0700") Message-ID: <868s2jbn49.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36823 Cc: 36823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thanks for your answer :-) I don't use hugo anymore but at least i now know what the problem was, but i really appreciate that you took the time to reproduce this. Does it make sense to keep this ticket open, because as you found out there still /is/ a bug? (also just rediscovering the subject line: what the heck did i mean with that?!) Malte Sarah Morgensen writes: > Hello, > > Thanks for the report. > > Malte Frank Gerdes writes: > >> Hi, >> >> The precompiled version of Hugo-extended was not able to find some >> runtime dependencies: >> libstdc++.so.6 => not found >> libgcc_s.so.1 => not found > > In case you haven't discovered this in the past two years (oops), this > is because Guix does not typically work with pre-compiled software that > relies on system libraries being in /lib, since there is no system-wide > /lib. > >> This seems like a version mismatch to me, so i built Hugo with the >> following command: >> go build --tags extended >> >> Now the error is ( = ypiv8dj4lkvsnm82s639h18l87frrh5g): >> /gnu/store/-gcc-6.5.0-lib/lib/libstdc++.so.6: version >> `GLIBCXX_3.4.26' not found > > If I build hugo with gcc-toolchain@7 in my user profile, it works fine. > However.... I can still repro this issue with gcc-toolchain@8+: > > $ go build --tags extended > $ ./hugo --help > ./hugo: /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./hugo) > ./hugo: /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./hugo) > > This is because gcc 7's libraries are shadowing the newer gcc's > libraries: > > $ readelf -d hugo | grep RUNPATH > 0x000000000000001d (RUNPATH) Library runpath: > [/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib:/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib:/gnu/store/3h7xd0d47a286b6r9qhz4ybi5iaxkfwi-gcc-11.1.0-lib/lib:/home/sarah/.guix-profile/lib:/gnu/store/3h7xd0d47a286b6r9qhz4ybi5iaxkfwi-gcc-11.1.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.1.0/../../..] > > If I use patchelf to remove the gcc 7 library dir from RUNPATH, hugo > works fine. This is because Go is patched to unconditionally add a > runpath to gcc 7's libraries but erroneously does not explicitly set > CXX. (See also .) > > The following patch should explicitly set CXX for Go, so that it always > uses the "system" version: > > diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm > index 0318918a37..a27f57aa30 100644 > --- a/gnu/packages/golang.scm > +++ b/gnu/packages/golang.scm > @@ -395,6 +395,7 @@ in the style of communicating sequential processes (@dfn{CSP}).") > ;; FIXME: Some of the .a files are not bit-reproducible. > (let* ((output (assoc-ref outputs "out"))) > (setenv "CC" (which "gcc")) > + (setenv "CXX" (which "g++")) > (setenv "GOOS" "linux") > (setenv "GOROOT" (dirname (getcwd))) > (setenv "GOROOT_FINAL" output) > @@ -577,6 +578,7 @@ in the style of communicating sequential processes (@dfn{CSP}).") > (loader (string-append (assoc-ref inputs "libc") > ,(glibc-dynamic-linker)))) > (setenv "CC" (which "gcc")) > + (setenv "CXX" (which "g++")) > (setenv "GO_LDSO" loader) > (setenv "GOOS" "linux") > (setenv "GOROOT" (dirname (getcwd))) > > > Hope that helps, > Sarah