Subject: bug#77046: 31.0.50; Emacs sometimes crashes

From: Markus Triska <[email-masked]>
Date: Sat, 22 Mar 2025 15:07:55 +0100

Pip Cet <[email-masked]> writes:

> As Eli points out, this is very puzzling.  Can you disassemble
> internal_equal_1 ("disass internal_equal_1") in the Emacs binary and
> evaluate "p *(struct Lisp_String *)0x7ffff47f2fa8" and "p *(struct

Regarding the strange positions, I think I found out what is causing
this: When I press C-g C-x C-c in the example I posted, then GDB
apparently already becomes active after C-g! I previously did not notice
it because I thought I had input the entire key sequence and expected
GDB to become active in this way only after a crash.

If possible, could you please recommend a way to run the example so that
GDB only becomes active when a crash is encountered?

Also, I have now recompiled Emacs as advised for debugging (i.e., with
--enable-checking='yes,glyphs' --enable-check-lisp-object-type \
CFLAGS='-O0 -g3').

The output I see on the shell (without GDB) for the example follows.

All the best,
Markus

$ ./emacs -nw -Q --load recenter_sometimes_not_recentering_nw.el
Fatal error 11: Segmentation fault
Backtrace:
./emacs(+0x23fcf8)[0x568e3c9fdcf8]
./emacs(+0x20547a)[0x568e3c9c347a]
./emacs(+0x23f42b)[0x568e3c9fd42b]
./emacs(+0x23f3fc)[0x568e3c9fd3fc]
./emacs(+0x23f474)[0x568e3c9fd474]
./emacs(+0x23f624)[0x568e3c9fd624]
/lib/x86_64-linux-gnu/libc.so.6(+0x42990)[0x7add5de42990]
./emacs(+0x49e87)[0x568e3c807e87]
./emacs(+0x49eb9)[0x568e3c807eb9]
./emacs(+0x4a719)[0x568e3c808719]
./emacs(+0x4b5ba)[0x568e3c8095ba]
./emacs(+0x4b944)[0x568e3c809944]
./emacs(+0xae1e4)[0x568e3c86c1e4]
./emacs(+0xab87d)[0x568e3c86987d]
./emacs(+0x2128ec)[0x568e3c9d08ec]
./emacs(+0x227abf)[0x568e3c9e5abf]
./emacs(+0x20e8c8)[0x568e3c9cc8c8]
./emacs(+0x2f6bfd)[0x568e3cab4bfd]
./emacs(+0x20e01d)[0x568e3c9cc01d]
./emacs(+0x2f5fce)[0x568e3cab3fce]
./emacs(+0x20dfab)[0x568e3c9cbfab]
./emacs(+0x20d2ef)[0x568e3c9cb2ef]
./emacs(+0x20d523)[0x568e3c9cb523]
./emacs(+0x208a31)[0x568e3c9c6a31]
/lib/x86_64-linux-gnu/libc.so.6(+0x28150)[0x7add5de28150]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x89)[0x7add5de28209]
./emacs(+0x3f5c5)[0x568e3c7fd5c5]