Bug 40372 - Thread hangs in xcb_wait_for_reply() if another thread calls xcb_poll_for_event()
Summary: Thread hangs in xcb_wait_for_reply() if another thread calls xcb_poll_for_eve...
Status: RESOLVED FIXED
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-25 05:28 UTC by Uli Schlachter
Modified: 2013-05-17 10:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Test case causing hang (570 bytes, application/octet-stream)
2011-08-25 05:28 UTC, Uli Schlachter
Details
Proposed patch (2.40 KB, patch)
2011-08-25 05:28 UTC, Uli Schlachter
Details | Splinter Review

Description Uli Schlachter 2011-08-25 05:28:07 UTC
Created attachment 50561 [details]
Test case causing hang

Hi,

thanks to sroedal who described this problem on IRC, I came up with the attached test case. The thread doing GetInputFocus requests here will hang in recv() almost instantly.

This happens because xcb_poll_for_event() can cause two threads to read data from the connection because this function doesn't synchronize with anything else. This means that the main thread will read the reply, but the thread waiting for the reply will still be struck in recv().

Uli
Comment 1 Uli Schlachter 2011-08-25 05:28:45 UTC
Created attachment 50562 [details] [review]
Proposed patch
Comment 2 Peter Harris 2011-09-02 10:05:17 UTC
Fixed in 5ceeaaa4294201b3f613c07f9ec610c0e5f673c7

Thanks, Uli.
Comment 3 wendal chen 2013-05-17 10:21:04 UTC
Is this ok to version 1.7 in opensuse 11.4 ?


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.