What machines core dump on deref of NULL?
Brian Chapman
chapman at sco.COM
Sun Jul 1 09:44:02 AEST 1990
aryeh at eddie.mit.edu (Aryeh M. Weiss) writes:
>Under SCO Xenix V/386, 386 native 32-bit (`small' model) programs dump core
>on NULL deref. This is because location 0 is not allocated to the data space.
>Actually, stack grows down from 0x1880000, while static and heap storage grow
>up from this location (although this offset can be changed by a linker option).
Yes but we kluged it (for the application support reasons given previously)
So that if you referenced 0 it would be _added_ to you address space
as a readonly address with 0 in it. So writes cause SEGV at least.
Under Unix 3.2 both text and data segments are the same piece
of memory so a more normal arrangement exist text is loaded at
0 in *the* address space, and NULL data pointers point at the
readonly text address 0 (which is not zero).
>The situation is drastically different for 286 16-bit programs under Xenix 386
>or Xenix 286. Small model 16-bit programs do not core dump because location 0
>IS in the memory map.
Which steps were taken in libc to make sure that 0 was loaded
with 0. Again I know this is a kluge but.... (shrug).
--
Brian Chapman uunet!sco!chapman
Pay no attention to the man behind the curtain!
More information about the Comp.unix.wizards
mailing list