[Xcb] xcb recursive write not protected in all cases?

Roland Mainz roland.mainz at nrubsig.org
Mon Dec 23 23:09:15 PST 2013


On Tue, Dec 24, 2013 at 6:23 AM, Keith Packard <keithp at keithp.com> wrote:
> Josh Triplett <josh at joshtriplett.org> writes:
>
>> On Mon, Dec 23, 2013 at 05:00:46PM -0800, Keith Packard wrote:
>>> I think we need to check out.writing closer to the actual use of the
>>> out.queue; perhaps it would suffice to check that down inside
>>> send_request itself? That would certainly offer the surest guarantee
>>> that iolock wasn't dropped between the check for out.writing and the use
>>> of out.queue.
>>
>> Based on your analysis, that sounds like the best plan indeed: check
>> while holding the lock in send_request, where there's no way we can
>> subsequently drop it before sending the request.
>
> I ran into another issue in the same area -- while waiting for
> out.writing, we can lose the socket back to Xlib, append some data to
> the request buffer and then Xlib comes along and tries to write another
> request to the socket and *bam* another assertion failure in write_vec.
>
> I think we have to block until we have the socket *and* out.writing is
> false.
>
> Something like this:

Just curious: Does XCB have something similar like EAGAIN ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)


More information about the Xcb mailing list