From patchwork Wed Feb 8 10:49:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 64479 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D25C93858C5E for ; Wed, 8 Feb 2023 10:49:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D25C93858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675853385; bh=8sxX06AOeIxZYoEpN9Vwc6lw/TaMjByveekMDtfaG0w=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=n5gvELdbxXrp4uOxmINHfmHbUaIym9rMvZwE4yYvmMkluHOCQRJ6GkaBYpwa6Xwaj IZ4NnAlj0Q9NgEytF6t3jWfJoo+Q8TNtseiBM6RMEphvR7wkXRrE1WPJeQm4ndq+2U kQIwB01cGCo4J9o8VACLxNBZ8oKUMrx/ZSmQJcu4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id C91803858D39 for ; Wed, 8 Feb 2023 10:49:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C91803858D39 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-out1.suse.de (Postfix) with ESMTPS id EBCF533EA6 for ; Wed, 8 Feb 2023 10:49:20 +0000 (UTC) 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 D9D2213425 for ; Wed, 8 Feb 2023 10:49:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jGP/MzB+42MXPQAAMHmgww (envelope-from ) for ; Wed, 08 Feb 2023 10:49:20 +0000 To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Use maint ignore-probes in gdb.base/solib-corrupted.exp Date: Wed, 8 Feb 2023 11:49:21 +0100 Message-Id: <20230208104921.21868-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Test-case gdb.base/solib-corrupted.exp only works for a glibc without probes interface, otherwise we run into: ... XFAIL: gdb.base/solib-corrupted.exp: info probes UNTESTED: gdb.base/solib-corrupted.exp: GDB is using probes ... Fix this by using maint ignore-probes to simulate the absence of the relevant probes. Also, it requires glibc debuginfo, and if not present, it produces an XFAIL: ... XFAIL: gdb.base/solib-corrupted.exp: make solibs looping UNTESTED: gdb.base/solib-corrupted.exp: no _r_debug symbol has been found ... This is incorrect, because an XFAIL indicates a known problem in the environment. In this case, there is no problem: the environment is functioning as expected when glibc debuginfo is not installed. Fix this by using UNSUPPORTED instead, and make the message less cryptic: ... UNSUPPORTED: gdb.base/solib-corrupted.exp: make solibs looping \ (glibc debuginfo required) ... Finally, with glibc debuginfo present, we run into: ... (gdb) PASS: gdb.base/solib-corrupted.exp: make solibs looping info sharedlibrary^M warning: Corrupted shared library list: 0x7ffff7ffe750 != 0x0^M From To Syms Read Shared Object Library^M 0x00007ffff7dd4170 0x00007ffff7df4090 Yes /lib64/ld-linux-x86-64.so.2^M (gdb) FAIL: gdb.base/solib-corrupted.exp: corrupted list \ (shared library list corrupted) ... due to commit 44288716537 ("gdb, testsuite: extend gdb_test_multiple checks"). Fix this by rewriting into gdb_test_multiple and using -early. Tested on x86_64-linux, with and without glibc debuginfo installed. --- gdb/testsuite/gdb.base/solib-corrupted.exp | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) base-commit: e02841b095a7797aaae1b064fb4b7acc2eb8d900 diff --git a/gdb/testsuite/gdb.base/solib-corrupted.exp b/gdb/testsuite/gdb.base/solib-corrupted.exp index e778711a9d6..24ee2d4f785 100644 --- a/gdb/testsuite/gdb.base/solib-corrupted.exp +++ b/gdb/testsuite/gdb.base/solib-corrupted.exp @@ -26,14 +26,14 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } +# With probes interface GDB no longer scans the inferior library list so its +# corruption cannot be tested. Disable the probes interface. +gdb_test "maint ignore-probes rtld" + if ![runto_main] { return } -# With probes interface GDB no longer scans the inferior library list so its -# corruption cannot be tested. There is no way to disable the probes -# interface. - set probes { init_start init_complete map_start reloc_complete unmap_start unmap_complete } set test "info probes" @@ -51,11 +51,7 @@ gdb_test_multiple $test $test { -re "^$gdb_prompt $" { } } -if { [llength $probes] == 0 } { - xfail $test - untested "GDB is using probes" - return -} +gdb_assert {[llength $probes] == 6} "no probes found" gdb_test "info sharedlibrary" "From * To .*" "normal list" @@ -75,12 +71,18 @@ gdb_test_multiple "p/x _r_debug->r_map->l_next = _r_debug->r_map" $test { -re "$no_glibc_debuginfo_re\r\n$gdb_prompt $" { # glibc debug info is not available and it is too difficult to find and # parse it from this testcase without the gdb supporting functions. - xfail $test - untested "no _r_debug symbol has been found" + unsupported "$gdb_test_name (glibc debuginfo required)" return } -re " = 0x\[0-9a-f\]+\r\n$gdb_prompt $" { pass $test } } -gdb_test "info sharedlibrary" "warning: Corrupted shared library list: .*" "corrupted list" + +# Use -early to prevent the default handling of the warning in gdb_test_multiple +# from triggering. +gdb_test_multiple "info sharedlibrary" "corrupted list" { + -early -re -wrap "warning: Corrupted shared library list: .*" { + pass $gdb_test_name + } +}