Closed Bug 1743551 Opened 1 year ago Closed 4 months ago

[xcb] Unknown sequence number while processing queue

Categories

(Core :: Graphics, defect)

Unspecified
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: lsalzman, Unassigned)

References

(Blocks 2 open bugs)

Details

(Keywords: crash)

Crash Data

We are seeing frequent triggering of an assert inside libX11 in xcb_io.c, such as:

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
firefox: ../../src/xcb_io.c:259: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

This appears to be a race condition when libX11 gets used from multiple threads, regardless if XLockDisplay is called. More details about how the actual race here: https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/34

According to the release announcement for 1.7.0, it appears that fix was merged for release in that 1.7.0: https://lists.x.org/archives/xorg-announce/2020-November/003065.html

Seems like Ubuntu 20 and below are still using an older version of libX11 (1.6.9) which does not have this fix. So we will still see this crash on CI, because we are only using Ubuntu 18.04 there.

The main user of libX11 is GDK/GTK, which is where we tend to see the crashing thread from the assert. If you look in the other threads at time of crash you will usually see something calling into libxcb. Other threads that use libxcb/libX11 that get us into trouble include: WebRender sometimes making GLX requests from inside Mesa, RenderCompositorSWGL using XCB, GtkVsyncSource using GLX calls, etc.

I am not as of yet sure there is a great fix for this issue other than encouraging users to upgrade to libX11 1.7.0 or later, or try Wayland. Incidence of crashes still seems low enough that maybe this is not that bad.

Perhaps just dupe this to bug 1607713, and wait for the fix to be distributed.
A workaround seems difficult.

Blocks: 1607713

Seems as if Debian stable is already at >= 1.7, as well as Fedora.
Ubuntu looks like they're in the process of backporting a race fix for affected distros:

Ubuntu 18: https://launchpad.net/ubuntu/+source/libx11/2:1.6.4-3ubuntu0.5
Ubuntu 20: https://launchpad.net/ubuntu/+source/libx11/2:1.6.9-2ubuntu1.3

See Also: → 1744060
See Also: → 1745805

Closing because no crashes reported for 12 weeks.

Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → WORKSFORME
See Also: → 1777849
You need to log in before you can comment on or make changes to this bug.