|
From: Tom H. <to...@co...> - 2010-09-08 13:46:59
|
On 08/09/10 14:25, Seagle, Roger Lee wrote: > The addresses in many of these functions do not even correspond to the > correct memory map of the program, when doing a vmmap -pid #, where # is > the pid of the running program. Is this just a bug in my code? Or > problems with handling Mac OS X ASLR? Or even a problem with Valgrind's > support of Mac OS X Snow Leopard? Any help with this issue is greatly > appreciated. You are making a (probably false) assumption that code in a shared library will be loaded at the same address every time a program is run. That certainly isn't true on linux, at least if various address space randomisation options are turned on in the kernel. It or may not be true on your platform. It is even less likely to be true between valgrind and non-valgrind runs of the program however as valgrind reserves some address space for itself and will force shared libraries to load outside that area of address space if possible, overriding the default address they were linked for. Basically, shared libraries are relocatable and you shouldn't assume they will always be in the same place in memory. Tom -- Tom Hughes (to...@co...) http://compton.nu/ |