CheckConnections didn't check for write blocked clients. If an ignored client is write-blocked but then closed, the Select in WaitForSomething will return EBADF. CheckConnections is supposed to weed these connections out but it doesn't, because it checks only for AllClients, and ignored clients (which can still be written to) aren't in that set.
This patch makes CheckConnections check also the set ClientsWriteBlocked in addition to AllClients. Test case: run cnee, put it in suspend with ^Z and generate a lot of events, so that its connection becomes write blocked. Now kill -9 the process and witness X entering a neverending loop. Cnee's connection issues RecordEnableContext, which makes the connection ignored. Signed-off-by: Erkki Seppälä <erkki.sepp...@vincit.fi> Reviewed-by: Rami Ylimäki <rami.ylim...@vincit.fi> --- os/connection.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/os/connection.c b/os/connection.c index 1d38906..07021e7 100644 --- a/os/connection.c +++ b/os/connection.c @@ -993,7 +993,7 @@ CheckConnections(void) #ifndef WIN32 for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++) { - mask = AllClients.fds_bits[i]; + mask = AllClients.fds_bits[i] | ClientsWriteBlocked.fds_bits[i]; while (mask) { curoff = mffs (mask) - 1; -- 1.7.0.4 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel