Subject: bug#56967: 29.0.50; Frequent crashes under Wayland

From: Po Lu <[email-masked]>
Date: Thu, 04 Aug 2022 19:49:53 +0800

Eli Zaretskii <[email-masked]> writes:

> [Please use Reply All to reply, to keep the bug tracker on the CC.]

Indeed.  When you reply the wrong way, other people with relevant things
to say cannot respond.

>> The issue is that Emacs doesn't crash, it just exists with 1.
>> 
>> The recipe to reproduce the bug is to just use emacs and wait till it crashes.
>> 
>> I start emacs like this:
>> # /home/user/.config/systemd/user/emacs.service
>> 
>> [Unit]
>> Description=Emacs: the extensible, self-documenting text editor
>> Wants=graphical.target
>> Wants=environment.target
>> 
>> [Service]
>> Type=forking
>> ExecStart=/usr/bin/emacs --daemon
>> ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
>> Environment=SSH_AUTH_SOCK=%t/keyring/ssh
>> Environment=GDK_DPI_SCALE=2
>> Environment=GDK_SCALE=2
>> Restart=always
>> TimeoutStartSec=0
>> [Install]
>> WantedBy=default.target
>> 
>> # /home/user/.config/systemd/user/emacs.service.d/override.conf
>> [Service]
>> TimeoutStopSec=600

> Then please run Emacs under a debugger, or attach a debugger to it
> after you start it, and place a breakpoint in the function
> Fkill_emacs.  When that breakpoint breaks, produce a backtrace (with
> the "thread apply all bt" command in GDB) and post that backtrace
> here.

Please also place a breakpoint on _exit -- GDK always calls that with
the exit code 1 that when a display connection is abruptly lost, in
which case Fkill_emacs has no chance to run.

Thanks in advance.