libX11: Changes to 'master'

Jamey Sharp jamey at kemper.freedesktop.org
Sat Mar 15 13:05:08 PDT 2008


 src/XlibInt.c |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 64325f38bab082a8e0e9ce779a8e582de5c8588e
Author: Josh Triplett <josh at freedesktop.org>
Date:   Sat Mar 15 12:29:33 2008 -0700

    Fix fd.o bug 15023: make Xlib sync correctly given many void requests
    
    If given many requests without replies, Xlib may not sync until it flushes
    the output buffer.  Thus, if Xlib can fit enough requests in the buffer to
    pass by the number of requests it would normally sync after (65536 -
    BUFSIZE/sizeof(xReq)), it will sync too late.  The test case in bug 15023
    demonstrated this by issuing a request with a reply (ListExtensions) at
    just the right time to get confused with the GetInputFocus reply issued in
    response to the sync 65,536 requests later; the test case used an async
    handler to watch the replies, since otherwise it could not issue a request
    without waiting for the response.  When the test case failed, Xlib's sync
    handler would eat the ListExtensions reply, and the test case's async
    handler would see the GetInputFocus reply.
    
    Fix this by replacing SEQLIMIT with a function sync_hazard() that uses the
    buffer size to figure out when the sequence numbers could potentially wrap
    before the next flush.
    
    With this commit, the test case consistently passed, and the async reply
    handler always saw the ListExtensions reply.
    
    Commit by Jamey Sharp and Josh Triplett.



More information about the xorg-commit mailing list