From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Help please! To track down GC trying to free an already freed object. Date: Tue, 02 Apr 2019 18:04:22 +0300 Message-ID: <83r2akfnyh.fsf@gnu.org> References: <20190402112537.GA6212@ACM> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="44695"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 02 17:04:19 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 1hBKxX-000BSg-3H for ged-emacs-devel@m.gmane.org; Tue, 02 Apr 2019 17:04:19 +0200 Original-Received: from localhost ([127.0.0.1]:56019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBKxV-0006cU-Th for ged-emacs-devel@m.gmane.org; Tue, 02 Apr 2019 11:04:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBKxP-0006cP-FK for emacs-devel@gnu.org; Tue, 02 Apr 2019 11:04:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBKxO-0008Lw-LL; Tue, 02 Apr 2019 11:04:10 -0400 Original-Received: from [176.228.60.248] (port=1557 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hBKxO-0004Sp-6h; Tue, 02 Apr 2019 11:04:10 -0400 In-reply-to: <20190402112537.GA6212@ACM> (message from Alan Mackenzie on Tue, 2 Apr 2019 11:25:37 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:234870 Archived-At: > Date: Tue, 2 Apr 2019 11:25:37 +0000 > From: Alan Mackenzie > > With GDB, I can break at the creation of this symbol-with-position > object and again at its (first) freeing with this breakpoint: > > break setup_on_free_list if (v == 0x5555561d0450) > > . However, this isn't helping me to track down the Lisp object which > still references this symbol-with-position. I've tried to find the > address of Emacs's data segment, so as to be able to search through it > for 0x5555561d0455 in GDB, but this doesn't feel like a very useful > thing to do. > > Could somebody who has experience in this sort of thing please suggest > how I might proceed with the debugging, or possibly offer me some other > sort of help or hints. The usual method of debugging such problems is described in etc/DEBUG, it basically uses the last_marked[] array. You start with the object at last_marked[last_marked_index - 1], and go backwards (in circular manner), comparing the objects you find in the array with those you see in the call-stack frames that call mark_* functions. Just be very careful when you print the objects; e.g., never use 'pp', because the function it calls cannot handle marked objects. If you already tried this, please ask more specific questions.