Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: adisaacs@trurl.resnet.mtu.edu
To: axp-list@redhat.com
Subject: Server crashes with > 20 X clients -- partial patch
Date: Mon, 27 Apr 1998 10:37:59 -0400	[thread overview]
Message-ID: <19980427103759.33296@mtu.edu> (raw)

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/


                 reply	other threads:[~1998-04-27 14:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox