[Xcb] Hangs with xcb_take_socket

Uli Schlachter psychon at znc.in
Wed Nov 17 08:00:54 PST 2010


Hi,

let's consider the following events:

I use xcb_take_socket(), current sequence number is 0xffff.
I send 2*2^16 XRENDER requests, all of which don't cause any reply. This causes
two sequence number wraps and the current sequence number is now 0x2fffff, but
the X server will only report 0xffff in replies/events, so if xcb sees the next
reply, it will expand it's sequence number to e.g. 0x1ffff when it really should
have been 0x2ffff.
I hope this makes the problem clear.

This will cause XCB lose track of the current sequence number, because it can't
properly detect the sequence number wrap. The right solution is obviously to
insert GetInputFocus requests where appropriate, but when are they appropriate?

XCB internally tracks the sequence number of the last reply that it received,
but I don't have access to this information. Does this mean that I have to
insert a GetInputFocus right after every xcb_take_socket()? (the next request
could already cause a wrap to go unnoticed)

This is problem that I've been hitting with cairo git/master's perf
measurements. They trigger the hang described above (No, I don't know why cairo
jumps through hoops to simulate an XLockDisplay()-like behavior).

Cheers,
Uli
-- 
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451


More information about the Xcb mailing list