Bug 5839

Summary: I broke XStoreColors on Xlib/XCB
Product: xorg Reporter: Jamey Sharp <jamey>
Component: Lib/XlibAssignee: Jamey Sharp <jamey>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: highest    
Version: git   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
test case that triggers these bugs using XStoreColors. none

Description Jamey Sharp 2006-02-08 09:53:17 UTC
When converting Xlib/XCB to use only XCB's public API, I assumed that Xlib
protocol stubs don't ever call the Data family of macros more than once per
GetReq. I thought doing so would be a bug because Data can call _XFlush and I
thought that might lead to a race in multi-threaded settings.

It looks like it doesn't lead to a race, though, and XStoreColors (for one) does
call Data many times. This causes an assertion failure in current Xlib/XCB if
XStoreColors is called with more colors than will fit in Xlib's 16kB output
queue. (!)

I need to properly handle multiple calls to Data in Xlib/XCB.
Comment 1 Jamey Sharp 2006-05-08 11:03:51 UTC
I believe I have this fixed in my local GIT repo. I'm waiting for confirmation
that there was ever a bug to begin with before I push the patch, so I can check
that the patch worked.
Comment 2 Jamey Sharp 2006-05-08 16:18:06 UTC
My committed fix repaired the immediate issue but exposed a new one.

The X Test Suite test purpose that illustrates both bugs is in Xlib7,
XCreateColormap purpose 6. The new failure mode is an assert failure in
_XUnlockDisplay.
Comment 3 Eric Anholt 2006-05-10 03:46:21 UTC
XRenderCompositeText8 also calls Data multiple times, and I've hit this using
gconf-editor and clicking apps->evolution->general (boom).  With the latest
bits, I instead hit:

Assertion failed: (XCBGetRequestSent(dpy->xcl->connection) == dpy->request),
function _XUnlockDisplay, file xcl/xcblock.c, line 49.
Comment 4 Jamey Sharp 2006-05-10 04:52:35 UTC
Created attachment 5585 [details]
test case that triggers these bugs using XStoreColors.

storecolors: xcl/xcblock.c:49: _XUnlockDisplay: Assertion
`XCBGetRequestSent(dpy->xcl->connection) == dpy->request' failed.

XCBGetRequestSent(dpy->xcl->connection) is 7; dpy->request is 6.
Comment 5 Jamey Sharp 2006-05-11 10:05:37 UTC
I believe this is finally completely fixed.

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.