Reputation: 519
I have installed valgrind with no problems but when running it I keep getting the following error:
valgrind: failed to start tool 'memcheck' for platform 'amd64-linux': No such file or directory
I have adjusted my bash file accordingly. I added the following path: /usr/bin/valgrind
from using: which valgrind
command and it's still not working. Then I added the path:/usr/lib/valgrind
and it is still not working. I think I am confused about the correct local directory for using Ubuntu.
I am using:
export VALGRIND_LIB="/usr/lib/valgrind"
Do I have to add my local directory first?
Upvotes: 10
Views: 28397
Reputation: 61
This error is seen when 32 bit valgrind is used for 64 bit executable. Install 64 bit version of valgrind to resolve the issue.
yum install valgrind.x86_64
Upvotes: 0
Reputation: 2316
None of the solutions proposed worked for me, so I enabled all optional modules:
./configure --enable-only64bit --enable-inner --enable-lto --enable-tls
et voila, it worked.
Upvotes: 0
Reputation: 55
As the others indicated above, you need export VALGRIND_LIB="path-to-valgrind-lib". If "/usr/lib/valgrind" or "/usr/local/lib/valgrind" does not work, check "/usr/lib/x86_64-linux-gnu/valgrind" too if you are on linux.
Upvotes: 0
Reputation: 11
Also make sure you are using a 64bit valgrind for 64 bit executable, using a 32 bit valgrind on a 64 bit exe resuts in this error
/tmp>file /usr/bin/valgrind /usr/bin/valgrind: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
/tmp>file a.out a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
/tmp>valgrind a.out valgrind: failed to start tool 'memcheck' for platform 'amd64-linux': No such file or directory
Upvotes: 0
Reputation: 2121
I built valgrind from source and the posted answer did not work for me but this did:
e.g. how i configured:
./configure --prefix=$HOME/local/valgrind
What I added to my ~/.bashrc
export VALGRIND_LIB=$HOME/local/valgrind/libexec/valgrind
Seems like it needed libexec
, not lib
Upvotes: 18
Reputation: 1136
export VALGRIND_LIB=<where libexec/valgrind is|where massif-arm64-linux is>
Upvotes: 0
Reputation: 132
add "export VALGRIND_LIB=/usr/lib/valgrind/"(or /usr/local/lib/valgrind/ or other place where you install your valgrind lib) into ~/.bashrc
Upvotes: 10
Reputation: 6936
You shouldn't need to set any environment variables, unless you are working on the code of Valgrind itself.
Just run /usr/bin/valgrind. This will then run /usr/lib/valgrind/memcheck-amd64-linux and preload some .so files in the same directory.
I don't have much experience with Debian/Ubuntu, but if you installed it with snap then afaict you should use the --classic option.
Upvotes: 0