|
From: Krishna D. <Kri...@ar...> - 2013-02-15 12:39:17
|
Hi All, I am trying to use valgrind on mips64 (little-endian) target and running into these errors: /valgrind/bin # ./valgrind ZZZ1 ZZZ2 --1238-- core : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- tool : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- dinfo : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- (null) : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- demangle: 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- exectxt : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- errors : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- ttaux : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B ==1238== ==1238== Valgrind's memory management: out of memory: ==1238== newSuperblock's request for 4194304 bytes failed. ==1238== 13697024 bytes have already been allocated. ==1238== Valgrind cannot continue. Sorry. ==1238== ==1238== There are several possible reasons for this. ==1238== - You have some kind of memory limit in place. Look at the ==1238== output of 'ulimit -a'. Is there a limit on the size of ==1238== virtual memory or address space? ==1238== - You have run out of swap space. ==1238== - Valgrind has a bug. If you think this is the case or you are ==1238== not sure, please let us know and we'll try to fix it. ==1238== Please note that programs can take substantially more memory than ==1238== normal when running under Valgrind tools, eg. up to twice or ==1238== more, depending on the tool. On a 64-bit machine, Valgrind ==1238== should be able to make use of up 32GB memory. On a 32-bit ==1238== machine, Valgrind should be able to use all the memory available ==1238== to a single process, up to 4GB if that's how you have your ==1238== kernel configured. Most 32-bit Linux setups allow a maximum of ==1238== 3GB per process. ==1238== ==1238== Whatever the reason, Valgrind cannot continue. Sorry. /valgrind/bin # While debugging this error further on the internet, I found a relevant patch saying solution to this error: http://bugsfiles.kde.org/attachment.cgi?id=63489 But this patch is already there in the valgrind releases, I am working on. The steps that I used for setting up the valgrind are as follows: I) I downloaded the valgrind source-code and patched it for mips64 by using the below commands: $ svn co -r13228 svn://svn.valgrind.org/valgrind/trunk r13228 $ cd r13228/VEX $ svn up -r2633 $ patch -p0 < ../../valgrind_mips64_r13228_2633_VEX.diff $ cd .. $ patch -p0 < ../valgrind_mips64_r13228_2633.diff II)For cross-compilation of valgrind for mips64 architecture, I setup the environment variables (CC, AS, AR, CPP, LD, CCAS, LD_LIBRARY_PATH) according to my cross-compilation mips toolchain and then used these commands $ ./autogen.sh $ ./configure --host=mips64el-linux-gnu --target=mips64el-linux-gnu --build=mips64el-linux CFLAGS="-EL -mips64 -mplt -msys32 -mhard-float" -prefix=/home/valgrind_r13228 $ make $ make install III)I copied the valgrind directories bin and lib into my target rootfs inside the directory "/valgrind". IV)On target: Executed these commands: ~ # export VALGRIND_LIB=/valgrind/lib/valgrind ~ # export LD_LIBRARY_PATH=/lib32:/valgrind/lib/valgrind ~ # cd /valgrind/bin /valgrind/bin # ./valgrind ZZZ1 ZZZ2 --1238-- core : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- tool : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- dinfo : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- (null) : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- demangle: 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- exectxt : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- errors : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B --1238-- ttaux : 0/ 0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd, 0/ 0 max/curr, B ==1238== ==1238== Valgrind's memory management: out of memory: ==1238== newSuperblock's request for 4194304 bytes failed. ==1238== 13697024 bytes have already been allocated. ==1238== Valgrind cannot continue. Sorry. Kindly provide me some pointers to debug the issue further. Please let me know if I am missing anything in the steps mentioned above. Thanks in advance. Regards, Krishna Dwivedi =============================================================================== Please refer to http://www.aricent.com/legal/email_disclaimer.html for important disclosures regarding this electronic communication. =============================================================================== |