|
From: John R. <jr...@bi...> - 2009-08-04 03:45:09
|
On 08/03/2009 06:31 PM, Ayan Chowdhury wrote: > valgrind: mmap(0x38000000, 1503232) failed in UME with error 22 (Invalid argument). > valgrind: this can be caused by executables with very large text, data or bss segments. First, determine exactly _why_ there is an error 22 (Invalid argument). What does "readelf --segments my_app" show? Turn on verbose and debugging. It will be helpful to see how valgrind's address space manager has apportioned the whole address space. When the error 22 occurs, what does "cat /proc/<pid>/maps" show [do this from another process]? If the error 22 is caused by a conflict over a specific virtual address, then which virtual address is it, and who is contending for it? Run valgrind under strace to see all the mmap syscalls. (Approximately: "strace -o strace.out -e trace=mmap valgrind my_app".) If the error 22 is merely a symptom of "not enough address space to go around", then you may be able to "buy" 33% more space. Re-build valgrind for i686 with 0x38000000 changed to 0x60000000; grep the various Makefiles [and other build control files] of the valgrind tree. Then run your app, under the control of your new custom valgrind, on a x86_64 machine that does support a 32-bit i686 execution environment. In most cases such a 32-bit i686 environment running on an x86_64 offers almost 4GB of address space for user mode, in contrast to the typical 3GB that an actual i686 offers for user mode address space. -- |