TransWikia.com

Unable to use Valgrind on executable file for ARM-Linux

Unix & Linux Asked by Toan Tran on November 19, 2021

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?

One Answer

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 leads 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 do what you want.

Answered by Federico Marsiglia on November 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP