GNU bug report logs - #76091
31.0.50; festure/igc: buffer.h:829: Emacs fatal error: assertion failed: BUFFERP (a)

Previous Next

Package: emacs;

Reported by: Gregor Zattler <telegraph <at> gmx.net>

Date: Thu, 6 Feb 2025 12:51:01 UTC

Severity: normal

Found in version 31.0.50

Done: Pip Cet <pipcet <at> protonmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: 76091 <at> debbugs.gnu.org, Gregor Zattler <telegraph <at> gmx.net>, Helmut Eller <eller.helmut <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#76091: 31.0.50; festure/igc: buffer.h:829: Emacs fatal error: assertion failed: BUFFERP (a)
Date: Fri, 7 Feb 2025 17:16:07 +0100
On 7. Feb 2025, at 17:07, Pip Cet <pipcet <at> protonmail.com> wrote:
> 
> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
> 
>> Pip Cet <pipcet <at> protonmail.com> writes:
>> 
>>> Well, here it is:
>> 
>> IIUC, that fixes the problem with igc_on_grow_specpdl as part of a
>> grander effort that avoids parking the arena in more cases.
> 
> My assumption was the other root resizing methods would have similar
> issues, yes.  I'm not sure this is true, but why risk it?

Yes, true. 

> 
>> (I'd naively just written a new igc_xpalloc_specpdl patterned after the
>> existing igc_xpalloc_exectly and ambig variants, but I'm also lazy :-).)
> 
> Laziness is a virtue for hackers :-)
> 
>> Hard to review. Did you take this into account?
> 
> Well, yes.  I'll split it up into individual patches, so we can review
> them one by one?

Not necessary, but thanks. 

> 
>> igc.c:
>> 3240   /* Can't make a root that has zero length.  Want one to be able to
>> 3241      detect calling igc_free on something not having a root.  */
>> 3242   void *end = (char *) p + size;
>> 3243   if (end == p)
>> 3244     end = (char *) p + IGC_ALIGN_DFLT;
>> 3245   root_create_ambig (global_igc, p, end, "xzalloc-ambig");
> 
> Ugh.  No, I didn't.  Need to fix igc_realloc_ambig (also, it doesn't
> handle the "shrinking" case correctly, oops.  However, there appear to
> be no callers of igc_realloc_ambig that expect the root to shrink,
> whew).
> 
> As for that code, is it really necessary to lie about this case?  Can't
> we simply force size to be >= IGC_ALIGN_DFLT when making the allocation?
> 

We could do that. I did it only that way because it was easy and unproblematic at that time.





This bug report was last modified 102 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.