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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 05 Aug 2022 09:25:02 +0300

> From: Po Lu <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Fri, 05 Aug 2022 08:50:39 +0800
> 
> That's what I thought might be happening.  Emacs calls
> g_main_context_pending to read events from GDK, which notices that the
> display connection has been abruptly terminated, and calls _exit to
> abort.
> 
> Unfortunately, there's no way for us to fix this inside Emacs, so I
> guess you should look into why Wayland display connections are so
> unstable on your system.

Does _exit in glibc provide any hooks that we could use?  Emacs cannot
be the first application that doesn't want misbehaving libraries to
forcibly exit it.

Or maybe GTK has some knob to let it call us before it calls _exit?