From owner-freebsd-current Tue Jul 23 4:32:46 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 949AD37B400 for ; Tue, 23 Jul 2002 04:32:43 -0700 (PDT) Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2736543E67 for ; Tue, 23 Jul 2002 04:32:43 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0012.cvx40-bradley.dialup.earthlink.net ([216.244.42.12] helo=mindspring.com) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17WxuA-0001Ub-00; Tue, 23 Jul 2002 04:32:38 -0700 Message-ID: <3D3D3DBD.D5199F28@mindspring.com> Date: Tue, 23 Jul 2002 04:27:57 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Sheldon Hearn Cc: Yann Berthier , current@freebsd.org Subject: Re: Is it just me or has -current suddenly got massively unstable? References: <20020722101211.GA442@hsc.fr> <20020723070704.7B4CB3925@overcee.wemm.org> <20020723100853.GA433@hsc.fr> <20020723102747.GR32782@starjuice.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Sheldon Hearn wrote: > On (2002/07/23 12:08), Yann Berthier wrote: > > Thanks a lot, patch applied, and all is going fine. Peter: I knew you > > would come up with a solution :) > > (well, feel free to call it bandaid, but it solves the problem BTW) > > To quote Terry Lambert on what he calls Occam's Corollary: > > Anything that works is better than anything that doesn't. > > :-) Be really, really careful here. The reason it works is because it changes the memory to be type stable, so it gets the previous values, if the structure has not been reused, and signals a selwakeup() where there is no one waiting. If the structure *has* been reused, then it issues a selwakeup() to a potentially unrelated thread. In most cases, this is a harmless event, that's not even being checked for; in other cases, it's being checked for, and it looks like a bogus return. Most code that sits in a select loop will only trigger if a bit is set. However, it's a perfectly valid thing to think that you won't get spurios returns -- and write code that *depends* on not getting spurious returns. Since I've only been following this vs. -current by reading, rather than running, source code, and reading, rather than applying patches, this is just my initial reaction to the patch. So take the following with a grain of salt... On the other hand: there is a *real* problem here; again, from just reading the code, it looks like a pretty deep one having to do with events being things which happen *on* descriptors, rather than *to* processes (or threads). I expect that the problem is that a thread has been terminated, and it is the thread which opened a socket, and then did the listen on it, but isn't around to do the accept, or receive the connection event. It's a deep problem because descriptors belong to processes, not threads, and events belong to the decriptors, not to the callers; before KSE's, it was OK to treat it as a commutitive property. I rather expect that there is a similar panic that will show up during stress testing, which will occur at NETISR on incoming connections, in the bottom half of the "accept" code, which has a similar looking selwakeup() call. Probably, the only way to fix this is to make it a process event rather than a thread event, which would avoid the list removal and subsequent dereference. Kind of an ugly kludge. 8-(. It would not surprise me if the kevent() resulting from signals is near the heart of the signal problem, as well, and has a parallel basis. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message