From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Help please! To track down GC trying to free an already freed object. Date: Wed, 3 Apr 2019 10:01:13 +0000 Message-ID: <20190403100113.GA11372@ACM> References: <20190402112537.GA6212@ACM> <835zrwfc21.fsf@gnu.org> <20190402204653.GC25792@ACM> <831s2jg0s8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="213958"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: dancol@dancol.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 03 12:02:07 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBcic-000tQu-SY for ged-emacs-devel@m.gmane.org; Wed, 03 Apr 2019 12:02:06 +0200 Original-Received: from localhost ([127.0.0.1]:48045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBcib-0006Xd-Os for ged-emacs-devel@m.gmane.org; Wed, 03 Apr 2019 06:02:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBchs-0006WY-EQ for emacs-devel@gnu.org; Wed, 03 Apr 2019 06:01:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBchr-0004Oe-5k for emacs-devel@gnu.org; Wed, 03 Apr 2019 06:01:20 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:19193 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hBchp-00045n-Kd for emacs-devel@gnu.org; Wed, 03 Apr 2019 06:01:19 -0400 Original-Received: (qmail 49616 invoked by uid 3782); 3 Apr 2019 10:01:14 -0000 Original-Received: from acm.muc.de (p4FE15E5C.dip0.t-ipconnect.de [79.225.94.92]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 03 Apr 2019 12:01:13 +0200 Original-Received: (qmail 11462 invoked by uid 1000); 3 Apr 2019 10:01:13 -0000 Content-Disposition: inline In-Reply-To: <831s2jg0s8.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234915 Archived-At: Hello, Eli. On Wed, Apr 03, 2019 at 07:39:35 +0300, Eli Zaretskii wrote: > > Date: Tue, 2 Apr 2019 20:46:53 +0000 > > From: Alan Mackenzie > > Cc: Daniel Colascione , emacs-devel@gnu.org > > > GDB supports reverse execution as well, on some platforms. > > On my GNU/Linux system, I tried to run 'reverse-next', and got the error > > message: > > Target multi-thread does not support this command. > I think you are supposed to record the execution, and then say > (gdb) target record-core > or > (gdb) target record-btrace > before the reverse execution is available. Yes. I thought there was something missing. ;-) There's no mention of such recording in the GDB manual's "Reverse Execution" page, nor any cross reference to "Process Record and Replay" there. I'll try again and see if I can get it working. > But I was always able to debug GC problems by using last_marked array. The problem I think I'm up against is that the symbol-with-pos object is not being marked at a particular garbage_collect_1, and thus gets freed prematurely. I intend to get the hex values of the Lisp_Objects which constitute the list in which the symbol-with-pos is embedded and search for these in last_marked. Putting a conditional breakpoint on Fcons slows down Emacs somewhat. ;-) -- Alan Mackenzie (Nuremberg, Germany).