Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2001 15:33:49 +1000
From:      Gregory Bond <gnb@itga.com.au>
To:        Zero Sum <count@shalimar.net.au>
Cc:        Greg Black <gjb@gbch.net>, cjclark@alum.mit.edu, "Crist J. Clark" <cristjc@earthlink.net>, Heath Nielson <heath@cs.byu.edu>, Warner Losh <imp@harmony.village.org>, David Marker <marker_d@yahoo.com>, freebsd-stable@FreeBSD.ORG
Subject:   Re: setenv() cores with NULL value [was Re: Gdm proplem on 4.4] 
Message-ID:  <200110170533.PAA22928@lightning.itga.com.au>
In-Reply-To: Your message of Wed, 17 Oct 2001 14:56:44 %2B1000.

next in thread | raw e-mail | index | archive | help

> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110170533.PAA22928>