From: Darin Wayrynen (darin@infograph.com)
Date: 03/18/93


From: darin@infograph.com (Darin Wayrynen)
Subject: Re: Process protection and Debugging.
Date: Thu, 18 Mar 1993 14:45:00 GMT

In article <1993Mar10.151725.21992@donau.et.tudelft.nl> wolff@liberator.et.tudelft.nl (Rogier Wolff) writes:
>
>Linux places the executable at address 0. This region
>is therefore "read-execute". This should be
>prevented:
>

[deletions]

>
>This program should dump core. This makes it much easier to get
>an indication on NULL pointer dereferences.
>
>It actually dumps core on our SUN and DEC machines. It reports
>a bunch of zeroes on our HP's and AIX machines. I think it is
>best to trap to a segmentation violation to force people to
>watch out for this "non-portability".
>

But it also breaks code, because not everyone assumes that you
can't pass null pointers to string functions for example. On
Sun's that causes a core dump, but on HP's/PC's passing nulls
to strcat, strcpy, etc (as second operands) is perfectly valid.

>
>(If a system allows sloppy programming, people will write
>sloppy programs. If you force them to look into a problem
>they will fix the problem before they release the program
>to the net: A good thing.)

That I agree with.

Eric Youngdale is working on code that will leave page 0
unmapped, and cause programs that do dereference NULL to
dump core... Don't know if it is going to be an official
change or not though...

-- 
==========================================================================
Darin Wayrynen                        UUCP:     uunet!uupsi4!infogrf!darin
Paragon Consulting Group              INTERNET: darin@infograph.com
                                      PHONE:    602-437-9566