Subject: Re: bug#75459: 31.0.50; scratch-igc: Breakpoint 1, terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=2147483647) at ./src/emacs.c:432

From: Gerd Möllmann <[email-masked]>
Date: Fri, 10 Jan 2025 16:27:53 +0100

Pip Cet <[email-masked]> writes:

> (root_frame () can return a NULL pointer in some contexts, but not in
> this one, so this is, at best, a *potential* null pointer dereference,
> or a suggested additional assertion.  A "null pointer dereference"
> without a "potential" is reserved for code paths which can be proven
> to dereference a null pointer, not for code paths which cannot be proven
> not to.  So this is a GCC bug.)

Okay. I think Eli had something similar, some months ago.

> Still investigating the others, but:
>
> In file included from json.c:31:
> igc.h:88:7: warning: redundant redeclaration of ‘igc_xnmalloc_ambig’ [-Wredundant-decls]
>    88 | void *igc_xnmalloc_ambig (ptrdiff_t nitems, ptrdiff_t item_size);
>       |       ^~~~~~~~~~~~~~~~~~
> In file included from json.c:28:
> lisp.h:6117:14: note: previous declaration of ‘igc_xnmalloc_ambig’ with type ‘void *(ptrdiff_t,  ptrdiff_t)’ {aka ‘void *(long int,  long int)’}
>  6117 | extern void *igc_xnmalloc_ambig (ptrdiff_t nitems, ptrdiff_t item_size);
>       |              ^~~~~~~~~~~~~~~~~~
> igc.h:90:6: warning: redundant redeclaration of ‘igc_xfree’ [-Wredundant-decls]
>    90 | void igc_xfree (void *p);
>       |      ^~~~~~~~~
> lisp.h:6118:13: note: previous declaration of ‘igc_xfree’ with type ‘void(void *)’
>  6118 | extern void igc_xfree (void *p);
>       |             ^~~~~~~~~
>
> seems annoying, but avoidable.
>
> I'll push a "fix", but I wanted to explain why first: new useless GCC
> warnings force us to do that.

Thanks for the explanation.