From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GT90EQYyWWnFMigAWB0awg (envelope-from ) for ; Sat, 03 Jan 2026 10:13:10 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=bWfOFc/q; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=JH6ek73R; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=bWfOFc/q; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=JH6ek73R; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 438751E08D; Sat, 03 Jan 2026 10:13:10 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8D53D1E08D for ; Sat, 03 Jan 2026 10:13:09 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id E408F4BA2E05 for ; Sat, 3 Jan 2026 15:13:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E408F4BA2E05 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=bWfOFc/q; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=JH6ek73R; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=bWfOFc/q; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=JH6ek73R Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 622F24BA2E05 for ; Sat, 3 Jan 2026 15:12:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 622F24BA2E05 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 622F24BA2E05 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767453162; cv=none; b=OgrDypVsWh1Yd54BM8jtZsY/mG97qwmB+Rdv3CIaBR2v5SHXzCyQ+HDCvDWmiAEuLxbBY33qMNikot5NthkX9BM8RUTSQI+5UCbO9aEan27GBCWVUbZk5OebOx7Xo8A2uF7XhkOZe83+L2GWbb40P0Xouewl97VhGJ+qDRMFt+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767453162; c=relaxed/simple; bh=9Q/O1gzsJhGj+g+996heWTHAaifDOPLz0r+/q0HZZ8w=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=xMyKZFa1jzGKd++Lfxyq0RJKhpPpSZ1MYZ/lybam0lPk2sglGQL0oCgxo5KlsfDmtBWpKGg1BmAUUnjkkw1WjrGTKc2YOrwEeSrBXin9Gfq/9bfipNJWRJXeWZzcviis7NfoSQtQtDQxCy/e48HSvHZjszuGbzejVsAPBuMxWiE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 622F24BA2E05 Received: from imap1.dmz-prg2.suse.org (unknown [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-out2.suse.de (Postfix) with ESMTPS id 425C75BCC2 for ; Sat, 3 Jan 2026 15:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1767453161; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O9uKwa92hlMmR2UNkhgOWmxflrU7AVh08THf36a8JuU=; b=bWfOFc/qryWuQ3h8FiEDN6FAAji0m9/z1p4N/EfIstKz+mWIUI6WYnA8ysJ5lKyUTsBx8w nxjlv1to+RgxME30IIVx0ozoAg/C8rXBAq07Axmri73qUP42RuuC0MgwC3ytMpU4SERHVF To+y38V6gi0k8zf2oXdzwrhif+1HYJ4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1767453161; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O9uKwa92hlMmR2UNkhgOWmxflrU7AVh08THf36a8JuU=; b=JH6ek73RgneLu9Eaz+XK8wYgbL5jfB7PpFR2HDMZlVFr+Ax7d+kBECYYMJlsovMud8LiDd ksxKJqrRzEzUMpAg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1767453161; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O9uKwa92hlMmR2UNkhgOWmxflrU7AVh08THf36a8JuU=; b=bWfOFc/qryWuQ3h8FiEDN6FAAji0m9/z1p4N/EfIstKz+mWIUI6WYnA8ysJ5lKyUTsBx8w nxjlv1to+RgxME30IIVx0ozoAg/C8rXBAq07Axmri73qUP42RuuC0MgwC3ytMpU4SERHVF To+y38V6gi0k8zf2oXdzwrhif+1HYJ4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1767453161; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O9uKwa92hlMmR2UNkhgOWmxflrU7AVh08THf36a8JuU=; b=JH6ek73RgneLu9Eaz+XK8wYgbL5jfB7PpFR2HDMZlVFr+Ax7d+kBECYYMJlsovMud8LiDd ksxKJqrRzEzUMpAg== 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 2E5423EA63 for ; Sat, 3 Jan 2026 15:12:41 +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 FTG8CekxWWlpfQAAD6G6ig (envelope-from ) for ; Sat, 03 Jan 2026 15:12:41 +0000 Message-ID: <9bd17e22-19d1-4ef4-9a1d-1831cd6b7a0a@suse.de> Date: Sat, 3 Jan 2026 16:12:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PING][PATCH] [gdb/testsuite] Fix gdb.base/inline-frame-cycle-unwind.exp for s390x (alternative) From: Tom de Vries To: gdb-patches@sourceware.org References: <20251211133946.962934-1-tdevries@suse.de> Content-Language: en-US In-Reply-To: <20251211133946.962934-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-3.57 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.53)[0.177]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid, gdb.base:url, imap1.dmz-prg2.suse.org:helo] 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~public-inbox=simark.ca@sourceware.org On 12/11/25 2:39 PM, Tom de Vries wrote: > With test-case gdb.base/inline-frame-cycle-unwind.exp on s390x-linux, I run > into: > ... > (gdb) bt^M > #0 inline_func () at inline-frame-cycle-unwind.c:49^M > #1 normal_func () at inline-frame-cycle-unwind.c:32^M > #2 0x000000000100065c in inline_func () at inline-frame-cycle-unwind.c:45^M > #3 normal_func () at inline-frame-cycle-unwind.c:32^M > Backtrace stopped: previous frame identical to this frame (corrupt stack?)^M > (gdb) FAIL: $exp: bt: cycle at level 5: backtrace when the unwind is broken \ > at frame 5 > ... > > In contrast, on x86_64-linux, I get: > ... > (gdb) bt^M > #0 inline_func () at inline-frame-cycle-unwind.c:49^M > #1 normal_func () at inline-frame-cycle-unwind.c:32^M > #2 0x0000000000401157 in inline_func () at inline-frame-cycle-unwind.c:45^M > #3 normal_func () at inline-frame-cycle-unwind.c:32^M > #4 0x0000000000401157 in inline_func () at inline-frame-cycle-unwind.c:45^M > #5 normal_func () at inline-frame-cycle-unwind.c:32^M > Backtrace stopped: previous frame identical to this frame (corrupt stack?)^M > (gdb) PASS: $exp: bt: cycle at level 5: backtrace when the unwind is broken \ > at frame 5 > ... > > AFAIU, the mechanism of the test is as follows: the custom unwinder produces the > frame-id for frame #5 at frame #4. Consequently, when arriving at frame #5, a > cycle is detected. > > [ It took me a while to understand this because of the following off-by-one > confusion: for frame #0, we get pending_frame.level() == 1. So when > stop_at_level == 5, the custom unwinder calculates a frame-id for frame #4, > not frame #5. But the frame-id it calculates is the one for frame #5, so > unwinding will stop at frame #5 because the frame-ids for frame #4 and > frame #5 are identical. ] > > This relies on the test-case to calculate the offending frame-id, and the > problem on s390x is that that calculation is incorrect. > > Fix this by using "maint print frame-id" to get all frame-ids, and using those > instead. > Ping. Thanks, - Tom > Tested on x86_64-linux and s390x-linux. > --- > .../gdb.base/inline-frame-cycle-unwind.exp | 13 +++++++++++++ > gdb/testsuite/gdb.base/inline-frame-cycle-unwind.py | 8 +++++--- > 2 files changed, 18 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp b/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp > index 7fc47af624f..5c6504323ee 100644 > --- a/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp > +++ b/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp > @@ -72,6 +72,19 @@ gdb_continue_to_breakpoint "stop at test breakpoint" > gdb_test_no_output "source ${pyfile}"\ > "import python scripts" > > +foreach_with_prefix n { 0 1 2 3 4 5 6 } { > + set sp 0x0 > + set pc 0x0 > + gdb_test_multiple "maint print frame-id $n" "" { > + -re -wrap "frame-id for frame #$n: {stack=($hex),code=($hex),.*}" { > + set sp $expect_out(1,string) > + set pc $expect_out(2,string) > + gdb_test_no_output "python frame_id_sp.append($sp)" > + gdb_test_no_output "python frame_id_pc.append($pc)" > + } > + } > +} > + > # Test with and without filters. > foreach bt_cmd { "bt" "bt -no-filters" } { > with_test_prefix "$bt_cmd" { > diff --git a/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.py b/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.py > index 55dea989512..25a67b1a7c9 100644 > --- a/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.py > +++ b/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.py > @@ -26,6 +26,9 @@ stop_at_level = None > # function called recursively. > stack_adjust = None > > +frame_id_sp = [] > +frame_id_pc = [] > + > > class FrameId(object): > def __init__(self, sp, pc): > @@ -55,9 +58,8 @@ class TestUnwinder(Unwinder): > if stop_at_level not in [1, 3, 5]: > raise gdb.GdbError("invalid stop_at_level") > > - sp_desc = pending_frame.architecture().registers().find("sp") > - sp = pending_frame.read_register(sp_desc) + stack_adjust > - pc = (gdb.lookup_symbol("normal_func"))[0].value().address > + sp = frame_id_sp[stop_at_level] > + pc = frame_id_pc[stop_at_level] > unwinder = pending_frame.create_unwind_info(FrameId(sp, pc)) > > for reg in pending_frame.architecture().registers("general"): > > base-commit: 2271dee682787051c0628c869d7cdb220bdd0e67