GNU bug report logs - #78824
[igc] segfault in temacs during build => charset-table

Previous Next

Package: emacs;

Reported by: Jeff Walsh <fejfighter <at> gmail.com>

Date: Wed, 18 Jun 2025 11:47:01 UTC

Severity: normal

Full log


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

From: Helmut Eller <eller.helmut <at> gmail.com>
To: Jeff Walsh <fejfighter <at> gmail.com>
Cc: Pip Cet <pipcet <at> protonmail.com>, 78824 <at> debbugs.gnu.org
Subject: Re: bug#78824: [igc] segfault in temacs during build => charset-table
Date: Wed, 18 Jun 2025 21:53:56 +0200
On Wed, Jun 18 2025, Jeff Walsh wrote:

> When building the latest of the IGC branch, commit:
> 887db2ff38ce82bb5f33aa128c76b578caba216d 
>
> I am getting a SEGFAULT during temacs execution.
>
> running under a debugger, this occurs in root_find in igc.c
> `if (r->d.start == start)` (r is null in this case)

I can reproduce this with gcc 14.2, when configured with

  ./configure -C --without-x --with-gnutls=no --with-mps=debug 'CFLAGS=-O2
  -ggdb3 -gctf -fno-omit-frame-pointer -fno-tree-sra
  -I/scratch/emacs/mps-install/include' 'LDFLAGS=-L
  /scratch/emacs/mps-install/lib'

I had to remove --enable-checking.

As Pip suspected, the problem in igc_xpalloc_lisp_objs_exact is that
memcpy is called with old == NULL.  According to [1]: The behavior is
undefined if either dest or src is an invalid or null pointer.  So I
guess that we are in nasal demon territory and the compiler assumes that
old != NULL.

Helmut

[1] https://en.cppreference.com/w/c/string/byte/memcpy




This bug report was last modified 57 days ago.

Previous Next


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