dumping core on *(NULL) is not a function of your processor

Paul Vixie vixie at palo-alto.DEC.COM
Fri Jul 29 16:47:36 AEST 1988


In article <11955 at ncoast.UUCP> allbery at ncoast.UUCP (Brandon S. Allbery) writes:
# [...] 386 and 680x0 systems, both of which tend to dump core on *(NULL),
# the world's favorite Vax-ism.)

If you map a page there, *(NULL) will find it.  If you don't, you get a page
fault.  If your page fault handler decides it's a bad address, it'll segfault
you.

It all depends on the linker, the loader, and the virtual memory system.

VMS (which runs on VAXes) doesn't put any page at location 0, just to catch
this type of bug.  The VAX/VMS C manual warns in its portability section that
*(NULL) will cause rude things to happen to your program.

Summary: don't blame it on the Vax, blame it on Real 4.3BSD.  We're all sort
of expecting an ld option to appear in 4.4 that makes this an option.  It's
complicated because the kernel need to know about it also, and nobody wants
to allocate another magic number (or another set of them, really) and it's
hard to decide how else to pass the option in to the kernel.  Got any ideas?
-- 
Paul Vixie
Digital Equipment Corporation	Work:  vixie at dec.com	Play:  paul at vixie.UUCP
Western Research Laboratory	 uunet!decwrl!vixie	   uunet!vixie!paul
Palo Alto, California, USA	  +1 415 853 6600	   +1 415 864 7013



More information about the Comp.unix.wizards mailing list