From: utzoo!decvax!harpo!seismo!rlgvax!guy Newsgroups: net.unix-wizards Title: Re: Questions about nil-pointer dereferences (the "plague") Article-I.D.: rlgvax.181 Posted: Mon Apr 4 12:50:23 1983 Received: Tue Apr 5 03:22:25 1983 References: sri-arpa.798 If a program breaks because there isn't a null string at location 0, that program deserves to break. It's *very* easy to generate a null string; "" generally suffices. And it's *very* easy to say: if (p != NULL && whatever(p)) instead of if (whatever(p)) or whatever the erroneous code was doing. It's only two instructions on a VAX.... Several machines (the SUN and the CCI Power/5, both 68000-based, for example) use the lower part of the address space for the kernel, and dereferencing null pointers on those systems causes a fault (as it should!). VMS also maps page 0 out of the address space; I cast my vote either for demand-paged pure executables (or *all* executables) explicitly starting the text at 1024 and setting page 0's permissions to no read, no write, no execute, no way, or adding a new executable type which does this. Guy Harris RLG Corporation {seismo,mcnc,we13}!rlgvax!guy