emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help please! To track down GC trying to free an already freed object


From: Alan Mackenzie
Subject: Re: Help please! To track down GC trying to free an already freed object.
Date: Thu, 4 Apr 2019 18:57:55 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

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 <address@hidden>
> > Cc: address@hidden

> > 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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]