From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id z+udNG9+OGmDWCkAWB0awg (envelope-from ) for ; Tue, 09 Dec 2025 14:54:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1765310063; bh=xS0ZppORTokPCNZg7XceWu4kh1LJQvihYfQqW0WUy0Q=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=p1sXX5Axkvj20eTkGr9OEkrxrISXKV65MF+mhDTUQKeWXT9xfdlNvs56fTu5OV1OQ wkZe3dZSeaPO3I02ek/toRe7CekKcQbUfW8BB3L3PDm+lKpd3gVoNFqLhrYJbzOCw0 k7s94V3XP6T/DXbB7KDqehckBMwrmyhrePQeMoJM= Received: by simark.ca (Postfix, from userid 112) id C9C2A1E0AB; Tue, 09 Dec 2025 14:54:23 -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 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=pq6R8ha0; dkim-atps=neutral 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 3DFE61E0AB for ; Tue, 09 Dec 2025 14:54:23 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id D01BC4BA2E06 for ; Tue, 9 Dec 2025 19:54:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D01BC4BA2E06 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=pq6R8ha0 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 8C8304BA2E00 for ; Tue, 9 Dec 2025 19:54:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C8304BA2E00 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8C8304BA2E00 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765310040; cv=none; b=lPlxOfZW4Ottnu+LojByr3HehMsE18mYdzxKoeoN7i+37hLl06RTUyaKR6g3BuaqQYh95xcsQuvg0dM0oeG+OVMkIIsq077elIVMtbZ0AHCJSDhEGiy5qDBR/g19qo7uheBA0zOh+S0uWOZ/lafTjpYSm8oMx2Dq3NoWMhuDtEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765310040; c=relaxed/simple; bh=xS0ZppORTokPCNZg7XceWu4kh1LJQvihYfQqW0WUy0Q=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=xTpqdv9lWJkTHginpoC+U5q7E7KuMvhVq9rm3toApD7ORa/jARjChZjvSuBBJnOVSVdcoOBLCFIbc9cu4694RH9mPc2JuoWmgVh1di8FZHm+sH9kWRQqydzd9nwRwJvyUjHPVu9SMfEIVtMvHsg24Zb5YglZhGf9Esisq4rz9gE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C8304BA2E00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1765310040; bh=xS0ZppORTokPCNZg7XceWu4kh1LJQvihYfQqW0WUy0Q=; h=Date:Subject:To:References:From:In-Reply-To:From; b=pq6R8ha01kbBX11KHNspBK+XXvgKG/13HuZFk9k+ul2flnIoYdpvlrcQDnJFLcvrp NAgn/aeyDGvvk0nfQqh0GNBl8uNGdss/vX4dLYOBg4dGD9oDe0MMGyUNwe5vnj7uV8 McaTp2hWz2pMWJOKxazw/F42FYPPA9Jhuw6pTzxE= Received: by simark.ca (Postfix) id 395BD1E08D; Tue, 09 Dec 2025 14:54:00 -0500 (EST) Message-ID: <0a18d3d7-8687-43cf-9598-90ab52af86bd@simark.ca> Date: Tue, 9 Dec 2025 14:53:59 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.base/inline-frame-cycle-unwind.exp for s390x To: Kevin Buettner , gdb-patches@sourceware.org References: <20251102044651.502973-1-kevinb@redhat.com> <20251208125338.02cc248e@f41-zbm-amd> Content-Language: fr From: Simon Marchi In-Reply-To: <20251208125338.02cc248e@f41-zbm-amd> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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/8/25 2:53 PM, Kevin Buettner wrote: > Ping. > > On Sat, 1 Nov 2025 21:46:51 -0700 > Kevin Buettner wrote: > >> This commit fixes six failures for s390x due to a fundamental >> difference in unwinding behavior between s390x and other >> architectures: >> >> FAIL: gdb.base/inline-frame-cycle-unwind.exp: bt: cycle at level 5: >> backtrace when the unwind is broken at frame 5 >> FAIL: gdb.base/inline-frame-cycle-unwind.exp: bt: cycle at level 3: >> backtrace when the unwind is broken at frame 3 >> FAIL: gdb.base/inline-frame-cycle-unwind.exp: bt: cycle at level 1: >> backtrace when the unwind is broken at frame 1 >> FAIL: gdb.base/inline-frame-cycle-unwind.exp: bt -no-filters: cycle at level 5: >> backtrace when the unwind is broken at frame 5 >> FAIL: gdb.base/inline-frame-cycle-unwind.exp: bt -no-filters: cycle at level 3: >> backtrace when the unwind is broken at frame 3 >> FAIL: gdb.base/inline-frame-cycle-unwind.exp: bt -no-filters: cycle at level 1: >> backtrace when the unwind is broken at frame 1 >> >> The core issue is that on s390x, the Canonical Frame Address (CFA) for >> a function points *into the caller's stack frame*, whereas on x86_64 >> or aarch64 the CFA points *within the current function's frame*. This >> architectural difference causes cycle detection to occur later on >> s390x. >> >> The patch resolves this by: >> - Making expected backtrace output architecture-specific. >> - For non-s390x targets: expecting the full set of frames up to the >> specified level. >> - For s390x: expecting fewer frames before detecting the cycle >> (e.g., level 5 shows 3 frames instead of 5). >> - Skipping the cycle at level 1 test entirely on s390x since it cannot >> be detected at that frame. >> >> Tested using recent Fedora releases on s390x, x86_64, and aarch64. I can't comment on the s390x-specific details, but code-wise the patch LGTM. Tom de Vries might have an opinion, he was doing some s390x fixes recently. Some nits below. >> --- >> .../gdb.base/inline-frame-cycle-unwind.exp | 81 +++++++++++++------ >> 1 file changed, 57 insertions(+), 24 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..ccd86eb79ab 100644 >> --- a/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp >> +++ b/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp >> @@ -92,15 +92,31 @@ foreach bt_cmd { "bt" "bt -no-filters" } { >> gdb_test_no_output "python stop_at_level=5" >> gdb_test "maint flush register-cache" \ >> "Register cache flushed\\." >> + >> + # Frames expected on all targets >> + set exp [list \ >> + "#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]*" \ >> + "#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]*" \ >> + "#2 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]*" \ >> + "#3 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]*"] >> + >> + # Additional frames required on non-s390x targets >> + if {![istarget "s390x*-*-*"]} { >> + lappend exp \ >> + "#4 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]*" \ >> + "#5 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]*" >> + } >> + # >> + # The final line that should appear for every target Unexpected `#` by itself above. >> @@ -108,25 +124,42 @@ foreach bt_cmd { "bt" "bt -no-filters" } { >> gdb_test_no_output "python stop_at_level=3" >> gdb_test "maint flush register-cache" \ >> "Register cache flushed\\." >> + # Frames expected on all targets >> + set exp [list \ >> + "#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]*" \ >> + "#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]*"] >> + >> + # Additional frames required on non-s390x targets >> + if {![istarget "s390x*-*-*"]} { >> + lappend exp \ >> + "#2 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]*" \ >> + "#3 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]*" >> + } >> + # >> + # The final line that should appear for every target Likewise. Simon