From: Tom de Vries Date: Thu, 9 Jan 2025 12:14:57 +0000 (+0100) Subject: [gdb/testsuite] Run one more test-case with ASAN_OPTIONS=verify_asan_link_order=0 X-Git-Tag: binutils-2_44~220 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dabe45ce0c3b5a04029164646024e7c99d4b8649;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Run one more test-case with ASAN_OPTIONS=verify_asan_link_order=0 After building gdb with asan, and running test-case gdb.trace/basic-libipa.exp, I got: ... (gdb) run ^M Starting program: basic-libipa ^M [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M ==7705==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.^M [Inferior 1 (process 7705) exited with code 01]^M (gdb) FAIL: gdb.trace/basic-libipa.exp: runto: run to main ... Fix this in the same way as in commit 75948417af8 ("[gdb/testsuite] Run two test-cases with ASAN_OPTIONS=verify_asan_link_order=0"). Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.trace/basic-libipa.exp b/gdb/testsuite/gdb.trace/basic-libipa.exp index c49192a5c35..dcde297365f 100644 --- a/gdb/testsuite/gdb.trace/basic-libipa.exp +++ b/gdb/testsuite/gdb.trace/basic-libipa.exp @@ -30,11 +30,21 @@ set libipa [get_in_proc_agent] gdb_download_shlib $libipa -if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ +if { [build_executable "failed to prepare" $testfile $srcfile \ [list debug shlib=$libipa]] } { return -1 } +save_vars { env(ASAN_OPTIONS) } { + # Prevent address sanitizer error: + # 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. + set_sanitizer_default ASAN_OPTIONS verify_asan_link_order 0 + + clean_restart $binfile +} + if {![runto_main]} { return -1 }