all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Daniel Colascione <dancol@dancol.org>
Cc: emacs-devel@gnu.org
Subject: Re: Help please! To track down GC trying to free an already freed object.
Date: Tue, 2 Apr 2019 20:24:12 +0000	[thread overview]
Message-ID: <20190402202412.GA25792@ACM> (raw)
In-Reply-To: <d84308e78b64f3e97edf61aca82af50c.squirrel@dancol.org>

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.

These symbols with position are implemented as pseudovectors with type
PVEC_SYMBOL_WITH_POS and behave as ordinary symbols for all purposes,
except for when a warning message is being output, when the postion
supplies a correct file/line number for the message.

This works and works well.  However it causes an unacceptable slowdown in
Emacs (around 8 - 15 per cent).  I'm working on a fix for this, and have
made substantial progress.

The topic was discussed at length in emacs-devel starting November last
year in posts whose Subject: contained "scratch/accurate-warning-pos".

-- 
Alan Mackenzie (Nuremberg, Germany).



  parent reply	other threads:[~2019-04-02 20:24 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=20190402202412.GA25792@ACM \
    --to=acm@muc.de \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.