From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3350B3858C74; Tue, 12 Jul 2022 06:30:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3350B3858C74 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/29358] New: [gdb/testsuite] ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD Date: Tue, 12 Jul 2022 06:30:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2022 06:30:53 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29358 Bug ID: 29358 Summary: [gdb/testsuite] ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: testsuite Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- When building gdb with -fsanitize=3Daddress and running the gdb testsuite, = we run into: ... ERROR: GDB process no longer exists ERROR: (eof) GDB never initialized. ... In more detail: ... builtin_spawn /home/vries/gdb_versions/devel/build/gdb/testsuite/../../gdb/= gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/vries/gdb_versions/devel/build/gdb/testsuite/../data-directory^M =3D=3D10637=3D=3DASan runtime does not come first in initial library list; = you should either link runtime to your application or manually preload it with LD_PRELOAD.^M ERROR: GDB process no longer exists GDB process exited with wait status 10637 exp13 0 1 UNRESOLVED: gdb.base/libsegfault.exp: gdb emits custom handler warning ... and: ... builtin_spawn /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.threads/atta= ch-slow-waitpid/attach-slow-waitpid^M builtin_spawn /home/vries/gdb_versions/devel/build/gdb/testsuite/../../gdb/= gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/vries/gdb_versions/devel/build/gdb/testsuite/../data-directory^M =3D=3D1953=3D=3DASan runtime does not come first in initial library list; y= ou should either link runtime to your application or manually preload it with LD_PRELOAD.^M ERROR: (eof) GDB never initialized. UNTESTED: gdb.threads/attach-slow-waitpid.exp: Couldn't start GDB with preloaded lib ... Both test-cases use gdb_spawn_with_ld_preload, and are indeed the only ones= to do so. I can prevent the error by doing: ... export ASAN_OPTIONS=3Dverify_asan_link_order=3D0 ... Found here ( https://stackoverflow.com/questions/59853730/asan-issue-with-asan-library-l= oading ), where it is mentioned that it needs to be checked that: ... libraries from /etc/ld.so.preload do not intercept symbols important for As= an e.g. malloc, free, etc. ... I've looked at slow-waitpid.c and debug/segfault.c (the latter in the glibc sources) that looks ok. [ An alternative is to use -static-asan, but I haven't tried that. ] --=20 You are receiving this mail because: You are on the CC list for the bug.=