[Xcb] libxcb/libX11 deadlocking and asserting in multi-threaded use

Nicholas Allen nick.allen at onlinehome.de
Fri Mar 19 01:22:15 PDT 2010


Sorry that code is not complete. I wasn't calling XFlush after mapping
the window. I'll try to make a more complete  version that reproduces
this bug...

Nick

Nicholas Allen wrote:
> The C program to reproduce this bug is very small and I have attached it.
>
> I compiled it on Linux with the command:
>
> gcc xlib-bug.c -lX11 -lpthread -oxlib-bug
>
> When run you see that it tries to get the next event and never gets one
> (ie it deadlocks inside XNextEvent). Sometimes it works for a short
> period of time but mostly it deadlocks for me. Sometimes it deadlocks
> even before the window is opened.
>
> Is there anything I'm doing wrong in that example code?
>
> Thanks in advance,
>
> Nicholas Allen
>
>
> Nicholas Allen wrote:
>   
>> Hi,
>>
>> We have a multi-threaded app that often deadlocks inside libx11 code
>> (XNextEvent never returns). We've initialized threading support by
>> calling XInitThreads as the very first thing we do. We have no other
>> mutexes in use in our code so it seems that the error is within
>> libX11/xcb itself and not our own code.
>>
>> When the app doesn't lock (very rarely) then after a short time we get
>> this assertion:
>>
>> ../../src/xcb_io.c:242: process_responses: Assertion `(((long)
>> (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed.
>> Aborted
>>
>> and the application aborts. We are using Ubuntu Karmic on 64-bit
>> machine. In Jaunty we never experienced any problems but since the
>> upgrade the problems are very apparent. This further convinces me that
>> the problem is more likely in libX11/XCB than our own code. Has anyone
>> else noticed these deadlock issues? Are there any workarounds? Were
>> there any bug fixes that could have addressed issues like this?
>>
>> I will be happy to provide more information if needed and to help with
>> debugging and fixing xlib if needed.
>>
>> Many thanks in advance,
>>
>> Nicholas Allen
>>
>>
>> _______________________________________________
>> Xcb mailing list
>> Xcb at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/xcb
>>   
>>     
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb



More information about the Xcb mailing list