From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ysbJGiHT6mn+1zcAWB0awg (envelope-from ) for ; Thu, 23 Apr 2026 22:19:13 -0400 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=hMtPXsUd; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 59BAB1E093; Thu, 23 Apr 2026 22:19:13 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.1 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_SBL_CSS,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no 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 DD2FA1E093 for ; Thu, 23 Apr 2026 22:19:12 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 5F4774BB1C0B for ; Fri, 24 Apr 2026 02:19:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F4774BB1C0B 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=hMtPXsUd 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 1E9BF4B99F62 for ; Fri, 24 Apr 2026 02:18:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E9BF4B99F62 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 1E9BF4B99F62 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=1776997123; cv=none; b=WN5xuYmJHEx3/T8T9jPGW+sFJWuAskJgtD4iStlzbnuFuQTYyq6Fi5EZCC5kgUNBp5/v69f9Rjis66L+egAebl30iQcY+A2E+N6WFfQFCPsee0TVwXjKYumb3f2GoAF7MntJu9pI3cF3vExmr471ou7IK3MOhdgx7fMfv1B2BVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776997123; c=relaxed/simple; bh=EBUJwNvN+9kA7nJZSDEqUDGSQjuKyQznTB06KH2h2Uk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=QvIGO8Mr2NFugeyKAhWRu8fk51F/c2S3tSSZuVlra0GZWOgYUPtgaG7ClC5lC+E7krnv4uWb8Fo1sSGHE3AZPLKIS4JJB49VBy2dnoUc4Q1g6ZCXZ5cFcSpaVDxexkBr55rOcDgtLgEdCNoEGTYiIwUS7YgehDSM30lFDQbEXiU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E9BF4B99F62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776997122; 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=0bTNCGH2PkCNst40Jz9f84MXcGiza+YgJU13DeJsIz8=; b=hMtPXsUd2zsmAMahMRDRfvO94ihQGU5Bu2heXSOO/RB2cwM2/BXU1PjeqiMOaE3Oq9eVB7 jYuJlGDZKnC2URhkc0NfmGzZSQ7kEy8SRrMd/1qn9g4+bJIXrQkZtMq0Siap9VatY7oIQ3 H9hquN8OKCMnCqA8T33v2rUGloC3iko= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-308-KnEFSQDINsuohejSePaK_Q-1; Thu, 23 Apr 2026 22:18:41 -0400 X-MC-Unique: KnEFSQDINsuohejSePaK_Q-1 X-Mimecast-MFC-AGG-ID: KnEFSQDINsuohejSePaK_Q_1776997120 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8DA7019560B7; Fri, 24 Apr 2026 02:18:40 +0000 (UTC) Received: from f42-zbm-amd (unknown [10.22.80.51]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BFD09180047F; Fri, 24 Apr 2026 02:18:39 +0000 (UTC) Date: Thu, 23 Apr 2026 19:18:37 -0700 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH] gdb/dwarf: fix internal error in dwarf2_fetch_cfa_info for FDEs without a CFA rule Message-ID: <20260423191837.3e4e7ca9@f42-zbm-amd> In-Reply-To: <20260423173711.804174-1-simon.marchi@efficios.com> References: <20260423173711.804174-1-simon.marchi@efficios.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: xmGyzxmHMFaEsMPQIjBxRuN7N-eoa8F3JdT-1WhGmOw_1776997120 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 On Thu, 23 Apr 2026 13:37:06 -0400 Simon Marchi wrote: > Commit a910478f65a5 ("gdb/dwarf: fix internal error when FDEs do not > describe the CFA") fixed the switch on cfa_how in dwarf2_frame_cache, > but there is a very similar switch in dwarf2_fetch_cfa_info that has > the same issue. If the unwind info does not set a rule for the CFA, > fs.regs.cfa_how is left as CFA_UNSET and we hit the default case, > triggering an internal error. > > dwarf2_fetch_cfa_info is called from two places, both while compiling > a DWARF expression that contains DW_OP_call_frame_cfa: > > - dwarf2_compile_expr_to_ax, when compiling to agent-expression > bytecode > > - do_compile_dwarf_expr_to_c, when compiling to C source (used by > the "compile" commands). > > Unlike dwarf2_frame_cache, where we can degrade gracefully by setting > undefined_retaddr, the callers of dwarf2_fetch_cfa_info need a concrete > CFA to generate code, so we can't continue. Throw an error with the > same message used a few lines above, when the FDE itself cannot be > found. > > Extend the debug-frame-no-cfa.exp test to reproduce this case: add a > compile unit describing the "main" function and with a DW_AT_frame_base > that uses DW_OP_call_frame_cfa and a local variable "x" that uses > DW_OP_fbreg (the evaluation of which requires the CFA). Then, try to > translate the location of "x" to agent-expression bytecode with "maint" > agent. This hits the internal error without the corresponding fix. LGTM. Approved-by: Kevin Buettner