Bug 22159 - xorg-x11-libX11 with pthread isn't thread safe in xcb_lock.c
Summary: xorg-x11-libX11 with pthread isn't thread safe in xcb_lock.c
Status: RESOLVED FIXED
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-08 10:43 UTC by G_Besdo
Modified: 2009-06-08 11:06 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Example code file for xcb_lock.c error (4.11 KB, text/plain)
2009-06-08 10:43 UTC, G_Besdo
Details

Description G_Besdo 2009-06-08 10:43:14 UTC
Created attachment 26551 [details]
Example code file for xcb_lock.c error

tested with openSUSE 11.1
I use the xorg-x11-libX11 library 7.4-1.29, glibc library 2.9-2.11.1.

One thread use the XDrawPoints function to put pixel to the window.
An other thread waits with XNextEvent for an event.

Every time I produce some events the program stops.

Reproducible: Sometimes

Steps to Reproduce:
1. translate the xcb_Test.c with gcc -o xcb_Test xcb_Test.c -pthread
-I/usr/include/X11 -lX11
2. run the program xcb_Test
3. to tap some keys
Actual Results:  
Every time I produce some events the program stops with

xcb_lock.c:33: _XCBUnlockDisplay: Assertion
`xcb_get_request_sent(dpy->xcb->connection) == dpy->request' failed.
or
xcb_lock.c:77: _XGetXCBBuffer: Assertion `((int) ((xcb_req) - (dpy->request))
>= 0)' failed.

In the xorg-x11-libX11-7.4-1.29.src.rpm is the file xcb_lock.c.
The file has a line
#include <pthread.h>
but nothing is used. I can translate the file without this line.
Comment 1 Julien Danjou 2009-06-08 10:50:26 UTC
I'm not very familiar with thread stuff, but don't you miss XInitThread?
Comment 2 G_Besdo 2009-06-08 11:06:15 UTC
(In reply to comment #1)
> I'm not very familiar with thread stuff, but don't you miss XInitThread?
> 
yes it was my mistake.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.