gtk2 applications crash with xcb_xlib_threads_sequence_lost
In all gtk2-applications I run, I occasionally experience crashes, which are all triggered by the same failed assertion "!xcb_xlib_threads_sequence_lost" (see below stacktrace). The crashes are extremely hard to reproduce, sometimes happening only once in an eight-hour working day. It usually happens more often when switching back to a longer (several minutes) inactive window.
The affected applications include inkscape, geany (gtk2) and pcmanfm. The crashes started after upgrading from Debian 9 to 10. Other distributions seem to be affected too, please see also
As geany and pcmanfm are concerned, the crashes occur when doing ordinary stuff, e.g. a rightclick on geany's main text-field or entering a directory in pcmanfm. Please note that according to its developers, geany is a single-threaded application, which in my opinion suggests that the bug lies in the underlying technology. Also note, that the gtk3-version of geany does not suffer from this bug. The same is reported for spacefm, where also only the gtk2-version of the program crashes.
I originally commented on the potential mesa-bug here, however, Nicholas Miell assumed it being a bug in GDK, so I filed it here.
Running on Debian 10 Buster (amd64)
## Backtrace Thread 1 "geany" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden. (gdb) bt #0 0x00007fbbcdd6c7bb in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007fbbcdd57535 in __GI_abort () at abort.c:79 #2 0x00007fbbcdd5740f in __assert_fail_base (fmt=0x7fbbcc0111d2 "%s%s%s:%u: %s%sZusicherung »%s« nicht erfüllt.\n%n", assertion=0x7fbbcdca9808 "!xcb_xlib_threads_sequence_lost", file=0x7fbbcdca9673 "../../src/xcb_io.c", line=263, function=<optimized out>) at assert.c:92 #3 0x00007fbbcdd65102 in __GI___assert_fail (assertion=assertion@entry=0x7fbbcdca9808 "!xcb_xlib_threads_sequence_lost", file=file@entry=0x7fbbcdca9673 "../../src/xcb_io.c", line=line@entry=263, function=function@entry=0x7fbbcdca9ac0 <__PRETTY_FUNCTION__.15060> "poll_for_event") at assert.c:101 #4 0x00007fbbcdc376bb in poll_for_event (dpy=dpy@entry=0x5584a5716bb0, queued_only=queued_only@entry=0) at ../../src/xcb_io.c:260 #5 0x00007fbbcdc37760 in poll_for_response (dpy=dpy@entry=0x5584a5716bb0) at ../../src/xcb_io.c:303 #6 0x00007fbbcdc37a5d in _XEventsQueued (dpy=dpy@entry=0x5584a5716bb0, mode=mode@entry=2) at ../../src/xcb_io.c:363 #7 0x00007fbbcdc297b7 in XPending (dpy=0x5584a5716bb0) at ../../src/Pending.c:55 #8 0x00007fbbce8b88d5 in gdk_check_xpending (display=<optimized out>) at ./gdk/x11/gdkevents-x11.c:159 #9 0x00007fbbce8b88d5 in gdk_event_check (source=0x5584a5732280) at ./gdk/x11/gdkevents-x11.c:2400 #10 0x00007fbbce287b11 in g_main_context_check () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 #11 0x00007fbbce2880e0 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 #12 0x00007fbbce2884c2 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 #13 0x00007fbbcea478e7 in IA__gtk_main () at ./gtk/gtkmain.c:1270 #14 0x00007fbbceddf690 in main_lib () at /usr/local/lib/libgeany.so.0 #15 0x00007fbbcdd5909b in __libc_start_main (main= 0x5584a4d73050, argc=3, argv=0x7ffff0a96568, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffff0a96558) at ../csu/libc-start.c:308 #16 0x00005584a4d7308a in ()