Referencing through a null pointer

Dennis L. Mumaugh dlm at cuuxb.ATT.COM
Tue Apr 26 09:04:19 AEST 1988


In  article  <50676 at sun.uucp  guy at gorodish.Sun.COM  (Guy  Harris)
writes:

  ??>  Both System V and Berklix inherited the  problem,  but  it
  ??>  *mostly*  got  cleaned  out of Berklix by early efforts at
  ??>  Sun that were fed back  to  Berkeley.  It  keeps  creeping
  ??>  back,  since  Berklix  (unlike Sunnix) does not set up its
  ??>  page map to trap accesses to location 0.  Unless it's been
  ??>  fixed  quite  recently,  System  V  still has the problem,
  ??>  since AT&T likewise does not map out 0.

GH> That's somewhat hardware dependent; AT&T's releases don't, but
GH> people  who  port  it to their hardware can.  Also, the paging
GH> S5R2.2 release had a "-z" flag to the linker that set up a "no
GH> page  0"  executable;  alas,  this flag wasn't the default, so
GH> buggy programs didn't get fixed. (I seem to remember  a  claim
GH> that the '286 or '386 port of S5 has no location zero, and the
GH> Motorola 68K port may also have no location zero;  alas,  none
GH> of  the fixes made to programs that broke got folded back into
GH> the mainstream S5 releases.)

Yes, we were going to make -z the default and then we  discovered
that  we couldn't map out page 0 of the processes.  Seems that on
a WE32100 chip the  "gate"  instruction  wants  the  kernel  trap
vectors maped into the user virtual locations starting at 0. [The
the kernel gate tables reside in page 0.] That's also why we have
to  have  our  programs  load into the top half of vitrual memory
making all pointers negative ( try subtracting two pointers!).

On ports to other boxes it is possible to have page 0 mapped out.
And most do.
-- 
=Dennis L. Mumaugh
 Lisle, IL       ...!{ihnp4,cbosgd,lll-crg}!cuuxb!dlm



More information about the Comp.unix.wizards mailing list