From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Brooks Newsgroups: gmane.emacs.devel Subject: Re: How to get crash dump and consequently debug? Date: Tue, 01 Dec 2020 21:40:24 -0800 Message-ID: <87h7p4ix4n.fsf@db48x.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23087"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: Emacs Developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 02 06:42:26 2020 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 1kkKuF-0005sQ-IG for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 06:42:23 +0100 Original-Received: from localhost ([::1]:52646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkKuE-0005ux-JZ for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 00:42:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkKsd-000538-4A for emacs-devel@gnu.org; Wed, 02 Dec 2020 00:40:43 -0500 Original-Received: from smtp-out-4.mxes.net ([198.205.123.69]:57408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkKsY-0003El-NB for emacs-devel@gnu.org; Wed, 02 Dec 2020 00:40:42 -0500 Original-Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 7536775981 for ; Wed, 2 Dec 2020 00:40:25 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxes.net; s=mta; t=1606887625; bh=Fq6ecCqxUj0lBIfTtOtolpr604bnLgEvKuArWOCOn8M=; h=From:To:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=MWEschWqWX43qTb/7/oqSnU0v2dP8H4fxPp0qTm/C7cc+nAlDgOuA24338/Gbb0fe 0HpV0OLqW0LWiOIGU1hKno03itn5mkXUt1//icDVeEK3nwMzSlKH/zOJ/Of0pYdE81 KZzoBVKp6tqVTyEVMul5YeOKxbY139llDE++Ln9k= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGOfPtRkwAAABJQ TFRFpKfbdou67PD6JjJgAwUWXGSeIcyLHgAAAkZJREFUOI1VU8Fy6yAMxLi+Q13fCZ3cnQL3dqTc 7RD+/1feStDXVnXHDuvVSivZTMba2GPdw3gyCGcMAFxTyrTd9dwGoxHiZX9PmRFUHYAQlGGtXY+F Uk0SJOxgJiUEnH1qkitT9D+pQub7qGAmUbR6bu3CvI96Yv6QqkBBMrsyfZccr1/RDXGDTLf4P7ZY glVxe2V+/ACXWO1gvDO9/gDRpFFVmPluvLcmBjd5H6d8DEte+Pbk4rcY/Fa5tLKLOtCZsuQKYhpa LOkYDT7hESya7/WIET3lfQBqX0pwFtbI832Is0ayMUR9B+12xjgPCQ089cfwkCkX6L5TPmRelJTh zMS0Sz1PyjLAMCUWjcmgQLWQMds+e3aaauZDf9dU9A2/8kPVF2odCUoMKHkfjJR+mbgC+DRiycw5 3XSqGe6HmhN/AWjHypkAXOAFW5EiuA1ge2GiZuMb0s1fSEXcATeLUfbyEY2L8yPOmdSsdghQXx3K pz2eoeXuYvMCINVFDrCdNfVUp4eJ6cSEbjbgFjBEvonGGTrgv9cHjAc8aVgSAPoxaONbzfwhDIhR at7IIS7fAGiDSwIA9alhhTBzfA7YM2FY6eMwayrIGK8FDFmshmUA43WqhFtpvoqG9HHaJ7fqtgTz 8EWVkgZgtsylFliHDgk0MB7KAEC45C/rgnGvanNLXyzOeTzcT2nw/N44gfrtYXRQLoz9Q3TgmJRx 2Mx/Q51qzpm+l3m8z2SWBqC5+PZXAtNYlGFf/gKfHfjFkDT4x7od7R+w3Ls+ZdQBuQAAAABJRU5E rkJggg== In-Reply-To: (Pankaj Jangid's message of "Wed, 02 Dec 2020 08:57:48 +0530") X-Sent-To: Received-SPF: none client-ip=198.205.123.69; envelope-from=db48x@db48x.net; helo=smtp-out-4.mxes.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:260170 Archived-At: Pankaj Jangid writes: > Yesterday, my emacs crashed when I was doing M-$ i.e. ispell-word. But I > could not reproduce it using any sequence of steps. > > My question is: how to approach in this case? More specifically, how to g= et a > core-dump and subsequently debug emacs using it. Is there a small > tutorial of some kind on this topic? You don't say, so I'll just assume that you're using Linux. Most Linux distributions don't keep core dumps by default, so probably don't have a core file to debug with. If you had thought to enable core dumps, then you can use it with GDB by specifying the file name on the command line: gdb [options] [executable-file [core-file or process-id]] If your Linux distribution uses systemd, then you can also debug core dumps using coredumpctl; it just launches GDB for you: coredumpctl debug [MATCHES=E2=80=A6] If you don't have a core dump, then you do need to find a way to reproduce the bug. Normally you would have to find accurate steps to reproduce so that you could reproduce the problem reliably while running Emacs inside the debugger, but there is another way. You could install rr (rr-project.org), an open-source program for recording the execution of other programs. If you use it to record all of your Emacs sessions, then you can use it to debug those crashes without needing to know how to reproduce the problem. Any recordings that don't capture a crash can be discarded. Where a core file contains the state of the program at the moment of a crash, an rr recording contains the entire state of the program, from start to finish. You can replay the complete execution of the program from start to finish, or run it backwards to reach an earlier point in time. This enables you to track problems backwards from the site of the crash to real origin of the problem. This is particularly useful in cases of data corruption, or when one action sets up some code that runs later for a fall. db48x