From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 12033 invoked from network); 27 Apr 1998 14:38:09 -0000 Received: from trurl.resnet.mtu.edu (adisaacs@141.219.81.181) by mail2.redhat.com with SMTP; 27 Apr 1998 14:38:09 -0000 Received: (from adisaacs@localhost) by trurl.resnet.mtu.edu (8.8.7/8.8.7) id KAA10908; Mon, 27 Apr 1998 10:38:00 -0400 From: adisaacs@trurl.resnet.mtu.edu Message-ID: <19980427103759.33296@mtu.edu> Date: Mon, 27 Apr 1998 10:37:59 -0400 To: axp-list@redhat.com Subject: Server crashes with > 20 X clients -- partial patch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.85e X-PGP-Fingerprint: 48 01 21 E2 D4 E4 68 D1 B8 DF 39 B2 AF A3 16 B9 X-PGP-Key-URL: http://www.csl.mtu.edu/~adisaacs/pgp.txt Hello all, I spent some time looking at the problem with the X server crashing when more than about 25 X clients connect. I was able to create the enclosed partial patch, but it's not a complete fix. This patch causes the X server to ignore the clients, rather than crashing. I still hope to look into this problem more, but it's getting towards the end of the quarter, so my free time is decreasing precipitously, and I wanted to get this out so that people would at least have somewhere to start. You'll need to apply this patch in xc/programs/Xserver/os/. You might also need to change a few other calls of ffs() to use myffs(). (Make sure to prototype myffs() correctly if you call it from another file.) -andy --- WaitFor.c.dist Mon Mar 2 06:56:36 1998 +++ WaitFor.c Tue Mar 17 22:49:41 1998 @@ -143,6 +143,14 @@ #if !defined(AMOEBA) +int myffs(long i) +{ + int j; + for (j = 1; (i & 1) == 0; j++) + i >>= 1; + return j; +} + int WaitForSomething(pClientsReady) int *pClientsReady; @@ -418,7 +426,7 @@ { int client_priority, client_index; - curclient = ffs (clientsReadable.fds_bits[i]) - 1; + curclient = myffs (clientsReadable.fds_bits[i]) - 1; client_index = ConnectionTranslation[curclient + (i << 5)]; #else int highest_priority; @@ -531,7 +539,7 @@ while (clientsReadable[i]) { int client_priority, curclient, client_index; - curclient = ffs (clientsReadable[i]) - 1; + curclient = myffs (clientsReadable[i]) - 1; client_index = ConnectionTranslation[curclient + (i << 5)]; dbprintf(("%d has input\n", curclient)); #ifdef XSYNC -- Andy Isaacson adisaacs@mtu.edu adi@acm.org Fight Spam, join CAUCE: http://www.csl.mtu.edu/~adisaacs/ http://www.cauce.org/