stack space mapping question

Bill Mitchell whm at arizona.UUCP
Sat Feb 2 19:45:32 AEST 1985


I have a question about how the Unix kernel manages stack space.  Suppose
one has a process that grabs a couple of hundred kbytes of stack space for
use in a subroutine.  Obviously, while this space lies between the stack
pointer and the end of the stack, the pages in the region are part of
the address space of the process.  My question is:  If the process returns
from the subroutine, are those stack pages used by the subroutine still
in the process's address space?

It would seem like a reasonable thing for the system to not consider the
pages to be in the process's address space, i.e., consider the stack page
into which the sp points to be the lowest stack page in the process's
address space. (Note that a down-growing stack is assumed for purposes
of discussion.)  On 4.2 on Suns and Vaxs, the system does allow (based
on empirical studies rather than code examination) access to pages below
the sp as long as they were properly contained in the stack at some point
in time.  Is this implementation dependent or is this some sort of standard
Unix "feature"?

					Thanks in advance,
					Bill Mitchell
					whm.arizona at csnet-relay
					{ihnp4,noao,mcnc,utah-cs}!arizona!whm



More information about the Comp.unix.wizards mailing list