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
server.
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)
FD_ZERO(&tmask);
FD_SET(curclient, &tmask);
r = Select (curclient + 1, &tmask, NULL, NULL, &notime);
- if (r < 0)
- CloseDownClient(clients[ConnectionTranslation[curclient]]);
+ if (r < 0 && GetConnectionTranslation(curclient) > 0)
+ LogWrite(1, "CheckConnections: close down client, errno %d\n", errno);
+ if ((EINTR != errno) && (EAGAIN != errno))
+ CloseDownClient(clients[ConnectionTranslation[curclient]]);
+ }
mask &= ~((fd_mask)1 << curoff);
}
}

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.