Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

valgrind not building 32 bit rpm on 64 bit machine

Tags:

valgrind

I have 32 bit C application(running on 64 bit system) leaking memory.

Do debug it I have downloaded valgrind 3.8.1 from http://valgrind.org/downloads/. Did ./configure, make and make install to install valgrind.

But valgrind builds only 64 bit memcheck-amd64-linux binary. 32 bit memcheck is not getting built.

As a result I get below errors

# valgrind --tool=memcheck --time-stamp=yes -v --track-origins=yes --leak-check=yes /home/test_code32 --error-limit=no
valgrind: failed to start tool 'memcheck' for platform 'x86-linux': No such file or directory

Stracing valgrind gives me:

execve("/usr/local/lib/valgrind/memcheck-x86-linux", ["valgrind", "--tool=memcheck", "--time-stamp=yes", "-v", "--track-origins=yes", "--leak-check=yes", "/home/test_code32", "--error-limit=no"], [/* 60 vars */]) = -1 ENOENT (No such file or directory)
write(2, "valgrind: failed to start tool '"..., 94valgrind: failed to start tool 'memcheck' for platform 'x86-linux': No such file or directory
) = 94

I checked the ./configure output and it says:

checking for 32 bit build support... no

I am using gcc (SUSE Linux) 4.3.4.

Any idea how to get valgrind build 32 bit memcheck on 64 bit machine?

like image 792
RKum Avatar asked Oct 03 '22 14:10

RKum


2 Answers

I have resolved the issue. I installed 32-bit gcc support and then again built valgrind and it created the 32 bit memcheck.

like image 137
RKum Avatar answered Oct 07 '22 19:10

RKum


I had the same issue, and resolved it by setting an environment variable:

export VALGRIND_LIB=/YourValgrindInstallDirectory/lib/valgrind

which is the direcory where valgrind missing lib is.

like image 22
Axel Borja Avatar answered Oct 07 '22 17:10

Axel Borja