From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ovVODNV5bmkHJQsAWB0awg (envelope-from ) for ; Mon, 19 Jan 2026 13:37:09 -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=fruasle6; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AfFwEBbs; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=fruasle6; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AfFwEBbs; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 21EF81E0DD; Mon, 19 Jan 2026 13:37:09 -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 7D8941E089 for ; Mon, 19 Jan 2026 13:37:07 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 97DD84BA9021 for ; Mon, 19 Jan 2026 18:37:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97DD84BA9021 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=fruasle6; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AfFwEBbs; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=fruasle6; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AfFwEBbs Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 6664C4BBCDDD for ; Mon, 19 Jan 2026 18:36:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6664C4BBCDDD 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 6664C4BBCDDD Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768847790; cv=none; b=Yy1SZUDSmEZ+NvBsRcbX2dk2JC3xeTIpJoMyMP4+eQVtessa9SvmquT7dhqrgCkEkgqh1EOc9iKBoWM8Pb8Vl5HKDALUkYQOvuxLe6VmPZ9lbY1Z1j28tTMk4IaKKTROu6yvh6NTr2QK4j2wKE6QKbD0TcjH8qfxeM9UnMF+Sxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768847790; c=relaxed/simple; bh=s7/vA8MeXepf+4oZ5oXfAHXM0EGcVdNVPiumhPyXAnA=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=VQVfPzbAHGyAuEG/uFZHKyuBs2o0+0nCuO3C8C/0MAVUK1lQQkV9MkcQZXPJDW/f0eZ+cC4iXVu12n6eLieStQ6s3zoh8Z9/I4hVKGLYrPlz8pOF5Me6edoy/isq07OR5NHrE+Tg0i42affo0h8gro33JZPJPup9B6SuYbefVLo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6664C4BBCDDD Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 C4D2A5BCCF; Mon, 19 Jan 2026 18:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1768847788; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5p0bw8MN9+OnHU7tffWmm5A2/bJWs2j0Q07VRrLpXds=; b=fruasle6quxoJjHYQALFvBy79BRwV52H6H5h7/Z0frd56kpc1YQCwrsNoLLUQ9nTRC9KK6 BgDFrUcmlfUuDC2cSTZvbY+l4cj3M5IOGJnXeHMFgnrifQSJchiVaUeHQ9dB7L83pGxJ2h ef3SGuUpeP6LS+7CHopyilpFZJu3zUA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1768847788; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5p0bw8MN9+OnHU7tffWmm5A2/bJWs2j0Q07VRrLpXds=; b=AfFwEBbs+Um7gMdryLTr3d/+yzQUEiWMhB3fypXx1/KMOVPVycARO4YAO8GlUWtpAhpZqt uBkX2Goz4Jt++lAQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=fruasle6; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=AfFwEBbs DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1768847788; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5p0bw8MN9+OnHU7tffWmm5A2/bJWs2j0Q07VRrLpXds=; b=fruasle6quxoJjHYQALFvBy79BRwV52H6H5h7/Z0frd56kpc1YQCwrsNoLLUQ9nTRC9KK6 BgDFrUcmlfUuDC2cSTZvbY+l4cj3M5IOGJnXeHMFgnrifQSJchiVaUeHQ9dB7L83pGxJ2h ef3SGuUpeP6LS+7CHopyilpFZJu3zUA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1768847788; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5p0bw8MN9+OnHU7tffWmm5A2/bJWs2j0Q07VRrLpXds=; b=AfFwEBbs+Um7gMdryLTr3d/+yzQUEiWMhB3fypXx1/KMOVPVycARO4YAO8GlUWtpAhpZqt uBkX2Goz4Jt++lAQ== 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 B06703EA63; Mon, 19 Jan 2026 18:36:28 +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 r77KKax5bmm4cQAAD6G6ig (envelope-from ); Mon, 19 Jan 2026 18:36:28 +0000 Message-ID: <9d26689a-18a8-4546-b807-1f4c7c3b7cf9@suse.de> Date: Mon, 19 Jan 2026 19:36:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PING^2][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> <9bd17e22-19d1-4ef4-9a1d-1831cd6b7a0a@suse.de> Content-Language: en-US Cc: Kevin Buettner In-Reply-To: <9bd17e22-19d1-4ef4-9a1d-1831cd6b7a0a@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: C4D2A5BCCF X-Rspamd-Server: rspamd1.dmz-prg2.suse.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~public-inbox=simark.ca@sourceware.org On 1/3/26 4:12 PM, Tom de Vries wrote: > 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^2. 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 >