Messing with 0 ptr on m68020 & sys V / 68

Henry Spencer henry at utzoo.uucp
Tue Nov 29 06:46:19 AEST 1988


In article <784 at clinet.FI> riku at clinet.fi (Riku Kalinen) writes:
>Seems that my process's address space contains 1 k read-only nulls in
>very beginnig.
>
>  1) Why? This causes reference thru 0 ptr to return 0 instead of core dump.

Somebody is making a concession to badly-written programs.  Sun had to bite
the bullet and fix this because the Sun 1 just couldn't do "*0", and their
fixes got propagated back into 4.nBSD.  System V, especially its early
releases, was a very different story, and provided considerable incentive
for having a readable location 0.

>  2) Who sets up process's memory when it is started? Kernel?

Right.  Actually it's a three-way collaboration between the kernel, the
details specified by ld, and the file format (which limits what ld can say).
-- 
SunOSish, adj:  requiring      |     Henry Spencer at U of Toronto Zoology
32-bit bug numbers.            | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list