Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Ken Raeburn <raeburn@raeburn.org>
To: axp-list@redhat.com
Subject: X server crashes
Date: Mon, 29 Jun 1998 15:06:33 -0400	[thread overview]
Message-ID: <199806291906.PAA09444@cujo.cygnus.com> (raw)


(Sorry if this has come up recently, I'm behind on my axp-list mail.)

My Matrox server has been crashing when I have too many connections.
I remember other people reporting this, but don't remember seeing a
solution, so I've been investigating, and here's one problem I've
found:

In os/WaitFor.c:

	    while (clientsReadable.fds_bits[i])
	    {
	        int client_priority, client_index;

		curclient = ffs (clientsReadable.fds_bits[i]) - 1;

clientsReadable is a standard fd_set, and it and ffs both come from
the installed header files.  However, fds_bits elements are type
"unsigned long int", and the ffs prototype is:

    extern int ffs  (int __i)  ;

So when clientsReadable.fds_bits[i] is 0x300000000, the function call
truncates the value to fit an "int", and ffs(0) is 0, so curclient
gets assigned -1, and things fall apart from there.

Note also that connection.c and io.c use ffs similarly, and perhaps
stuff in other directories too.

I'm not sure if it should be required that ffs be usable on elements
of an fd_set.  It really does only accept an int currently, it
truncates the value internally.

For now I'm probably just going to write a hack ffs64 so I can get
work done....

Ken


             reply	other threads:[~1998-06-29 19:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-29 19:06 Ken Raeburn [this message]
1998-06-29 19:47 ` X server crashes Matti Aarnio
1998-06-30  0:44   ` Andreas U. Trottmann
1998-06-30 14:10     ` Ken Raeburn
1998-06-30 16:44       ` Matti Aarnio
  -- strict thread matches above, loose matches on Subject: below --
1998-06-30 18:58 DevGolfs18
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