2

I'm having problem using Valgrind on "arm-linux" executable file.

I downloaded Valgrind from the main page here : http://valgrind.org/downloads/. Run the following command to install it:

sudo ./configure
sudo make
sudo make install

On Ubuntu, I try with an executable HelloWorld file compiled "HelloWorld.c" using Linux GCC. Valgrind runs without any problem.

Then I try it on an executable file compiled from using Cross-compiler for ARM-Linux (this executable file is compiled to run on an embedded device) and I got this error:

valgrind: failed to start tool 'memcheck' for platform 'arm-linux': No such file or directory

I have digged around on google and couldn't find much information, I tried:

export VALGRIND_LIB=/usr/local/lib/Valgrind

It still show the same error, what am I doing wrong?

  • 1
    I take it you’re not running Valgrind on an ARM system, is that correct? – Stephen Kitt Nov 21 '17 at 17:21
  • I'm running it on my Ubuntu 16. Do I have to run it on the device, which the executable file compiled for? – Toan Tran Nov 22 '17 at 1:08
0

Valgrind is trying to launch a suitable executable for the 'memcheck' tool but can't find one. This is due to the fact that the './configure' script created a Makefile viable for the installation of a valgrind package specific for the host architecture (your PC), but you are feeding it an executable meant for another one (ARM in your case); this lead to a situation in which you lack the ARM specific tools to do the job. I had a similar problem with the 'callgrind' tool (also part of the valgrind package), and by doing an strace I came up with the following line:

execve("/usr/local/lib/valgrind/callgrind-arm-linux", ["valgrind", "--tool=callgrind", "Application.STM.out"], [/* 19 vars */]) = -1 ENOENT (No such file or directory)

which means that I miss the ARM specific callgrind binary.

elaborating on that, what you (and me not so long ago) are trying to do is not supported by valgrind, so you want to use an emulator to get the job done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.