From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id C2AC13858CDA for ; Fri, 30 Dec 2022 15:54:08 +0000 (GMT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E67AB2021A for ; Fri, 30 Dec 2022 15:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1672415647; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gzC6UhL896vRnWKM8kke6rG0V0wpWsOHKMXAjnM3qn4=; b=neonpqVrrsxivOvpQvENyMzMCUXfvRyMHTVRLYL89rEfhsjJmbTFkwWG8eq0KGF5BoWp9o QyjR4lFxVwGmitnUsV09ezj9IRt2Af9QK9+rWVECAemYAUL3pq533D+K4gIs2Nux75PiRY 2P5jtPTdwFkCqnXo4uOiA1FChh/95W0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1672415647; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gzC6UhL896vRnWKM8kke6rG0V0wpWsOHKMXAjnM3qn4=; b=kNL2mKC0+1+s/sUYnJo75RqYrghRnxolx10Sq0DAGWr3Uu1XR2LjOVTsg0PsC2P4cG+zuN NqSkv+ZNATvCNeBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D277E13638 for ; Fri, 30 Dec 2022 15:54:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id VUgWMp8Jr2O7RQAAMHmgww (envelope-from ) for ; Fri, 30 Dec 2022 15:54:07 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Fix gdb.threads/dlopen-libpthread.exp for upstream glibc Date: Fri, 30 Dec 2022 16:54:07 +0100 Message-Id: <20221230155407.5917-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On ubuntu 22.04.1 x86_64, I run into: ... (gdb) info probes all rtld rtld_map_complete^M No probes matched.^M (gdb) XFAIL: gdb.threads/dlopen-libpthread.exp: info probes all rtld rtld_map_complete UNTESTED: gdb.threads/dlopen-libpthread.exp: no matching probes ... This has been filed as PR testsuite/17016. The problem is that the name rtld_map_complete is used, which was only available in Fedora 17, and upstream the name map_complete was used. In the email thread discussing a proposed patch ( https://sourceware.org/legacy-ml/gdb-patches/2014-09/msg00712.html ) it was suggested to make the test-case handle both names. So, handle both names: map_complete and rtld_map_complete. This exposes the following FAIL: ... (gdb) info sharedlibrary^M >From To Syms Read Shared Object Library^M $hex $hex Yes /lib64/ld-linux-x86-64.so.2^M $hex $hex Yes (*) /lib/x86_64-linux-gnu/libgtk3-nocsd.so.0^M $hex $hex Yes /lib/x86_64-linux-gnu/libc.so.6^M $hex $hex Yes /lib/x86_64-linux-gnu/libdl.so.2^M $hex $hex Yes /lib/x86_64-linux-gnu/libpthread.so.0^M (*): Shared library is missing debugging information.^M (gdb) FAIL: gdb.threads/dlopen-libpthread.exp: libpthread.so not found ... due to using a glibc (v2.35) that has libpthread integrated into libc. Fix this by changing the FAIL into UNSUPPORTED. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17016 --- .../gdb.threads/dlopen-libpthread.exp | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp index 5c3d8a34c30..dcc48260e88 100644 --- a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp +++ b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp @@ -40,22 +40,37 @@ if { ![runto_main] } { return -1 } -set test "info probes all rtld rtld_map_complete" -gdb_test_multiple $test $test { - -re "\[ \t\]rtld_map_complete\[ \t\]+0x\[0-9a-f\]+.*\r\n$gdb_prompt $" { - pass $test - } - -re "No probes matched\\.\r\n$gdb_prompt $" { - xfail $test - untested "no matching probes" - return +set probe_names {} +# Fedora 17 name. There's specific code in +# svr4_find_and_create_probe_breakpoints to deal with this. +lappend probe_names rtld_map_complete +# Upstream name. +lappend probe_names map_complete + +set have_probe 0 +foreach probe_name $probe_names { + set cmd "info probes all rtld ^$probe_name$" + gdb_test_multiple $cmd "" { + -re -wrap "\[ \t\]$probe_name\[ \t\]+0x\[0-9a-f\]+.*" { + set have_probe 1 + } + -re -wrap "No probes matched\\." { + } } } +if { !$have_probe } { + untested "no matching probes" +} + set test "libpthread.so not found" gdb_test_multiple "info sharedlibrary" $test { -re "/libpthread\\.so.*\r\n$gdb_prompt $" { - fail $test + # With newer glibc, libpthread has been integrated into glibc so we + # can expect it to be already loaded at main. This means we no longer + # excercise the scenario we're trying to trigger, but continue + # nevertheless. + unsupported $test } -re "/libc\\.so.*\r\n$gdb_prompt $" { pass $test base-commit: d6246a8730fad9edcb972c1f689a13bb16640483 -- 2.35.3