From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 21 10:31:35 2021 Received: (at 48941) by debbugs.gnu.org; 21 Jul 2021 14:31:35 +0000 Received: from localhost ([127.0.0.1]:38202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6DG3-0004pr-CD for submit@debbugs.gnu.org; Wed, 21 Jul 2021 10:31:35 -0400 Received: from mail-40141.protonmail.ch ([185.70.40.141]:17124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6DG1-0004pd-1t for 48941@debbugs.gnu.org; Wed, 21 Jul 2021 10:31:34 -0400 Date: Wed, 21 Jul 2021 14:31:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1626877886; bh=VOkQHaf4r1W4KUUDzvAjnnzl1VDczy3C6up3zbTaRNc=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=sNwc7eMO+DqAxPXXyG7LKv5rPtsdrbKJevJqZfHRSB4CHKPbXeHw+xtVLVybBhXWE omnFaso5AEk0VH0YDOkm38e7nRZplw49pZBWUhVm2EwCGIeuz4EMbEnc8XLLb90WVY qdFDfbSey7oVqAMAM8AXuu9PQtm7PJGbOQ96zD4w= To: Chris Marusich From: Kaelyn Subject: Re: bug#48941: [powerpc64le-linux] libfaketime CLOCK_MONOTONIC test hangs Message-ID: In-Reply-To: <874kco8d9s.fsf@gmail.com> References: <874kco8d9s.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=3.8 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,URIBL_BLACK shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Wednesday, July 21st, 2021 at 1:08 AM, Chris Marusich wrote: Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [185.70.40.141 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kaelyn.alexi[at]protonmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: libc.so] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 48941 Cc: guix-devel@gnu.org, 48941@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: , Reply-To: Kaelyn Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Hi, =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Wednesday, July 21st, 2021 at 1:08 AM, Chris Marusich wrote: > Hi, > > I need a little help figuring out how to use gdb in Guix for bug 48941: > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D48941 > > Here's the situation. A libfaketime test hangs forever. Upstream > > suggested I debug it. I'm trying to, but gdb errors out. What am I > > doing wrong? It's probably something simple, but I can't see what. > > I'll describe what I've done. First, I started a build like so: > > ./pre-inst-env guix build --keep-failed libfaketime > > While the problematic test hung, I found the PID of the test and killed > > it. This caused the build to fail, leaving the build environment for me > > to play around in. > > I entered a pure environment that contains all the things I need to > > debug the test (gcc 10.3.0 is currently the default gcc on > > core-updates): > > ./pre-inst-env guix environment --pure libfaketime --ad-hoc gcc-toolchain= @10.3.0 gcc-toolchain@10.3.0:debug gdb > > In the pure environment, I confirmed I can build and run the hanging > > test via the following commands (I added -g in order to get debug > > symbols): > > make FAKETIME_COMPILE_CFLAGS=3D'-DFORCE_MONOTONIC_FIX -g' CC=3Dgcc PREFIX= =3D/tmp/guix-build-libfaketime-0.9.9.drv-0/myprefix > > make FAKETIME_COMPILE_CFLAGS=3D'-DFORCE_MONOTONIC_FIX -g' CC=3Dgcc PREFIX= =3D/tmp/guix-build-libfaketime-0.9.9.drv-0/myprefix test > > OK, so I can trigger the hang. Great! Next step, fire up GDB: > > --8<---------------cut here---------------start------------->8--- > > [0] [env] marusich@suzaku:/tmp/guix-build-libfaketime-0.9.9.drv-0/source/= test > > $ gdb ./timetest > > GNU gdb (GDB) 10.2 > > Copyright (C) 2021 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.ht= ml > > This is free software: you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. > > Type "show copying" and "show warranty" for details. > > This GDB was configured as "powerpc64le-unknown-linux-gnu". > > Type "show configuration" for configuration details. > > For bug reporting instructions, please see: > > https://www.gnu.org/software/gdb/bugs/. > > Find the GDB manual and other documentation resources online at: > > http://www.gnu.org/software/gdb/documentation/. > > For help, type "help". > > Type "apropos word" to search for commands related to "word"... > > Reading symbols from ./timetest... > > (gdb) > > --8<---------------cut here---------------end--------------->8--- > > The debug symbols provided by gcc-toolchain@10.3.0:debug are under > > $GUIX_ENVIRONMENT/lib/debug. This is the value of GUIX_ENVIRONMENT: > > --8<---------------cut here---------------start------------->8--- > > $ echo $GUIX_ENVIRONMENT > > /gnu/store/32fjhp30k34fh0g9f1gmgcj8pc5wldq6-profile > > --8<---------------cut here---------------end--------------->8--- > > By the way, this directory corresponds to glibc 2.33: > > --8<---------------cut here---------------start------------->8--- > > $ realpath /gnu/store/32fjhp30k34fh0g9f1gmgcj8pc5wldq6-profile/lib/debug > > /gnu/store/8akrlhc25d7xvi85gzvginw0vdi4zyg4-glibc-2.33-debug/lib/debug > > --8<---------------cut here---------------end--------------->8--- > > Let's tell GDB where to find those debug symbols: > > (gdb) set debug-file-directory /gnu/store/32fjhp30k34fh0g9f1gmgcj8pc5wldq= 6-profile/lib/debug > > Let's also tell GDB to set the environment variables that upstream > > recommended when running the test program: > > --8<---------------cut here---------------start------------->8--- > > (gdb) set environment LD_PRELOAD=3D../src/libfaketime.so.1 > > (gdb) set environment FAKETIME=3D-10d > > (gdb) set environment NO_FAKE_STAT=3D1 > > --8<---------------cut here---------------end--------------->8--- > > Now run it: > > --8<---------------cut here---------------start------------->8--- > > (gdb) run > > Starting program: /tmp/guix-build-libfaketime-0.9.9.drv-0/source/test/tim= etest > > /bin/sh: /lib/powerpc64le-linux-gnu/libc.so.6: version `GLIBC_2.33' not f= ound (required by ../src/libfaketime.so.1) /bin/sh: /lib/powerpc64le-linux-= gnu/libc.so.6: version` GLIBC_2.32' not found (required by /gnu/store/kmblb= ljiygayhlc5gb02an9imhy90ws9-glibc-2.33/lib/libpthread.so.0) Are you using Guix on a foreign distro? This line looks like your distro's = normal libc.so was being used and it was from glibc-2.31 or older. The x86-= 64 systems I have that run pure Guix don't have any /lib*/ directories. You= might try running gdb with LD_LIBRARY_PATH=3D/gnu/store/kmblbljiygayhlc5gb= 02an9imhy90ws9-glibc-2.33/lib to have the Guix libc.so picked up before the= other one. HTH Cheers, Kaelyn > > /bin/sh: /lib/powerpc64le-linux-gnu/libc.so.6: version `GLIBC_2.32' not f= ound (required by /gnu/store/kmblbljiygayhlc5gb02an9imhy90ws9-glibc-2.33/li= b/libdl.so.2) /bin/sh: /lib/powerpc64le-linux-gnu/libc.so.6: version` GLIBC= _2.32' not found (required by /gnu/store/kmblbljiygayhlc5gb02an9imhy90ws9-g= libc-2.33/lib/librt.so.1) > > During startup program exited with code 1. > > (gdb) > > --8<---------------cut here---------------end--------------->8--- > > Huh? What happened? I've double checked that I'm using gdb provided by > > Guix: > > --8<---------------cut here---------------start------------->8--- > > $ type -P gdb > > /gnu/store/32fjhp30k34fh0g9f1gmgcj8pc5wldq6-profile/bin/gdb > > --8<---------------cut here---------------end--------------->8--- > > I also tried running gdb by invoking it via that absolute file name, and > > it still errored out in the same way. > > I'm operating in a --pure environment. All the tools are provided by > > Guix. I'm surprised that /bin/sh and /lib are even mentioned above. > > If anyone can provide any advice, I'd be very grateful. I'm not sure > > how to proceed. > > -------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------------------------------------ > > Chris