From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uDwvJatTdWmAfRMAWB0awg (envelope-from ) for ; Sat, 24 Jan 2026 18:20:11 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Y2ZEVtI4; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7F5021E089; Sat, 24 Jan 2026 18:20:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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 6E0711E089 for ; Sat, 24 Jan 2026 18:20:10 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DA3E94BA9013 for ; Sat, 24 Jan 2026 23:20:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA3E94BA9013 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Y2ZEVtI4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id E51CA4BA23D2 for ; Sat, 24 Jan 2026 23:19:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E51CA4BA23D2 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E51CA4BA23D2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769296784; cv=none; b=FLX3fXEZvvHnCjqqhEaWHP6VDWhazCBNxZWlRrK3/ogYTLKW+xhO+n0E9+ZswkI/2EHxpbTNugLf7ovHV/n3SkwHeBPVUHBA2OqN0IegBcK7V5a9bK+btOQVgmb0ecnjBcxg1d9emhiKKvwAoaPYYQ0pDbEBsCd1dJweKzpMKoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769296784; c=relaxed/simple; bh=C8/N9E3Cl9p0RqMCwViOYBnmaiGRBMlpIa5C39S25dA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=SUGhnZw9DysLR7SAwARZMxrXMF8jhTLTNuLZM3yegIeKTqvZuACM/FRMKanxcx2PHirv9T+K9OmxCFWeOvQSndDrqz/mla5e5ZSym6h5Wuxlo14GkPyw+eBWgNhG0I7pI3sva1+QEihTe1/ssjvzvqMbjgsNbCM28/RYNt6dri8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E51CA4BA23D2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769296783; h=from:from:reply-to:subject:subject: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=OACDrUhD8Dgk4oR8sINsM/017Wo5Ir4IAqwnlVMO1H0=; b=Y2ZEVtI4eaR3FbsIouPuBK/VgLiuIaBCHpRVzpCKpa1OSAAOcfzVtx5GEax45oXsU7j6g/ MPQZxYirgI5uOhzOd5dRiVJufDrfD9FtfJhYTQ7rIhIYE0q55NDK4vz+Qt1vg5RHnLnwK3 TxUPlf22uPqhdaTnt64bAA+kAvRz4ZU= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-144-UOSt5VOZNV6AnNIUpnzY3A-1; Sat, 24 Jan 2026 18:19:40 -0500 X-MC-Unique: UOSt5VOZNV6AnNIUpnzY3A-1 X-Mimecast-MFC-AGG-ID: UOSt5VOZNV6AnNIUpnzY3A_1769296779 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 169931800447; Sat, 24 Jan 2026 23:19:39 +0000 (UTC) Received: from f42-mesa-1 (unknown [10.22.64.64]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 353ED1955F66; Sat, 24 Jan 2026 23:19:38 +0000 (UTC) Date: Sat, 24 Jan 2026 16:19:35 -0700 From: Kevin Buettner To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.base/inline-frame-cycle-unwind.exp for s390x (alternative) Message-ID: <20260124161834.6c4bac92@f42-mesa-1> In-Reply-To: <20251211133946.962934-1-tdevries@suse.de> References: <20251211133946.962934-1-tdevries@suse.de> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: sgg2ML_kI4svA9Mg_7HC0Txj_FnUM5FZjZrrwKIaC0I_1769296779 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII 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 Hi Tom, On Thu, 11 Dec 2025 14:39:46 +0100 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. Thanks for looking into this. I like this approach better the one that I took - fixing the frame-id source so the test works uniformly across architectures is cleaner than adjusting expectations per architecture. One issue: I think that your patch leaves some dead code in the Python file. With stack_adjust no longer used, it seems to me that the following should be removed: 1. The variable declaration / initialization: stack_adjust = None 2. The check: if stack_adjust is None: raise gdb.GdbError("invalid stack_adjust") 3. The computation at module load time: f0 = gdb.newest_frame() f1 = f0.older() f2 = f1.older() f0_sp = f0.read_register("sp") f2_sp = f2.read_register("sp") stack_adjust = f2_sp - f0_sp Kevin