From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93465 invoked by alias); 12 Apr 2019 20:08:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 93450 invoked by uid 89); 12 Apr 2019 20:08:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=transfers, 3369, 237A, libcso6 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Apr 2019 20:07:58 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 816E03092652; Fri, 12 Apr 2019 20:07:57 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A340608E1; Fri, 12 Apr 2019 20:07:57 +0000 (UTC) From: Sergio Durigan Junior To: Alan Hayward Cc: "gdb-patches\@sourceware.org" , nd Subject: Regression on gdb.base/break-probes.exp - native-{,extended-}gdbserver (was: Re: [RFC/PATCH] Testsuite: set sysroot when using gdbserver) References: <20190327164025.48105-1-alan.hayward@arm.com> Date: Fri, 12 Apr 2019 20:08:00 -0000 In-Reply-To: <20190327164025.48105-1-alan.hayward@arm.com> (Alan Hayward's message of "Wed, 27 Mar 2019 16:40:30 +0000") Message-ID: <87h8b3f0mb.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00230.txt.bz2 On Wednesday, March 27 2019, Alan Hayward wrote: > When testing using native-gdbserver and native-extended-gdbserver, the sysroot > is not set. This results in a warning from GDB and files are sent via the > remote protocol, which can be slow. > > On Ubuntu 18.04 (unlike most distros) the debug versions of the standard > libraries are included by default in /usr/lib/debug/ > > Example log of a test on Ubuntu 18.04 AArch64: > > Listening on port 2346 > target remote localhost:2346 > Remote debugging using localhost:2346 > Reading /lib/ld-linux-aarch64.so.1 from remote target... > warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead. > Reading /lib/ld-linux-aarch64.so.1 from remote target... > Reading symbols from target:/lib/ld-linux-aarch64.so.1... > Reading /lib/ld-2.27.so from remote target... > Reading /lib/.debug/ld-2.27.so from remote target... > Reading /usr/lib/debug//lib/ld-2.27.so from remote target... > Reading /usr/lib/debug/lib//ld-2.27.so from remote target... > Reading target:/usr/lib/debug/lib//ld-2.27.so from remote target... > (No debugging symbols found in target:/lib/ld-linux-aarch64.so.1) > 0x0000ffffbf6d31c0 in ?? () from target:/lib/ld-linux-aarch64.so.1 > (gdb) continue > Continuing. > Reading /lib/aarch64-linux-gnu/libc.so.6 from remote target... > Reading /lib/aarch64-linux-gnu/libc-2.27.so from remote target... > Reading /lib/aarch64-linux-gnu/.debug/libc-2.27.so from remote target... > Reading /usr/lib/debug//lib/aarch64-linux-gnu/libc-2.27.so from remote target... > Reading /usr/lib/debug//lib/aarch64-linux-gnu/libc-2.27.so from remote target... > > These file reads are causing a complete native-gdbserver run on the AArch64 > buildbot slave to timeout after 2.5 hours. This is also causing the builds > to back up on the slave. > > The solution is to ensure the sysroot is set to / immediately after connecting. > > This drastically reduces the time of a test. For example, gdb.base/sigall.exp > drops from 23 seconds to 4 seconds. > A full native-gdbserver run on the AArch64 slave now takes 8 minutes. > > However, I'm not sure if putting the sysroot into gdbserver_start will break > other remote setups. In addition, I don't think gdb_test is the correct > function to call within the library - for the mi tests this causes a timeout > as it expect to use mi_gdb_test. > > gdb/testsuite/ChangeLog: > > 2019-03-27 Alan Hayward > > * lib/gdbserver-support.exp (gdbserver_start): Set sysroot. > --- > gdb/testsuite/lib/gdbserver-support.exp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp > index dbd885aa22..065946eb8d 100644 > --- a/gdb/testsuite/lib/gdbserver-support.exp > +++ b/gdb/testsuite/lib/gdbserver-support.exp > @@ -336,6 +336,9 @@ proc gdbserver_start { options arguments } { > break > } > > + # Set sysroot to ensure files are read locally instead of via the remote protocol > + gdb_test "set sysroot /" "" > + > return [list $protocol [$get_remote_address $debughost $portnum]] > } Hi Alan, I have just noticed that two tests of gdb.base/break-probes.exp are failing, most likely because of this patch. These are the failures: (gdb) PASS: gdb.base/break-probes.exp: ensure using probes show sysroot The current system root is "/". (gdb) c Continuing. Stopped due to shared library event: Inferior loaded /lib64/libdl.so.2 /lib64/libm.so.6 /lib64/libc.so.6 (gdb) c Continuing. Stopped due to shared library event (no libraries added or removed) (gdb) c Continuing. Stopped due to shared library event: Inferior loaded /build/gdb/testsuite/outputs/gdb.base/break-probes/break-probes-solib.so (gdb) c Continuing. Stopped due to shared library event (no libraries added or removed) (gdb) c Continuing. Stopped due to shared library event: Inferior unloaded /build/gdb/testsuite/outputs/gdb.base/break-probes/break-probes-solib.so (gdb) c Continuing. [Inferior 1 (process 20591) exited normally] (gdb) FAIL: gdb.base/break-probes.exp: run til our library loads (the program exited) call (int) foo(23) No symbol "foo" in current context. (gdb) FAIL: gdb.base/break-probes.exp: call (int) foo(23) Remote debugging from host ::1, port 33292 Process /build/gdb/testsuite/outputs/gdb.base/break-probes/break-probes created; pid = 20591 Child exited with status 0 monitor exit You can see the BuildBot build here: https://gdb-build.sergiodj.net/builders/Fedora-x86_64-native-gdbserver-m64/builds/12335 The logs: https://gdb-build.sergiodj.net/results/Fedora-x86_64-native-gdbserver-m64/c9/c92df149c29518f6e1d4a3174b3e29162fcd3ad6/ I'm in the middle of something else now, but let me know if you need help with the investigation. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/