diff options
author | Erik Kurzinger <ekurzinger@nvidia.com> | 2018-08-20 12:06:25 -0700 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2018-08-21 18:57:01 +0200 |
commit | bbda345a718ff73086437e51f03fcbb73e4365b9 (patch) | |
tree | 011629f813a3effaaafb2358f80254f1feee2b34 /configure.ac | |
parent | 7e0f166579672d71efd819c81f0c932b0acd542c (diff) |
don't flag extra reply in xcb_take_socket
If any flags are specified in a call to xcb_take_socket,
they should only be applied to replies for requests sent
after that function returns (and until the socket is
re-acquired by XCB).
Previously, they would also be incorrectly applied to the
reply for the last request sent before the socket was taken.
For instance, in this example program the reply for the
GetInputFocus request gets discarded, even though it was
sent before the socket was taken. This results in the
call to retrieve the reply hanging indefinitely.
static void return_socket(void *closure) {}
int main(void)
{
Display *dpy = XOpenDisplay(NULL);
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_get_input_focus_cookie_t cookie = xcb_get_input_focus_unchecked(c);
xcb_flush(c);
uint64_t seq;
xcb_take_socket(c, return_socket, dpy, XCB_REQUEST_DISCARD_REPLY, &seq);
xcb_generic_error_t *err;
xcb_get_input_focus_reply(c, cookie, &err);
}
In practice, this has been causing intermittent KWin crashes when
used in combination with the proprietary NVIDIA driver such as
https://bugs.kde.org/show_bug.cgi?id=386370 since when Xlib fails to
retrieve one of these incorrectly discarded replies it triggers
an IO error.
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'configure.ac')
0 files changed, 0 insertions, 0 deletions