Address space: what's safe?

Steve Blackburn Steve.Blackburn at
Fri Mar 7 09:54:27 EST 2003


I want to know (preferably at run time) what parts of the address
space are safe for me to use (in user space).

The context is the memory management subsystem of Jikes RVM, where
certain algorithms want as much virtual memory as possible with
various alignment restrictions etc.  Because we have all sorts of
constraints about alignments etc, we use mmap to get ourselves the
memory.  mmap does not tell you if a shared library is about to
clobber the space you just got or you're about to clobber a shared
library (at least not as far as I can tell!---if it can, then this
might be all I need).

To date we've approached it via statically defining safe start and end
ranges and have had to change those constants by trial and error as
new releases come out (new releases of the shared libraries, I
suppose)---I run our system on a new release and we suffer some
horrible memory corruption problem and then I find that a shared
library has been loaded over the top of an address range we previously
believed to be safe.

What we'd like is a way of establishing these ranges at run time, or
at worst, at build time.  We really want a map of what parts of the
address space are free for us to mess with, or an interface that tells
us what we can't use---so we can make our own map.

Any thoughts out there on the Canberra Linux list?



More information about the linux mailing list