Hanging on recursive _XReply() invocation
Hello,
I'm experiencing window manager (kwin) hanging on a recursive invocation of _XReply() that happens like this _XReply()->handle_error()->...->_XSeqSyncFunction()->_XReply()->ConditionWait(), see https://bugs.kde.org/show_bug.cgi?id=405592 for some stacktraces. This happens on an ARM device and somehow this is only reproducible when using touchscreen as the input. To be clear the hanging also happens using any desktop environment (checked XFCE, LXDE.. etc), so libx11 is likely to be the offender.
I made a dumb hack to libx11 to avoid the recursive _XReply() invocation and it 100% fixes the problem.
diff --git a/src/XlibInt.c b/src/XlibInt.c
index a0b2ed2f..a2b92493 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -211,11 +211,7 @@ void _XSeqSyncFunction(
xGetInputFocusReply rep;
_X_UNUSED register xReq *req;
- if ((X_DPY_GET_REQUEST(dpy) - X_DPY_GET_LAST_REQUEST_READ(dpy)) >= (65535 - BUFSIZE/SIZEOF(xReq))) {
- GetEmptyReq(GetInputFocus, req);
- (void) _XReply (dpy, (xReply *)&rep, 0, xTrue);
- sync_while_locked(dpy);
- } else if (sync_hazard(dpy))
+ if (sync_hazard(dpy))
_XSetPrivSyncFunction(dpy);
}
Any thoughts / comments?