|
From: Nicholas N. <nj...@ca...> - 2003-08-29 11:23:55
|
Hi, I noticed this comment in memcheck/mac_replace_strmem.c: We assume that the address ranges do not wrap around (which is safe since on Linux addresses >= 0xC0000000 are not accessible and the program will segfault in this circumstance, presumably). AIUI, this is because 0xc0000000 and above is used by the kernel. Is it safe to rely on this? Could the value change, eg. if someone fiddled with and recompiled their kernel? Is there some nicer way to find the maximum legitimate user-space address, eg. a macro or something similar? Thanks. N |
|
From: Jeremy F. <je...@go...> - 2003-09-01 20:38:14
|
On Fri, 2003-08-29 at 04:23, Nicholas Nethercote wrote: > AIUI, this is because 0xc0000000 and above is used by the kernel. > > Is it safe to rely on this? Could the value change, eg. if someone > fiddled with and recompiled their kernel? Is there some nicer way to find > the maximum legitimate user-space address, eg. a macro or something > similar? I think the kernel always starts the user stack at the very top of the user address space, so you can can /proc/self/maps to see what the highest address present is. 0xc0000000 certainly isn't a constant - it can be easily changed as part of the kernel compilation options. There is also an experimental patch for 2.6 which allows a full 4G user address space, so it may be possible to wrap from one end of the user address space to the other. J |