From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Help please! To track down GC trying to free an already freed object.
Date: Thu, 4 Apr 2019 18:57:55 +0000 [thread overview]
Message-ID: <20190404185755.GB6417@ACM> (raw)
In-Reply-To: <83zhp7em1h.fsf@gnu.org>
Hello, Eli.
On Wed, Apr 03, 2019 at 07:43:22 +0300, Eli Zaretskii wrote:
> > Date: Tue, 2 Apr 2019 20:42:37 +0000
> > From: Alan Mackenzie <acm@muc.de>
> > Cc: emacs-devel@gnu.org
> > I'm having some difficult seeing the entire last_marked array with GDB.
> > I will try to find a solution in the GDB manual.
> You want "set print elements unlimited", I think.
> However, my recommendation is to examine the array one element at a
> time, moving back to the previous one only when you understand what
> the element you've looked at is and whether it is or isn't related to
> the problem. Also, last_marked array is written cyclically, so you
> may need to wrap around the index to see the objects in the right
> order.
I've found the bug.
In the garbage collection, it's necessary for Qsymbols_with_pos_enabled
to be bound to nil. (That's the variable which enables symbols with
position).
I had bound that variable to nil in Fgarbage_collect, not noticing that
there are calls to the C function garbage_collect which bypass the
primitive. This was the bug.
As a result, the pseudovector (Symbol "nil" at position 339) was caught
by a NILP, causing it not to get marked. So it got swept away, even
though it was still live.
So I've spent several days on this, but as a consolation I now know GDB
much better than I did before. ;-). My branch now builds successfully.
Thanks for all the help!
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2019-04-04 18:57 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 [this message]
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
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=20190404185755.GB6417@ACM \
--to=acm@muc.de \
--cc=eliz@gnu.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.