Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!pasteur!ucbvax!ucsfcgl!pixar!bp From: bp@pixar.uucp (There's too much damn' government) Newsgroups: comp.unix.wizards Subject: Re: Referencing through a null pointer Message-ID: <1766@pixar.UUCP> Date: 29 Apr 88 04:01:49 GMT References: <4729@cup.portal.com> <1988Apr24.092740.8673@utzoo.uucp> <50676@sun.uucp> <2730@bsu-cs.UUCP> <9946@tekecs.TEK.COM> Sender: news@pixar.UUCP Reply-To: bp@pixar.uucp (Bruce Perens) Organization: Pixar -- Marin County, California Lines: 28 In article <9946@tekecs.TEK.COM> andrew@frip.gwd.tek.com (Andrew Klossner) writes: >We can sit here and smirk about how ideologically impure these fools >are who want a 0 at location 0, but the real world is full of hoary old >programs that run fine on a VAX and fail on the class of systems that >don't have a 0 at 0. NYIT has a product with an embedded PDP-11 Version-6 UNIX, running tons of hoary 5 and 10 year-old programs. About two years ago I hacked the memory management of this system to make the low 64 bytes of data space invalid. That day about a dozen programs that had been buggy for years were fixed, as null-pointer references started dumping core. Most of those programs had uninitialized structure pointers that read or wrote a few words above the zero in the first word of the address space, causing all kinds of un-traceable problems. Once the system could tell us about null-pointer references, it was only a few hours work to fix them. I think VAX unix should make the low page of user space invalid so that these bugs would be trapped as they are on the Sun. The only complication would be with the PDP-11 emulation on older VAXes, which insists on running out of the low 64k of a process address space. Talk about brain-damage - there wasn't a base register for the PDP-11 emulation space. There's no reason for architects of new systems to reduce overall system reliability by not trapping address-zero references. Bruce Perens