Subject: bug#76327: 29.4; random segfaults after switch to tree-sitter

From: Evgeniy Dushistov <[email-masked]>
Date: Mon, 17 Feb 2025 16:16:06 +0300

On Sun, Feb 16, 2025 at 11:48:52AM +0200, Eli Zaretskii wrote:
> Please show this symbol:
> 
>   (gdb) source /path/to/emacs/src/.gdbinit
>   (gdb) frame 0
>   (gdb) print sym
>   (gdb) xtype
>   (gdb) xsymbol
> 

(gdb) frame 0
#0  SYMBOL_NAME (sym=XIL(0x55555f9b3260)) at /usr/src/debug/emacs/emacs-29.4/src/lisp.h:1152
1152	  return p;
(gdb) print sym
$1 = XIL(0x55555f9b3260)
(gdb) xtype
Lisp_Symbol
(gdb) xsymbol 
$2 = (struct Lisp_Symbol *) 0xaaaab57810c0
Cannot access memory at address 0xaaaab57810c8
(gdb) 

> > #5  0x000055555570603b in Fcommand_error_default_function (data=0x55555a8e65c3, context=0x7ffff1880284, signal=0x7fe0) at /usr/src/debug/emacs/emacs-29.4/src/lisp.h:1679
> 
> Can you show the error and its data here?  Like this:
> 
>  (gdb) frame 5
>  (gdb) pp data
>  (gdb) pp context
> 

(gdb) frame 5
#5  0x000055555570603b in Fcommand_error_default_function (data=XIL(0x55555df52d03), 
    context=XIL(0x7ffff1880284), signal=XIL(0x7fe0))
    at /usr/src/debug/emacs/emacs-29.4/src/lisp.h:1679
1679	  return XSTRING (string)->u.s.data;
(gdb) pp data
(wrong-type-argument listp 
Thread 1 "emacs-29.4" received signal SIGSEGV, Segmentation fault.
SYMBOL_NAME (sym=XIL(0x55555f9b3260)) at /usr/src/debug/emacs/emacs-29.4/src/lisp.h:1152
1152	  return p;
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwind-on-signal on".
Evaluation of the expression containing the function
(safe_debug_print) will be abandoned.
When the function is done executing, GDB will silently stop.

-- 
/Evgeniy