From owner-freebsd-hackers Sun Sep 14 00:30:16 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA28080 for hackers-outgoing; Sun, 14 Sep 1997 00:30:16 -0700 (PDT) Received: from sendero-ppp.i-connect.net (sendero-ppp.i-Connect.Net [206.190.143.100]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id AAA28064 for ; Sun, 14 Sep 1997 00:30:11 -0700 (PDT) Received: (qmail 19527 invoked by uid 1000); 14 Sep 1997 07:30:34 -0000 Message-ID: X-Mailer: XFMail 1.2-alpha [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199709140444.VAA08806@usr08.primenet.com> Date: Sun, 14 Sep 1997 00:30:33 -0700 (PDT) Organization: Atlas Telecom From: Simon Shapiro To: Terry Lambert Subject: Re: What is wrong with this snipet? Cc: freebsd-hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Hi Terry Lambert; On 14-Sep-97 you wrote: > > Why would the following segfault on 6 of the 10 iterations? > > Forget that, we want to know how you get 5 more iterations (minimum) > out of a program that's already segfaulted. 8-). I dunno, I just work here :-) You saw the program (well, excuding some #includes). If you notice, it is not a star forker, but a chain one; Each process forks a child and exits. I suspect the segfault (if you move things a bit you can get bus errors instead :-) happens sometimes when an earlier parent exits. If the kernel gives priority to fork, vs. exit, this is what we will see. It goes away if you do not share memory, which makes sense, as one of the exit() calls eventually free()'s some critical memory. The interesting thing is that the program is (I think) semantically correct. There is no obviously wrong anything in it. Actually, if you clear the RFMEM bit, it runs perfectly normally. As I said to someone else earlier, in one place, at one time we considered a system which when operated as documented but produced obviously erroneous results to have a bug. But since we understand what happened here, we can document it. Voila! a feature :-)) BTW, I do not pretend to know how to solve it in a satisfactory manner. --- Sincerely Yours, (Sent on 14-Sep-97, 00:13:30 by XF-Mail) Simon Shapiro Atlas Telecom Senior Architect 14355 SW Allen Blvd., Suite 130 Beaverton OR 97005 Shimon@i-Connect.Net Voice: 503.643.5559, Emergency: 503.799.2313