Subject: Re: bug#56528: 29.0.50; Emacs lucid segfaults when X dies

From: Po Lu <[email-masked]>
Date: Wed, 13 Jul 2022 18:45:02 +0800

[email-masked] writes:

> When X dies, Emacs lucid segfaults (backtrace attached as
> emacs.backtrace).  I confirmed that xrdb read 'emacs.synchronous: true'
> by running xrdb -q.
>
> After starting Emacs in the gdb session, I switched over to the right X
> display and ran,
>
>         1. M-x server-start RET
>         2. Said emacsclient -c in a terminal
>         3. In the spawned emacsclient, I ran proced to find out the pid for
>            the Xorg server and killed it by saying M-! kill <pid> RET
>         4. Switched over to the gdb session, and produced the backtrace.
>
> [ It doesn't seem to always segfault tho, but the Emacs process certainly
>   always dies when X goes down.  I also produced the backtrace for
>   not-segfault case and I'm attaching it as emacs.backtrace.nosegfault.  ]

Can you type the following commands at the gdb prompt after the crash
happens, and show me the output?

(gdb) up
(gdb) p *terminal
(gdb) p *terminal->display_info.x