GNU bug report logs - #74966
31.0.50; Crash report (using igc on macOS)

Previous Next

Package: emacs;

Reported by: Sean Devlin <spd <at> toadstyle.org>

Date: Thu, 19 Dec 2024 09:19:02 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


Message #107 received at 74966 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: spd <at> toadstyle.org, Eli Zaretskii <eliz <at> gnu.org>, acorallo <at> gnu.org,
 pipcet <at> protonmail.com, 74966 <at> debbugs.gnu.org
Subject: Re: bug#74966: 31.0.50; Crash report (using igc on macOS)
Date: Fri, 20 Dec 2024 11:17:24 -0500
>> Maybe the problem is in store_doc_string (doc.c:469 here), not sure.
>> That function does
>>
>>   if (SUBRP (fun))
>>     XSUBR (fun)->doc = offset;

Sounds right.

> That seems to be the cause, indeed. When I 
>
> 1 file changed, 4 insertions(+), 1 deletion(-)
> src/doc.c | 5 ++++-
>
> modified   src/doc.c
> @@ -479,7 +479,10 @@ store_function_docstring (Lisp_Object obj, EMACS_INT offset)
>      fun = XCDR (fun);
>    /* Lisp_Subrs have a slot for it.  */
>    if (SUBRP (fun))
> -    XSUBR (fun)->doc = offset;
> +    {
> +      if (!NATIVE_COMP_FUNCTIONP (fun))
> +	XSUBR (fun)->doc = offset;
> +    }
>    else if (CLOSUREP (fun))
>      {
>        /* This bytecode object must have a slot for the docstring, since
>
> I don't get the assert anymore.

`offset` here should be fixnum that gives the position of this docstring
in the DOC file.  And FUN should be a function for which we found
a DEFUN in one of the C files.  So in general it should be
a `primitive-function`.  We have a few undesirable cases where
a function is defined in C code for some platforms and in ELisp for
others, which is why there's the `CLOSUREP (fun)` branch

If those rare CLOSUREs get native-compiled, then we'll use the SUBRP
branch, of course, but I have no idea why that would lead to a crash.
We're talking about a fixnum so that's usually quite safe w.r.t GC
and crashes.


        Stefan





This bug report was last modified 130 days ago.

Previous Next


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