Subject: Re: bug#77046: 31.0.50; Emacs sometimes crashes

From: Eli Zaretskii <[email-masked]>
Date: Sat, 22 Mar 2025 17:35:14 +0200

> From: Markus Triska <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked],  [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?

Yes, say

  (gdb) source /path/to/emacs/src/.gdbinit

before starting Emacs under GDB.  On TTY frames, Emacs programs the
terminal to generate SIGINT when the user presses C-g, so Emacs gets
delivered SIGINT and GDB kicks in.  The file src/.gdbinit in the Emacs
source tree causes GDB to pass SIGINT to Emacs without stopping it.