How to debug emacs crashes on WSL2

Viewed 308

I installed Emacs using the instructions on this site. It was working fine for a while, but recently I have started experiencing frequent crashes. E.g. every 20 minutes, Emacs shuts down without warning and without saving anything. Sometimes, I get output printed in my terminal window, e.g.,

When compiled with GTK, Emacs cannot recover from X disconnects.
This is a GTK bug: https://gitlab.gnome.org/GNOME/gtk/issues/221
For details, see etc/PROBLEMS.
Backtrace:
emacs(+0x146b12)[0x560737d11b12]
emacs(+0x48d1b)[0x560737c13d1b]
emacs(+0x49209)[0x560737c14209]
emacs(+0x48291)[0x560737c13291]
emacs(+0x48360)[0x560737c13360]
/lib/x86_64-linux-gnu/libX11.so.6(_XIOError+0x52)[0x7fcd36f391a2]
/lib/x86_64-linux-gnu/libX11.so.6(_XEventsQueued+0x7d)[0x7fcd36f3685d]
/lib/x86_64-linux-gnu/libX11.so.6(XPending+0x61)[0x7fcd36f28171]
/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x7020f)[0x7fcd376d920f]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_prepare+0x19f)[0x7fcd370af72f]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x520db)[0x7fcd370b00db]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_pending+0x2c)[0x7fcd370b027c]
/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_events_pending+0x12)[0x7fcd379bc402]

I am not 100% sure that the error message is correctly diagnosing the problem. But if we assume that it is a correct diagnosis, how would I re-install Emacs so that it can recover from X disconnects? Alternatively, how can I stop X from disconnecting?

0 Answers
Related