Subject: bug#68690: Segmentation fault building with native-comp

From: Stefan Monnier <[email-masked]>
Date: Wed, 24 Jan 2024 18:59:44 -0500

> The build now crashes here (this is a 32-bit build with large ints):
>
>   '../src/bootstrap-emacs.exe' -batch --no-site-file --no-site-lisp --eval "(setq load-prefer-newer t byte-compile-warnings 'all)"  --eval "(setq org--inhibit-version-check t)"  \
> 	  -l bytecomp -f byte-compile-refresh-preloaded \
> 	  -f batch-byte-compile ../lisp/mwheel.el
>
>   lisp.h:1784: Emacs fatal error: assertion failed: VECTORLIKEP (a)
>
> Here's the backtrace from GDB:
>
>   lisp.h:1784: Emacs fatal error: assertion failed: VECTORLIKEP (a)
>
>   Thread 1 hit Breakpoint 1, terminate_due_to_signal (sig=22,
>       backtrace_limit=2147483647) at emacs.c:442
>   442       signal (sig, SIG_DFL);
>   (gdb) bt
>   #0  terminate_due_to_signal (sig=22, backtrace_limit=2147483647) at emacs.c:442
>   #1  0x00772401 in die (msg=0xddc80d <b_fwd+233> "VECTORLIKEP (a)",
>       file=0xddc740 <b_fwd+28> "lisp.h", line=1784) at alloc.c:8062
>   #2  0x00626a44 in XVECTOR (a=XIL(0x92348b000000000)) at lisp.h:1784
>   #3  0x00626ace in gc_asize (array=XIL(0x92348b000000000)) at lisp.h:1800
>   #4  0x00626bba in AREF (array=XIL(0x92348b000000000), idx=1) at lisp.h:1971
>   #5  0x0063174d in Fcharset_after (pos=make_fixnum(113)) at charset.c:2084

Hmm... I can't reproduce it here (even with native-comp and
`--with-wide-int`).  The above stack frame suggests it might be related
to commit 33b8d5b6c5a (and hence unrelated to the original bug#68690
which was a bug in `DOHASH`).

Any chance you can investigate what is this `0x92348b000000000`?
It should be a charset's attributes and the "idx=1" is because
we're using `CHARSET_ATTR_NAME` to extract the name.

        Stefan