We run our program on a Linux virtual machine which compiles from linux-2.6.3-long-term. I want to run valgrind
on that machine, and I compile from source code in the suggested way.
./configure --prefix=/tmp/valgrind/
make
make install
Then, I copy the /tmp/valgrind
to my own Linux machine, I put it on the directory /data
, set the environment variables:
export PATH=$PATH:/data/valgrind/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/lib64:/data/valgrind/lib
export VALGRIND_LIB=/data/valgrind/lib/valgrind
The valgrind
can work, and can detect some other errors except memory leak. Here is the result of running valgrind ls -l
==2207==
==2207== Conditional jump or move depends on uninitialised value(s)
==2207== at 0x80F3CDE: ??? (in /bin/busybox)
==2207== by 0x80548ED: ??? (in /bin/busybox)
==2207==
==2207== Use of uninitialised value of size 4
==2207== at 0x80D8F77: ??? (in /bin/busybox)
==2207== by 0x8048866: ??? (in /bin/busybox)
==2207==
==2207== Conditional jump or move depends on uninitialised value(s)
==2207== at 0x80F0F55: ??? (in /bin/busybox)
==2207== by 0x80D8F49: ??? (in /bin/busybox)
==2207== by 0x8048866: ??? (in /bin/busybox)
==2207==
==2207== Conditional jump or move depends on uninitialised value(s)
==2207== at 0x80F1000: ??? (in /bin/busybox)
==2207== by 0x80D8F49: ??? (in /bin/busybox)
==2207== by 0x8048866: ??? (in /bin/busybox)
==2207==
==2207==
==2207== HEAP SUMMARY:
==2207== in use at exit: 0 bytes in 0 blocks
==2207== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==2207==
==2207== All heap blocks were freed -- no leaks are possible
==2207==
==2207== For counts of detected and suppressed errors, rerun with: -v
==2207== Use --track-origins=yes to see where uninitialised values come from
==2207== ERROR SUMMARY: 2390 errors from 117 contexts (suppressed: 0 from 0)
The total heap usage is all zero. And I find someone has already meet the same problem: cross-compiled Valgrind does not detect obvious leaks Is it a known issue? The link above did not tell how to fix it, anyone know?