[Xcb] xcb_wait_for_reply() -> poll() blocks when switching to lock screen or virtual terminal

Uli Schlachter psychon at znc.in
Sun Sep 16 12:35:06 UTC 2018

Hi Gatis,

On 14.09.2018 12:51, Gatis Paeglis wrote:
> Is it by design that XCB blocks in xcb_wait_for_reply() -> poll() when I switch to a lock screen or virtual terminal? If I go to a VT, gdb attach to a running application, I see that it is stuck in:

I'm 85% sure you are talking about [1]. In that bug, you write in 2015:

> Ok, this is a definitely X bug, I have a simple test code that can> reproduce the issue. I will create a bug report and paste the link
> here for tracking


> https://bugs.freedesktop.org/show_bug.cgi?id=91448

In comment 1 of this bug, Chris Wilson explained why the hangs happen.
In Comment 3 there, Adam Jackson also explained that this only affects
clients that used GLX.

So, if you want a work-around, use two separate X11 connections, one for
everything "GLX-y" and one for everything else (and synchronise between
these two as needed, which means that your main thread might still end
up hanging when Xorg stops answering to you).


[1] https://bugreports.qt.io/browse/QTBUG-47179
99 little bugs in the code
99 little bugs in the code
Take one down, patch it around
117 little bugs in the code
  -- @irqed

More information about the Xcb mailing list