[Xcb] xlib

Jamey Sharp jamey at minilop.net
Fri Mar 4 14:04:31 PST 2005


On Wed, Mar 02, 2005 at 06:44:28PM -0500, Jeremy Kolb wrote:
> Any word on that xlib bug?  I notice that it's still there, but does 
> anyone know where to start looking for it (assuming it's only one)? 
> I'll go hunting tomorrow.

Oops. I forgot I didn't already reply to this. I hope Josh will help me
fill in the details: I'm trying to do this from memory.

I assume you're referring to the occasional assertion failures from
instances of the _xcb_assert_valid_sequence macro that is declared in
xcbint.h and used by both XCB and Xlib.

I think that the assertions are placed correctly, though it could be
that they're firing wrongly. I suspect that some XCB function is being
called while Xlib "owns" XCB's buffers. (See X11/src/xcl/xcblock.c,
especially _X{Put,Get}XCBBuffer.) That could mean an X request is being
sent by XCB while Xlib is responsible for tracking outgoing requests. If
the asserts weren't there in that case, Xlib would reset XCB's state as
though the request hadn't been sent, and sometime later everything would
get confused.

One non-obvious way this might happen is when XCB upcalls back into Xlib
through the "unexpected reply handler". That path is very hard to reason
about. I'd love to design it away. Maybe we can get away with a queue of
unexpected replies that Xlib can poll at some appropriate point, I
dunno. Even better if we could make all replies expected; the async
reply handler mechanism of Xlib makes that tricky, but maybe not as
impossible as I thought the last time I looked at it.

I don't expect that's enough to help find the bug, but I don't know what
else to say. Please don't hesitate to ask more questions.

--Jamey


More information about the xcb mailing list