5

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?

RKum
  • 758
  • 2
  • 12
  • 33

4 Answers4

2

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

RKum
  • 758
  • 2
  • 12
  • 33
2

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.

Axel Borja
  • 3,718
  • 7
  • 36
  • 50
0

Try re-running your configure script with the --enable-only32bit option:

 ./configure --enable-only32bit
troydj
  • 304
  • 2
  • 5
0

I installed the 32bit version of valgrind and it seems that it works now. The information about installing the 32bit version I took it from here

sop
  • 3,445
  • 8
  • 41
  • 84