unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Alex <agrambot@gmail.com>
Cc: Daniel Colascione <dancol@dancol.org>, emacs-devel@gnu.org
Subject: Re: Help please! To track down GC trying to free an already freed object.
Date: Fri, 5 Apr 2019 08:26:52 +0000	[thread overview]
Message-ID: <20190405082652.GA4208@ACM> (raw)
In-Reply-To: <87bm1l6oq5.fsf@gmail.com>

Hello, Alex.

On Thu, Apr 04, 2019 at 22:49:22 -0600, Alex wrote:
> Alan Mackenzie <acm@muc.de> 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).



  reply	other threads:[~2019-04-05  8:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 11:25 Help please! To track down GC trying to free an already freed object Alan Mackenzie
2019-04-02 15:04 ` Eli Zaretskii
2019-04-02 20:42   ` Alan Mackenzie
2019-04-03  4:43     ` Eli Zaretskii
2019-04-04 18:57       ` Alan Mackenzie
2019-04-02 19:09 ` Daniel Colascione
2019-04-02 19:21   ` Eli Zaretskii
2019-04-02 20:46     ` Alan Mackenzie
2019-04-02 21:03       ` Daniel Colascione
2019-04-03  4:39       ` Eli Zaretskii
2019-04-03 10:01         ` Alan Mackenzie
2019-04-03 10:12           ` Eli Zaretskii
2019-04-03 15:23           ` Paul Eggert
2019-04-02 20:24   ` Alan Mackenzie
2019-04-02 20:33     ` Daniel Colascione
2019-04-02 21:00       ` Alan Mackenzie
2019-04-05  4:49         ` Alex
2019-04-05  8:26           ` Alan Mackenzie [this message]
2019-04-05 17:05             ` Comparing symbol-with-position using eq (was: Help please! To track down GC trying to free an already freed object.) Alex
2019-04-05 18:21               ` Comparing symbol-with-position using eq Alan Mackenzie
2019-04-05 20:18                 ` Daniel Colascione
2019-04-05 21:54                   ` Alan Mackenzie
2019-04-05 22:50                     ` Paul Eggert
2019-04-06 12:23                     ` Clément Pit-Claudel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190405082652.GA4208@ACM \
    --to=acm@muc.de \
    --cc=agrambot@gmail.com \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).