[Xcb] DRI2GetBuffersWithFormat hangs waiting for X.org

Francesco Abbate francesco.bbt at gmail.com
Wed Dec 1 08:41:00 PST 2010


2010/12/1 Pauli Nieminen <suokkos at gmail.com>:
> On Tue, Nov 30, 2010 at 6:22 PM, Joris Dobbelsteen
> <joris.dobbelsteen at sioux.eu> wrote:
>> Hi all,
>>
>> I'm looking for some expert opinion to verify a possible cause of our
>> problems.
>>
>> After further investigation of the issue the following is found:
>> We do all our X drawing on a single thread.
>> However, DirectFB (used due to legacy reasons) creates a second thread
>> for reading inputs (events).
>>
>> Could this multi-threaded usage of libX11 cause it to hang?
>>
>> What we see is that our drawing thread gets stuck in a poll on the
>> socket while calling _XReply (after _XReply has called _XSend). However,
>> a second thread is seen reading from a socket for inputs.
>>
>
> Does someone set the connection to thread safe mode?
>
> If yes then xcb might be causing the problem.
>

Hi,

I've also seen this problem which is related to the xcb implementation
of libX11. The problem arise when two different threads try to use the
same connection with one thread polling events and the other sending
drawing commands. This happens even if you called XInitThreads.

Here the threads (largely ignored by xcb developers):

http://lists.freedesktop.org/archives/xcb/2010-October/006518.html
http://lists.freedesktop.org/archives/xorg/2010-September/051323.html

The workaround that I've introduced for my application (the xcb
developers didn't offer any alternative) was to create a second
connection and use one to poll the events and the other for drawing
operations. It seems that this workaround trigger another xcb bug that
cause a memory leakage but for the moment I didn't file a bug report
for that.

I'm glad that a discussion group is opened on this issue because right
now the problem has been largely ignored.

Best regards,
Francesco


More information about the Xcb mailing list