From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: gdb doesn't print Lisp backtrace in some circumstances. Date: Fri, 12 Apr 2024 16:48:24 +0200 Message-ID: References: <86pluusunr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16411"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 12 16:49:27 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rvIDX-00043x-2S for ged-emacs-devel@m.gmane-mx.org; Fri, 12 Apr 2024 16:49:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvICg-0004aX-1q; Fri, 12 Apr 2024 10:48:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvICc-0004aF-7l for emacs-devel@gnu.org; Fri, 12 Apr 2024 10:48:31 -0400 Original-Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rvICa-0007ER-Mr; Fri, 12 Apr 2024 10:48:29 -0400 Original-Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-56fffb1d14bso1011331a12.1; Fri, 12 Apr 2024 07:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712933306; x=1713538106; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=rj7Td/HOWSQljkcDS3y403Bauw6yXIA0/tb95LA/WnQ=; b=UR4WRuER0RCw4zf6eVOSPv/syuT4MBlJl5PbvVGuD+0dAZmLZ6k7P7rwXppxLfK1R3 ScPfq44jpjZ84xFIe8u8qkzebNZrf52hpu2C1m62WcOudu3XBC1Sw7I701iQfV5TAvDx SU6olPFxXJjXk7+RbEwKQDjWblx6GeK6lj0Lcm14w6z3jos38bTqrgzrg7MQg6fyI+68 WfapBZ5VpCDay7aP4Az6sy4Pxyikmu1cPkAfqyai2KaQczF7lwzQqNidODV3aWS2bzYt tjNvwcMEbAi0WXrIis7Ja17xsrYu0Uj34yZorUHMnCBQ8eRxfHZcost8iAmKSUlqoqbb fljg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712933306; x=1713538106; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rj7Td/HOWSQljkcDS3y403Bauw6yXIA0/tb95LA/WnQ=; b=rJwAGKyqrftn9KkvXr3mfnE0D0Y+h0wprrTdGu5KylYlXq91ltDNCUpmii3Hk2beoE 3gjfbir1Bwtkxy1gSCXQOJkG2qzrKRaKS6/O0CZV2T6JW3bD/StZ42LjYQPFcQDyCTRg sLiox/rE5LQ3Efg7psjmdeJncVMgJHpNsFJkWebN36gAK7+14RppgpwC3dqieM0eQRQ1 Rni2LxKe6r6kmQVyZvHUIacE/+9uACTuX4QrbKJPVT5QaM1I/uLod6Wh+qeEbWCN7Fv2 woDqoyx0iQl+Idvt11fU1/gcc7bnvLnJiBAqWIYbQgwOy/3yMhGT/CCjHX5LtMUOL7gI 263A== X-Forwarded-Encrypted: i=1; AJvYcCUFk5NmNiUpyGjSBcCiIenZU8VYTq7G7uyhaLjvwl61SS5IN0Jr6KudNsYyUjU4xPEXjr+H4JPgzOnVMUMrg9v8me4M X-Gm-Message-State: AOJu0Yz+LBjjm2dAm7maQqyFLFpHrItXfUjctF9Ij6FCxpJNfN59Bvv0 lA+tVh3PQi4mTKugDt2Uh4jMZrbajjdlhS/wkw8tQIsCDX9h+oISbZW/yA== X-Google-Smtp-Source: AGHT+IFiAEcYGAOCMmiXjQH7IzNoLszO7TlnA9Ztwo6atALsXZKyChehPPyCo1cSk9U/ehwValYhmg== X-Received: by 2002:a05:6402:f0f:b0:570:17a:b1f6 with SMTP id i15-20020a0564020f0f00b00570017ab1f6mr1303469eda.6.1712933306009; Fri, 12 Apr 2024 07:48:26 -0700 (PDT) Original-Received: from Pro.fritz.box (pd9e36b11.dip0.t-ipconnect.de. [217.227.107.17]) by smtp.gmail.com with ESMTPSA id j6-20020a50ed06000000b0056e74ebca64sm1750885eds.34.2024.04.12.07.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:48:25 -0700 (PDT) In-Reply-To: <86pluusunr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Apr 2024 14:11:04 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317695 Archived-At: Eli Zaretskii writes: >> Date: Fri, 12 Apr 2024 10:31:53 +0000 >> From: Alan Mackenzie >> >> Yesterday I got a core dump from a segmentation fault in Emacs (my >> development version, not master). I loaded this into gdb inside Emacs >> to have a look at it. >> >> The backtrace command output the C data as it should, but on coming to >> the Lisp backtrace gave an error message about there needing to be a >> process running to "do this". (I don't have the exact message any >> more.) It would seem these fancy Lisp facilities only work when the >> process that produced them is still running. > > Yes, because they call functions inside Emacs to format Lisp objects. > >> All the information required to produce this Lisp backtrace is present >> in the core dump. Would it be possible, perhaps, to modify our .gdbinit >> to use the running Emacs to process the core dump, or something like >> that? > > I don't think so, no. But you can reproduce the Lisp backtrace > manually (albeit tediously, by going over all the calls to Ffuncall, > eval_sub and suchlikes, and displaying their arg[0]. If it's a > symbol, typing xsymbol should show you the Lisp function being called. > If it is not a symbol, you could use xcar/xcdr etc., but that is much > more tedious, and I usually give up on those frames in the stack. I think it's easier to go through the specbinding stack (current_thread->m_specdl). For LLDB, I did that in the xbacktrace function in etc/emacs_lldb.py.