Referencing through a null pointer
There's too much damn' government
bp at pixar.uucp
Fri Apr 29 14:01:49 AEST 1988
In article <9946 at tekecs.TEK.COM> andrew at 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
More information about the Comp.unix.wizards
mailing list