|
From: John R. <jr...@bi...> - 2012-09-07 12:49:47
|
> (void*)(u32)(sz_ptr); in 64bit platform! > So,Is there a way to make valgrind replace malloc allocate memory less than 4G? No. There is no command-line parameter, environment variable, etc. that will restrict allocations to have an address which is < 4G. In order to implement such a restriction, then you would have to modify the valgrind code that is inside the replace malloc machinery. One possibility is to use the MAP_32BIT flag of mmap(), but this would require the cooperation of valgrind's address space manager. Probably it would be easier fix the bug in "(void*)(u32)(sz_ptr)". Be happy that valgrind found that bug for you! It really is a bug; the app could start failing at any time (any upgrade to glibc, the linux kernel, any shared library used by the app, etc.) even without running valgrind. -- |