From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iQJFME7MOmn52TMAWB0awg (envelope-from ) for ; Thu, 11 Dec 2025 08:51: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=XScDXRRG; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=SCRiCZz2; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=a9ulGEBa; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=C5BjK6OJ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C13561E048; Thu, 11 Dec 2025 08:51: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 0DD731E048 for ; Thu, 11 Dec 2025 08:51:10 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 96DC64BA2E28 for ; Thu, 11 Dec 2025 13:51:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96DC64BA2E28 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=XScDXRRG; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=SCRiCZz2; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=a9ulGEBa; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=C5BjK6OJ Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id A73B24BA2E05 for ; Thu, 11 Dec 2025 13:50:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A73B24BA2E05 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 A73B24BA2E05 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=1765461041; cv=none; b=sa2BT/UVwIYXL6jQFBtmET+ouU468YOJEhK4HJoyx7trEQnBXy4PVPg3qHD7p29h3sbAA+Pu3zNEsIx341BC26w8FejdUaT/9XnE8uHvW5VsmjeOqYSDBtCK9W1L+CvXsgEdxYqURTsmIbc+dJXsGaX1M5iNMw8Mprjnz+g3p1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765461041; c=relaxed/simple; bh=94YHevuyDLttZnJn2Npz9+FpQycYlBAjee2ySixf1Zw=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=LYtmYuz+RDqpcfE10j3qHluj3Y5+D6ivOQ1p4kS/vG8BQMOvm/SAIKXe6qZyXaFfODI3g2wY2QPB4lBOVigU1TceujjXejbHsfwuyBzSnJEtWihIlCFlDRB5A+Q7+d5MvN+a4YK7kWM76Svoa1iih28m1MPO2KMFgpYjZNRj0wI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A73B24BA2E05 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 769335BD42; Thu, 11 Dec 2025 13:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1765461040; 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=Md70lDf8i7JP0njDRYBxlbElJlkPUyzbiGw21VnKd10=; b=XScDXRRGHTlYaLML4al5XAkQ8jAb15nzE2xtFOY6odGGASsTEBcY7AHx8C14ZCfHD/v86x k74/o4i37Q1fzr2rx8o/EzaULh5SKP1PdG1F/HEyh+MQEXFJtg1sN74V5/18lCfOxj7rea a7ftl1bLu6x8Qji34Q0oCrc/uX24E/U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1765461040; 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=Md70lDf8i7JP0njDRYBxlbElJlkPUyzbiGw21VnKd10=; b=SCRiCZz2t14xDYIy97uFSsPo60DwacWuBn3a8JW9rRZL/6abrUBPCnAIHdbZ7el+SjBCSP zfOBVcdYVHBmdZAg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1765461039; 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=Md70lDf8i7JP0njDRYBxlbElJlkPUyzbiGw21VnKd10=; b=a9ulGEBaVhwQrmsSuEaZ+5ECrPOSRkxy8OO8zibCOZpK8M0od4IZ8B97DcdXWSPRZseYjd GVVn5SJgcm6ycgRN1WcEdzYLTsFiwxtzwUU7B7rb16tQyiK8bjXRMqcKt/FOG0fOJHTE60 /Hm+vrS9SNx+Cvwch/iEEoVem2YS41Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1765461039; 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=Md70lDf8i7JP0njDRYBxlbElJlkPUyzbiGw21VnKd10=; b=C5BjK6OJFxSmpDWYj1QVYx7sSutcaABSIc67fva12oEPhb0viVWvGLyZ0W1StF4T4NlvMU zzGSqbYQH25IPCBg== 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 5A78E3EA63; Thu, 11 Dec 2025 13:50:39 +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 WRnEFC/MOmnUbgAAD6G6ig (envelope-from ); Thu, 11 Dec 2025 13:50:39 +0000 Message-ID: <26a07334-4e4e-41ff-875b-b13e88cb339a@suse.de> Date: Thu, 11 Dec 2025 14:50:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.base/inline-frame-cycle-unwind.exp for s390x To: Simon Marchi , Kevin Buettner , gdb-patches@sourceware.org References: <20251102044651.502973-1-kevinb@redhat.com> <20251208125338.02cc248e@f41-zbm-amd> <0a18d3d7-8687-43cf-9598-90ab52af86bd@simark.ca> Content-Language: en-US From: Tom de Vries In-Reply-To: <0a18d3d7-8687-43cf-9598-90ab52af86bd@simark.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.28 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.18)[-0.885]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[gdb.base:url, suse.de:mid, sourceware.org: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/9/25 8:53 PM, Simon Marchi wrote: > 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. > After playing around with printf debugging the test-case on s390x-linux and x86_64-linux side by side, my understanding is that the test-case fails because it doesn't manage to correctly calculate frame-ids for s390x, which can easily be fixed by using "maint print frame-id". I've got a proposal for an alternative patch ( https://sourceware.org/pipermail/gdb-patches/2025-December/223355.html ). Thanks, - Tom > 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