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: Tue, 2 Apr 2019 21:00:13 +0000 Message-ID: <20190402210013.GD25792@ACM> References: <20190402112537.GA6212@ACM> <20190402202412.GA25792@ACM> <4a2df4442b4acf2eb2dabd3c2c4227c5.squirrel@dancol.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="66854"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 02 23:01: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 1hBQWx-000HBT-GE for ged-emacs-devel@m.gmane.org; Tue, 02 Apr 2019 23:01:15 +0200 Original-Received: from localhost ([127.0.0.1]:45270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBQWw-00060i-Ca for ged-emacs-devel@m.gmane.org; Tue, 02 Apr 2019 17:01:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBQW2-0005ze-7t for emacs-devel@gnu.org; Tue, 02 Apr 2019 17:00:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBQW1-0002Z6-2m for emacs-devel@gnu.org; Tue, 02 Apr 2019 17:00:18 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:62895 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hBQW0-0002UA-Lm for emacs-devel@gnu.org; Tue, 02 Apr 2019 17:00:17 -0400 Original-Received: (qmail 14213 invoked by uid 3782); 2 Apr 2019 21:00:14 -0000 Original-Received: from acm.muc.de (p4FE15EFB.dip0.t-ipconnect.de [79.225.94.251]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 02 Apr 2019 23:00:13 +0200 Original-Received: (qmail 26066 invoked by uid 1000); 2 Apr 2019 21:00:13 -0000 Content-Disposition: inline In-Reply-To: <4a2df4442b4acf2eb2dabd3c2c4227c5.squirrel@dancol.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:234903 Archived-At: Hello again, Daniel. On Tue, Apr 02, 2019 at 13:33:02 -0700, Daniel Colascione wrote: > > Hello, Daniel. > > On Tue, Apr 02, 2019 at 12:09:59 -0700, Daniel Colascione wrote: > >> > Hello, Emacs. > >> > I get this problem after a recent merge of master into > >> > /scratch/accurate-warning-pos (my branch where I'm trying to implement > >> > correct source positions in the byte compiler's warning messages). > >> This > >> > was a large merge, including bringing in the portable dumper. > >> > Emacs aborts at mark_object L+179 (in alloc.c), because a pseudovector > >> > being freed already has type PVEC_FREE, i.e. has been freed already. > >> > This object is a "symbol with position", a type of pseudovector which > >> > doesn't yet exist outside of this scratch branch. > >> Out of curiosity, why do we need a new C-level type here? > > It's to help solve a bug in the byte compiler, which up until recently > > was intractable. The byte compiler frequently (?usually) reports > > incorrect line/column numbers in its warning messages. This is due to > > the kludge it uses to keep track of them. > > The only current candidate for a fix is for the reader, on a flag being > > bound to non-nil, to return "symbols with position" rather than standard > > symbols. The "position" associated with the symbol is it's textual > > offset from the beginning of the construct in the source file being read. > So if I read symbol foo from file1.el and symbol foo from file2.el, I get > two different symbol-with-location instances, each tagged with a different > source location? Do these symbol objects compare eq to each other? They do, yes. Otherwise the byte compiler wouldn't work, as it frequently compares a symbol-with-position with a constant ("ordinary") symbol using eq. However, it is envisaged the flag symbols-with-pos-enable will be bound to non-nil only by the byte compiler. The reader resets this position to zero for each top-level form it reads. -- Alan Mackenzie (Nuremberg, Germany).