[Xcb] [Patch] Fix busy-loop on BSD (was: Fallback to TCP if no protocol is specified and the UNIX connection fails)

Uli Schlachter psychon at znc.in
Thu Mar 1 11:50:19 PST 2012


On 29.02.2012 21:47, Julien Cristau wrote:
> On Tue, Feb 28, 2012 at 12:45:56 -0800, Josh Triplett wrote:
> 
>> Ideally I'd suggest using a version of the patch that only removes the
>> use of MSG_WAITALL that actually breaks things, leaving the other use
>> that works fine as an optimization.
>>
> And I'd still prefer to go with the more obvious fix...

Hi everyone,

attached is a patch with a relatively verbose commit message. I tested this on
one of my university's FreeBSD boxes (with quite a patches userland). I were
able to reproduce the original problem and the patch made it go away.

At first I wanted to do just what Josh suggested. However, read_block() could
busy loop, too. This would happen if just the first part of an event or reply is
received while the rest of it is stuck somewhere. While this should never occur
in any real world scenarios, it still means that using MSG_WAITALL on a
non-blocking socket is always wrong.

Now that I noticed the above, this patch is equal to debian's patch. Since
debian/Julien/Christoph did all the work on this bug, I'd prefer if one of those
submitted a patch in their own name. I don't want my name on other people's
work. (At least you now have a template for the commit message ;-) )

Cheers,
Uli

-- 
"In the beginning the Universe was created. This has made a lot of
 people very angry and has been widely regarded as a bad move."


More information about the Xcb mailing list