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: Fri, 5 Apr 2019 08:26:52 +0000 Message-ID: <20190405082652.GA4208@ACM> References: <20190402112537.GA6212@ACM> <20190402202412.GA25792@ACM> <4a2df4442b4acf2eb2dabd3c2c4227c5.squirrel@dancol.org> <20190402210013.GD25792@ACM> <87bm1l6oq5.fsf@gmail.com> 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="231360"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Daniel Colascione , emacs-devel@gnu.org To: Alex Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 05 10:28:39 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 1hCKDG-000y4s-Js for ged-emacs-devel@m.gmane.org; Fri, 05 Apr 2019 10:28:38 +0200 Original-Received: from localhost ([127.0.0.1]:38025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCKDF-00086k-HZ for ged-emacs-devel@m.gmane.org; Fri, 05 Apr 2019 04:28:37 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCKCb-00086O-IQ for emacs-devel@gnu.org; Fri, 05 Apr 2019 04:27:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hCKCZ-0001va-1r for emacs-devel@gnu.org; Fri, 05 Apr 2019 04:27:57 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:43160 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hCKBe-0008Ak-GT for emacs-devel@gnu.org; Fri, 05 Apr 2019 04:27:54 -0400 Original-Received: (qmail 77288 invoked by uid 3782); 5 Apr 2019 08:26:53 -0000 Original-Received: from acm.muc.de (p4FE15E79.dip0.t-ipconnect.de [79.225.94.121]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 05 Apr 2019 10:26:52 +0200 Original-Received: (qmail 4252 invoked by uid 1000); 5 Apr 2019 08:26:52 -0000 Content-Disposition: inline In-Reply-To: <87bm1l6oq5.fsf@gmail.com> 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:234968 Archived-At: Hello, Alex. On Thu, Apr 04, 2019 at 22:49:22 -0600, Alex wrote: > Alan Mackenzie writes: > > On Tue, Apr 02, 2019 at 13:33:02 -0700, Daniel Colascione wrote: > >> 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. > I apologize if this topic already reached its conclusion, but IMO > having eq return true for two different object types is quite > surprising behaviour. We are comparing two symbols, both of which are 'foo, but one of which is annotated with its position in a source file. The two symbols are the same symbol. I understand the reaction to the idea, though. Even though the representation of these two objects is different, conceptually they are the same object. But consider: on a make bootstrap I did last night, there were 332 warning messages from the byte compiler. Of these, only 80 gave the correct line/column position, the other 252 being wrong. There have been several bug reports from users complaining about such false positions. This is what I'm trying to fix. > Is it out of the question to leave eq alone and introduce, e.g., > eq-excluding-position that strips possible positions before comparison? It is, rather. To implement this would involve rewriting everything which calls eq and is used by the byte compiler, to call eq-excluding-position instead. These functions would need to exist in two versions. There are rather a lot of functions which use eq. ;-) My actual strategy is to have two versions of each C primitive used by the byte compiler, and to switch over to the "symbol-with-position" version at the start of the byte compiler. -- Alan Mackenzie (Nuremberg, Germany).