Subject: Re: bug#75477: 31.0.50; scratch/igc: crash on the latest commit

From: Pip Cet <[email-masked]>
Date: Fri, 10 Jan 2025 16:23:23 +0000

Pip Cet <[email-masked]> writes:

> "Ihor Radchenko" <[email-masked]> writes:
>
>> Gerd Möllmann <[email-masked]> writes:
>>
>>> Don't know if that helps, but M-x igc-root-stats can be used to display
>>> information about known roots. Maybe one can see there if the number of
>>> roots increases over time, which would indicate if there is something
>>> like a "root leak", for example by using xfree instead of igc_xfree.
>>
>> I noticed that creating a new frame took longer and longer over time
>> recently. Up to a dozen of seconds.
>
> Thanks! Trying to reproduce that here with:
>
> ./src/emacs -Q --eval '(run-with-timer 1.0 1.0 (lambda () (delete-frame (make-frame))))'
>
> indicates 8 xzalloc-ambig roots apparently leaked per frame created
> (after the fix I just pushed).  Ouch.  Even if we xfree() those, that's
> a great number of heap words incorrectly declared to be ambiguous roots,
> which may hide other bugs.
>
> No apparent leak with --with-x-toolkit=no, so we know where to look.

Or not.  It's down to one leak/frame now, which is still bad, but I
thought I'd push the partial fix for now.  If the latest commit causes
abort()s, please consider reporting them rather than simply reverting
the commit :-)

Pip