From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oIbyIyiqE2lKazcAWB0awg (envelope-from ) for ; Tue, 11 Nov 2025 16:27:04 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Tpe/cXm+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 769C91E0B8; Tue, 11 Nov 2025 16:27:04 -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.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,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 server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 E26961E04C for ; Tue, 11 Nov 2025 16:27:03 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87E233858D20 for ; Tue, 11 Nov 2025 21:27:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87E233858D20 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Tpe/cXm+ Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id ACF0A3858D20 for ; Tue, 11 Nov 2025 21:26:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACF0A3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ACF0A3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762896364; cv=none; b=cRTJq+OjiNyeVIgdfae9LtpwUKit19AYblGhgTHseYaxqD90j0LUh9O2I1odcDLcqgPctJvwyJmUeuUlXyVqew+dSLYRkt2QFx535g6MaUMGgmaVsoMI+kSBeIsaszTfN4kWXhFHYFURXL2hYjH/XDV2Gn7ntQQ4enV7i/yUoRQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762896364; c=relaxed/simple; bh=HF7QVTzTsBukycNpXrJTiM/xSz6T1sp8eDqxuJWbFlk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vfxM2Mg8pSScjHIaBMFf4/ZaK55E/pOXRbwXLJx0USKMSR4qU+xGprRO+PU4CpR7Zl+xQ5sNMSBOOPZZmsDe3Z0E9VU+lnYezX49y47X6zZdxbeI7Bom6rWm1t+/42peaZ7wReX011kx5GJ5dXnC7gDtr2o7fiIw8CEHG/pcl8o= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACF0A3858D20 Received: from eig-obgw-5003b.ext.cloudfilter.net ([10.0.29.155]) by cmsmtp with ESMTPS id IoujvIz2HVCBNIvsJv0pc9; Tue, 11 Nov 2025 21:26:03 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id IvsIv4dXkuWNOIvsJvGmwp; Tue, 11 Nov 2025 21:26:03 +0000 X-Authority-Analysis: v=2.4 cv=N+gpF39B c=1 sm=1 tr=0 ts=6913a9eb a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=6UeiqGixMTsA:10 a=ItBw4LHWJt0A:10 a=CCpqsmhAAAAA:8 a=VdfU5s0bQndfwaPoNz0A:9 a=ul9cdbp4aOFLsgKbc677:22 a=VS4QxaUSPT0UtbFnIvSC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zFzdwlINErqvoDpfRE1AIpXLBLoQU8U+Pq2rautMdVk=; b=Tpe/cXm+9EfmdAG1efM4uQ9/p2 RmOrFUKequacKlUX5rJddV1DPvysfUbMwHK/aZQ/9iRFif99KvFk9Pq/5UIQaw9gIn7GyriCUQ64E VvmnRwuAlms8oHOoffJJEMwMf; Received: from 97-122-120-205.hlrn.qwest.net ([97.122.120.205]:36014 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vIvsI-00000003CkM-32bM; Tue, 11 Nov 2025 14:26:02 -0700 From: Tom Tromey To: K via Gdb Cc: K Subject: Re: GDB-JIT: why would my 'unwind' not be invoked on crash? In-Reply-To: (K. via Gdb's message of "Tue, 11 Nov 2025 22:43:45 +0100") References: X-Attribution: Tom Date: Tue, 11 Nov 2025 14:26:01 -0700 Message-ID: <87ikfgxnva.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.120.205 X-Source-L: No X-Exim-ID: 1vIvsI-00000003CkM-32bM X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-120-205.hlrn.qwest.net (bapiya) [97.122.120.205]:36014 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHP5dY6fqDWV/JcRSYzVwQ6554hNVSjHO6iX4y+iiTybntkf+I7XDiGrcASXKzsr9S6YxoaBe5LG/xF68tnNJ8hJ/WYjd09IYEBVrNUWoc90pba2PMmc eTtPQ99pRROOt8TTWwmoVIOFfAZza5o44nr8YpjBG4s/ZFpwxTcd2o3DI1jis18RBrzWINUCZuiLbQ== X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" >>>>> K via Gdb writes: > I implemented this for the x86-64 build of my ocaml program and it works > fine. > I'm now working on a aarch64 version - the symtable/line and serde code is > the same, and I'm looking to complete the unwind functionality by > disovering how to obtain the PC (not in a general register). However, after > arranging for a segfault > the unwind function is not being invoked at first and I get 2 backtrace > listings > with appropriate function name and line numbers, and only then does gdb > decide to call my unwind function and it does so with garbage data. > This is understandable to the extent gdb doesn't know the ocaml stack usage. > But if that's true, why would it proceed to generate 2 lines of backtrace > before > consulting my unwinder to gather the correct data? > My expectation is it would consult my unwinder immediately. Could you say more about what exactly you're doing? Like are you writing an unwinder in gdb? Or writing one in Python? If so, what prompted this as opposed to using the existing unwinders? Like, does your compiler not generate DWARF unwind information? (If not why not, etc.) Anyway, there's no easy way to answer your question. Unwinding in gdb is complicated. You could try to enable frame debugging ("set debug frame 1") and see it says anything interesting. I think it at least mentions which unwinders it tries. Personally I guess if I was in your spot, I'd end up debugging the unwinding code in gdb. If I had to guess, your unwinder is ending up after one of the built-in ones, and one of those thinks it knows how to unwind the frame... which could even be kind of true, one of the difficulties in writing one is knowing when it ought to give up. Tom