Subject: bug#68557: 30.0.50; "--enable-checking=yes,glyphs" leads to "alloc.c:3446: Emacs fatal error: assertion failed: h->index_size > 1"

From: Eli Zaretskii <[email-masked]>
Date: Thu, 18 Jan 2024 08:13:30 +0200

> Date: Thu, 18 Jan 2024 00:59:54 +0100
> From:  Gregor Zattler via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Dear Emacs developers, building the Emacs master branch
> as of commit 5f5faad249747ce5bd4b7f2968f737206c136265
> on an up-to-date debian bookworm system fails if
> configured with --enable-checking=yes,glyphs
> 
> The build works, if configured without --enable-checking=yes,glyphs.
> 
> The build was done with a fresh checkout, and debian default CFLAGS etc, like so:
> 
> eval $(dpkg-buildflags --export=sh); CFLAGS="$CFLAGS -Wall"; git clean -fdx; rm -rf * ; git co -f ; ./autogen.sh && ./configure  --infodir=/usr/share/info/emacs --with-json --with-file-notification=yes --with-libsystemd --with-cairo --with-x=yes --with-x-toolkit=no  --without-toolkit-scroll-bars --without-gsettings --enable-check-lisp-object-type --enable-checking=yes,glyphs --with-native-compilation ; nice -n 20 ionice -c 3 eatmydata make V=1 NATIVE_FULL_AOT=0
> 
> This are the last lines of output of a failed build:
> 
> TZ=UTC0 touch -t 197001010000 emacs-lisp/macroexp.elc
> '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp  \
> -l comp -f batch-byte-compile emacs-lisp/cconv.el
> TZ=UTC0 touch -t 197001010000 emacs-lisp/cconv.elc
> '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp  \
> -l comp -f batch-byte-compile emacs-lisp/byte-opt.el
> TZ=UTC0 touch -t 197001010000 emacs-lisp/byte-opt.elc
> '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp  \
> -l comp -f batch-byte-compile emacs-lisp/bytecomp.el
> TZ=UTC0 touch -t 197001010000 emacs-lisp/bytecomp.elc
> '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp  \
> -l comp -f batch-byte-compile emacs-lisp/comp.el
> 
> alloc.c:3446: Emacs fatal error: assertion failed: h->index_size > 1
> make[3]: *** [Makefile:325: emacs-lisp/comp.elc] Aborted
> make[3]: Leaving directory '/home/grfz/src/my-next-emacs/lisp'
> make[2]: *** [Makefile:1017: bootstrap-emacs.pdmp] Error 2
> make[2]: Leaving directory '/home/grfz/src/my-next-emacs/src'
> make[1]: *** [Makefile:554: src] Error 2
> make[1]: Leaving directory '/home/grfz/src/my-next-emacs'
> make[1]: Entering directory '/home/grfz/src/my-next-emacs'
> ***
> *** "make all" failed with exit status 2.
> ***
> *** You could try to:
> *** - run "make bootstrap", which might fix the problem
> *** - run "make V=1", which displays the full commands invoked by make,
> ***   to further investigate the problem
> ***
> make[1]: *** [Makefile:418: advice-on-failure] Error 2
> make[1]: Leaving directory '/home/grfz/src/my-next-emacs'
> make: *** [Makefile:374: all] Error 2
> 
> I'm happy to answer questions, but as I do not know
> much about building in general, they should be specific
> and detailed.

Thanks.  Please say "make V=1" (but without -jN option that runs
several Make commands in parallel), and wait for the first command
that fails due to the above fatal error.  Then run the same command
under GDB, and when Emacs aborts and GDB kicks in, please type at the
GDB prompt:

  (gdb) thread apply all bt

and post here everything GDB outputs as result.

(Let me know if you need more detailed instructions for how to "run
the same command under GDB".)