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: Gregor Zattler <[email-masked]>
Date: Sat, 20 Jan 2024 21:18:05 +0100

Hi Eli, Emacs developers,
* Gregor Zattler <[email-masked]> [2024-01-18; 09:52 +01]:
> * Eli Zaretskii <[email-masked]> [2024-01-18; 08:13 +02]:
>> 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,
>
> the last lines wihtout -j are:
>
> 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

In case that helps, I bisected this issue and got the
following result:

d3cefd3e98354929d96c9396e5920e8a123784dc is the first bad commit                                                                                                                               commit d3cefd3e98354929d96c9396e5920e8a123784dc
Author: Mattias Engdegård <[email-masked]>
Date:   Sat Nov 4 16:34:09 2023 +0100

    Leaner hash table dumping and thawing

    Only dump the actual data, and the test encoded as an enum.  This
    simplifies dumping, makes dump files smaller and saves space at run
    time.
    
    * src/lisp.h (hash_table_std_test_t): New enum.
    (struct Lisp_Hash_Table): Add frozen_test member, consuming no extra space.
    * src/fns.c (hashfn_user_defined): Now static.
    (hash_table_test_from_std): New.
    (hash_table_rehash): Rename to...
    (hash_table_thaw): ...this and rewrite.
    * src/pdumper.c (hash_table_contents): Only include actual data, not
    unused space.
    (hash_table_std_test): New.
    (hash_table_freeze): Set frozen_test from test.
    (dump_hash_table): Dump frozen_test, not the whole test struct.
    Don't bother other dumping fields that can be derived.
 
 src/fns.c     | 53 ++++++++++++++++++++++++++++++-------------------
 src/lisp.h    | 12 ++++++++++--
 src/pdumper.c | 63 +++++++++++++++++++++++++----------------------------------

Don't know if it's really related, though.

Regards, Gregor