[net.unix-wizards] stack limit

mbm@mit-cipg@mit-mc (02/14/83)

There is a potentially very nasty error in the machdep code released in
2.81; if you havent found out by now, maybe you never will, but the stack
limit register is not being set up correctly.  Contrary to what the DEC
documentation implies, the stack limit (the value of SP below which you
will get bus traps if you try to use it) is 400(octal) GREATER than the
value in the stack limit register (truncated to the high 8 bits).  
(Remember that putting a zero in SL sets the stack limit to
400, same as on machines  that dont have this wonderful register.)

Thus the machdep code should say  SL->r[0] = (caddr_t)(u.u_stack) -0400;

(Dont leave out the cast; u_stack is an int[].)

If you dont fix this, you will someday get inexplicable crashes, because
the stack limit will go off 400 locations too early.
--mike