From patchwork Wed Mar 20 09:11:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 87397 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 B95E5385842E for ; Wed, 20 Mar 2024 09:10:51 +0000 (GMT) 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.223.130]) by sourceware.org (Postfix) with ESMTPS id 150C43858D1E for ; Wed, 20 Mar 2024 09:10:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 150C43858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 150C43858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710925825; cv=none; b=DLMHRTJlWyKQhLBPC4AEQbOCYBwEhdtAwrXXgFE7MOzNhjlBKyBpy6ILxoj++YCLfWA2vhBTblVyz7kmwfWcELr/B6MTCJxGQn1z1C28390wClfl7jDPLA0z3guzjP7dOKz3TI5EhRk88lBGyMlF6IKqwJ9y6z9yvlZIlWnXxeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710925825; c=relaxed/simple; bh=P3+Pm5j8qHxjtAC9rXe1Q8tgDU6F9GkyDP4AG69+uow=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=UsNIG+5grjDPIdm7NLjIrqDjDuOgX2jEKz9LyP0TD4zuQYnCdosgZJCksD0Ek0VQJwXx2S+Y3/ZP66QKaU05dbIigb0hZWvDJg63vIk09fPdEbihbIITspRTrfy5BOBURNweRNniIyX9Qvm7lVW0Bi7OVYwnFpA0Kq3xHafrrE4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8E57934078 for ; Wed, 20 Mar 2024 09:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710925819; 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=Z0f3TeAbpleQtyybKLfqqW9RMmKLFfz0lpruKeMla5w=; b=jTlPTIaKdIseS6eo5J6+0xstT8Chi0x45KjCo/w6tCZBd1BOSOol9MByqyOVIN+uyvqXj/ 347LOIGd7Hc/OshXl4u0Yqgyfb6tDrbVdQFqDgY5oHIiWk6QOHNHcAUS53A5bfjvuJQlDk 5VN34NaScjIJdB0gRaFAO+8Tgx3S1WQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710925819; 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=Z0f3TeAbpleQtyybKLfqqW9RMmKLFfz0lpruKeMla5w=; b=PYAYWuJ9OyW2qcjfExBus6NWE6FtckV9IbftySKZhYC6vKxVhpMmFHcfh3B1Ch/kVykZ1K N9CxP7VFQ3/LwlAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710925819; 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=Z0f3TeAbpleQtyybKLfqqW9RMmKLFfz0lpruKeMla5w=; b=jTlPTIaKdIseS6eo5J6+0xstT8Chi0x45KjCo/w6tCZBd1BOSOol9MByqyOVIN+uyvqXj/ 347LOIGd7Hc/OshXl4u0Yqgyfb6tDrbVdQFqDgY5oHIiWk6QOHNHcAUS53A5bfjvuJQlDk 5VN34NaScjIJdB0gRaFAO+8Tgx3S1WQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710925819; 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=Z0f3TeAbpleQtyybKLfqqW9RMmKLFfz0lpruKeMla5w=; b=PYAYWuJ9OyW2qcjfExBus6NWE6FtckV9IbftySKZhYC6vKxVhpMmFHcfh3B1Ch/kVykZ1K N9CxP7VFQ3/LwlAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 77700136CD for ; Wed, 20 Mar 2024 09:10:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 5hrPG/un+mXDTgAAD6G6ig (envelope-from ) for ; Wed, 20 Mar 2024 09:10:19 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v2] [gdb/testsuite] Add PR gdb/26967 KFAIL in two more test-cases Date: Wed, 20 Mar 2024 10:11:28 +0100 Message-Id: <20240320091128.16646-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Score: 0.70 X-Spamd-Result: default: False [0.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Spam-Status: No, score=-12.3 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, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org On aarch64-linux (debian 12), when running test-case gdb.base/longjmp-until-in-main.exp, I run into: ... (gdb) until 33^M warning: Breakpoint address adjusted from 0x70f727c678928489 to 0xfff727c678928489.^M Warning:^M Cannot insert breakpoint 0.^M Cannot access memory at address 0xfff727c678928489^M ^M 0x0000fffff7e3a580 in siglongjmp () from /lib/aarch64-linux-gnu/libc.so.6^M (gdb) FAIL: gdb.base/longjmp-until-in-main.exp: until $line, in main ... This is PR gdb/26967: no longjmp probe is available: ... (gdb) info probes stap libc ^longjmp$^M No probes matched.^M ... and glibc applies pointer mangling which makes it fairly difficult for gdb to get the longjmp target. There's a KFAIL for this in test-case gdb.base/longjmp.exp, added in commit b5e7cd5cd3d ("[gdb/testsuite] Add KFAILs in gdb.base/longjmp.exp"). Factor out new proc have_longjmp_probe, and use it to add similar KFAIL in this and one more test-case. Tested on aarch64-linux. --- .../gdb.base/longjmp-until-in-main.exp | 24 ++++++++++++++++--- gdb/testsuite/gdb.base/longjmp.exp | 11 +-------- .../premature-dummy-frame-removal.exp | 22 ++++++++++++++++- gdb/testsuite/lib/gdb.exp | 19 +++++++++++++++ 4 files changed, 62 insertions(+), 14 deletions(-) base-commit: 8a61ee551ce3059f602fee1e576af08c03f991bc diff --git a/gdb/testsuite/gdb.base/longjmp-until-in-main.exp b/gdb/testsuite/gdb.base/longjmp-until-in-main.exp index d755c86ed88..2e308f5b710 100644 --- a/gdb/testsuite/gdb.base/longjmp-until-in-main.exp +++ b/gdb/testsuite/gdb.base/longjmp-until-in-main.exp @@ -35,10 +35,28 @@ if {![runto_main]} { return } +set have_longjmp_probe [have_longjmp_probe] + delete_breakpoints set until_to_line [gdb_get_line_number "until to here"] -gdb_test "until $until_to_line" \ - " until to here .*" \ - "until \$line, in main" +set re_cannot_insert_bp \ + [multi_line \ + "Warning:" \ + "Cannot insert breakpoint $::decimal\\." \ + "Cannot access memory at address $::hex"] + +set test "until \$line, in main" +gdb_test_multiple "until $until_to_line" $test { + -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { + if { $have_longjmp_probe } { + fail $gdb_test_name + } else { + kfail gdb/26967 $gdb_test_name + } + } + -re -wrap " until to here .*" { + pass $gdb_test_name + } +} diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp index 1e6860445d0..00a3fcbe741 100644 --- a/gdb/testsuite/gdb.base/longjmp.exp +++ b/gdb/testsuite/gdb.base/longjmp.exp @@ -62,16 +62,7 @@ proc do_test { with_probes } { # # We detect the different failure modes and kfail these. - set have_longjmp_probe 0 - gdb_test_multiple "info probes stap libc ^longjmp$" "" { - -re -wrap "No probes matched\\." { - pass $gdb_test_name - } - -re -wrap "\r\nstap\[ \t\]+libc\[ \t\]+longjmp\[ \t\]+.*" { - pass $gdb_test_name - set have_longjmp_probe 1 - } - } + set have_longjmp_probe [have_longjmp_probe] if { $with_probes } { if { !$have_longjmp_probe } { diff --git a/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp b/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp index 100c24aae20..19e28bb6631 100644 --- a/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp +++ b/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp @@ -49,7 +49,27 @@ if {![runto_main]} { set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py] gdb_test_no_output "source ${pyfile}" "load python file" -gdb_test "p some_func ()" " = 0" +set have_longjmp_probe [have_longjmp_probe] + +set re_cannot_insert_bp \ + [multi_line \ + "Warning:" \ + "Cannot insert breakpoint $::decimal\\." \ + "Cannot access memory at address $::hex"] + +gdb_test_multiple "p some_func ()" "" { + -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { + if { $have_longjmp_probe } { + fail $gdb_test_name + } else { + kfail gdb/26967 $gdb_test_name + return 0 + } + } + -re -wrap " = 0" { + pass $gdb_test_name + } +} # When frame debugging is turned on, this test has (previously) # revealed some crashes due to the Python frame unwinder trying to diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 4d27b60ef49..a0c4855ffc5 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4622,6 +4622,25 @@ proc skip_libstdcxx_probe_tests {} { return [skip_libstdcxx_probe_tests_prompt "$gdb_prompt $"] } +# Return 1 if libc supports the longjmp probe. Note that we're not using +# gdb_caching_proc because the probe may have been disabled. + +proc have_longjmp_probe {} { + set have_probe -1 + gdb_test_multiple "info probes stap libc ^longjmp$" "" { + -re -wrap "No probes matched\\." { + set have_probe 0 + } + -re -wrap "\r\nstap\[ \t\]+libc\[ \t\]+longjmp\[ \t\]+.*" { + set have_probe 1 + } + } + if { $have_probe == -1 } { + error "failed to get libc longjmp probe status" + } + return $have_probe +} + # Helper for gdb_is_target_* procs. TARGET_NAME is the name of the target # we're looking for (used to build the test name). TARGET_STACK_REGEXP # is a regexp that will match the output of "maint print target-stack" if