Bugzilla – Bug 9240
EINTR in select causes client shutdown
Last modified: 2008-04-30 02:02:26 UTC
in Xserver/os/connection.c, the Xserver calls CheckConnections() to check
the validity of the client file descriptors. Even though the select is
called with a timeout of zero, it is still possible for the the OS to return
EINTR. When this happens, an active client connection is dropped from the
The LogWrite() is what I used to prove this is happening. It can be removed.
N.B.: this patch includes the patch made for bug #7876.
--- xc/programs/Xserver/os/connection.c 2004-04-23 14:54:28.000000000 -0500
+++ xc/programs/Xserver/os/connection.c 2006-12-04 13:09:39.565957120 -0600
@@ -1056,8 +1056,11 @@ CheckConnections(void)
r = Select (curclient + 1, &tmask, NULL, NULL, ¬ime);
- if (r < 0)
+ if (r < 0 && GetConnectionTranslation(curclient) > 0)
+ LogWrite(1, "CheckConnections: close down client, errno %d\n", errno);
+ if ((EINTR != errno) && (EAGAIN != errno))
mask &= ~((fd_mask)1 << curoff);
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
I reviewed the current git version of xorg/xserver/os/connection.c,
and see that this problem still exists.
Any way to get this fix in to xorg ?
Thanks, I've pushed the fix for both to master, but want to wait until it's been properly tested until I cherry pick into the 1.4 branch. Thanks for the patch. I made a small modification: I made select continue until we stop getting either EINTR or EAGAIN, so we can actually determine whether or not the connection's dead. Also, I applied it to the win32 part.
(Leaving open only for 1.4.1. It's fixed in master, I think.)
This has even been pushed into 1.4 branch.