From owner-freebsd-alpha Thu Jul 27 0:51:36 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from eel.radicalmedia.com (eel.radicalmedia.com [204.254.246.9]) by hub.freebsd.org (Postfix) with ESMTP id C1A6137C096; Thu, 27 Jul 2000 00:51:32 -0700 (PDT) (envelope-from phiber@eel.radicalmedia.com) Received: (from phiber@localhost) by eel.radicalmedia.com (8.9.3/8.9.3) id DAA10134; Thu, 27 Jul 2000 03:51:28 -0400 (EDT) Date: Thu, 27 Jul 2000 03:51:28 -0400 From: Mark Abene To: "David O'Brien" Cc: freebsd-alpha@FreeBSD.ORG Subject: Re: weird XFree86 3.3.6 behavior... Message-ID: <20000727035128.A9982@radicalmedia.com> References: <20000727022930.A9638@radicalmedia.com> <20000727000033.A44502@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <20000727000033.A44502@dragon.nuxi.com>; from David O'Brien on Thu, Jul 27, 2000 at 12:00:33AM -0700 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu, Jul 27, 2000 at 12:00:33AM -0700, David O'Brien wrote: > On Thu, Jul 27, 2000 at 02:29:30AM -0400, Mark Abene wrote: > > I'm experiencing a very strange problem with XFree86 3.3.6. > > How (/when) did you install the XFree86 bits? > This is XFree86 3.3.6 compiled from the 4.0-RELEASE ports collection. I've been using it without incident (rock solid) until I decided to open a bunch more xterms than I normally do, and xscreensaver sent it into an infinite loop, as previously described. Xscreensaver normally functions as expected. When I mentioned the number of clients that need to be open in X for the problem to surface, I'm taking the numbers from xwininfo -root -children (the total). I'm guessing (and this is a big guess), that select() is malfunctioning when the number of fd's reach some high limit. I've been using gdb to single step through the hung X server for the past few days now, so I'm very familiar with what's going on (just not sure why). When the number of clients is "high", and xscreensaver authenticates a valid password, the saver program is exiting. At this point in the X server's WaitForSomething() main event loop, we select on "AllSockets", and find that we get an fd that returns a EBADF, indicating (mistakenly at this point in time) that a client needs closing. So it calls CheckConnections(), which selects on MAXSOCKS in poll mode (timeval's sec and usec are zero). CheckConnections() of course doesn't find any fd's that need closing down, and returns back to WaitForSomething(), which again gets a EBADF back from select, so it calls CheckConnections() again, and so on and so on. :) And we end up with a vicious cycle where the X server is hung eating up all available cpu. Not very pretty. If you need more details, I'll be happy to provide them. The problem is easily reproducible, and I'm still considering select(2) as being suspect. Cheers, -Mark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message