From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 30803 invoked from network); 29 Jun 1998 19:07:25 -0000 Received: from tweedledumb.cygnus.com (192.80.44.1) by mail2.redhat.com with SMTP; 29 Jun 1998 19:07:25 -0000 Received: from cujo.cygnus.com (cujo.cygnus.com [192.80.44.10]) by tweedledumb.cygnus.com (8.8.5/8.8.5) with ESMTP id PAA22239; Mon, 29 Jun 1998 15:06:21 -0400 (EDT) Received: (from raeburn@localhost) by cujo.cygnus.com (8.8.7/8.8.7) id PAA09444; Mon, 29 Jun 1998 15:06:33 -0400 Date: Mon, 29 Jun 1998 15:06:33 -0400 Message-Id: <199806291906.PAA09444@cujo.cygnus.com> From: Ken Raeburn To: axp-list@redhat.com Subject: X server crashes (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