[Xcb] [PATCH 2/3] fix deadlock with xcb_take_socket/return_socket v3

Uli Schlachter psychon at znc.in
Fri Jun 7 07:48:46 PDT 2013


Hi,

On 05.06.2013 22:51, Jamey Sharp wrote:
> Sorry for not replying sooner; my bad!

No problem, thanks for replying at all. :-)

> I think this patch correctly does what it claims to do, which is always
> a plus. :-) I haven't thought carefully about it, but it looks
> plausible.
> 
> However, I have yet to see evidence that this patch fixes a bug. I
> believe instead that it works around broken callers, which I'd rather
> discourage.

Well, the only broken caller that was considered so far was "something calls
into xcb via XGetXCBConnection() while the Display* is locked", right? You are
saying that the caller shouldn't do this and has to be fixed instead.

However, how could such a fix look like? This rule would boil down to "you must
not use XGetXCBConnection() in a library", because anyone up the call-chain
could have used XLockDisplay(). Thus, XGetXCBConnection() and libxcb would
become unusable for almost anyone (perhaps except for toolkits).

I agree that working around broken callers is a bad idea, but I don't really
think that the callers should be blamed here, because they don't have any
alternative.

Am I missing some way to fix this problem in the callers?

> I'd prefer this not go into a release until we have evidence that it's a
> good idea.

Sure, we should definitely have a consensus about this change before releasing it.

Cheers,
Uli
-- 
No matter how much cats fight, there always seem to be plenty of kittens.


More information about the Xcb mailing list