From owner-freebsd-stable Tue Oct 16 22:34:19 2001 Delivered-To: freebsd-stable@freebsd.org Received: from ns.itga.com.au (ns.itga.com.au [202.53.40.210]) by hub.freebsd.org (Postfix) with ESMTP id CAB3237B40E for ; Tue, 16 Oct 2001 22:34:11 -0700 (PDT) Received: from lightning.itga.com.au (lightning.itga.com.au [192.168.71.20]) by ns.itga.com.au (8.9.3/8.9.3) with ESMTP id PAA87292; Wed, 17 Oct 2001 15:33:59 +1000 (EST) (envelope-from gnb@itga.com.au) Received: from itga.com.au (lightning.itga.com.au [192.168.71.20]) by lightning.itga.com.au (8.9.3/8.9.3) with ESMTP id PAA22928; Wed, 17 Oct 2001 15:33:49 +1000 (EST) Message-Id: <200110170533.PAA22928@lightning.itga.com.au> X-Mailer: exmh version 2.4 05/15/2001 with nmh-1.0.4 From: Gregory Bond To: Zero Sum Cc: Greg Black , cjclark@alum.mit.edu, "Crist J. Clark" , Heath Nielson , Warner Losh , David Marker , freebsd-stable@FreeBSD.ORG Subject: Re: setenv() cores with NULL value [was Re: Gdm proplem on 4.4] In-reply-to: Your message of Wed, 17 Oct 2001 14:56:44 +1000. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 17 Oct 2001 15:33:49 +1000 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > One particular compiler returned something like "^AT". As far as I > am concerned that was a flaw both then and now. That was the > manufacturer I was talking about. This was probably the AT&T 3B series. There was famous code in some of the AT&T Unix utilities (troff from memory) that did if (strcmp(ptr, "^AT") == 0) { ..... } because whoever wrote the program had no idea about C. Dereferencing NULL pointers has been illegal C since the day C was invented. See if you can dig up K&R 1st edition (I've lost mine over the years...) That it would work at all on some systems is at best an artfact of the implementation, at worst a bug. On the 3B, they couldn't change what *0 returned if they wanted to (because page 0 contained IRQ vectors or some such). When Sun was porting Unix to the original Sun 1, they made the wise decision that page 0 (& hence NULL pointers) would raise SIGSEGV. They had to expend a collossal effort to remove all the NULL-pointer derefs from AT&T and Berkeley code in order to ship SunOs. They were still fixing NULL-pointer bugs in thing s like troff & nroff as late as SunOs 3.4. All of which is way OT for -stable..... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message