[needs-packaging] valgrind on amd64 no longer works with 32-bit binaries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
valgrind (Ubuntu) |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
valgrind works as expected on 64-bit binaries, when using a x86-64 installation...
[icculus@taise ~]$ cat hello.c
#include <stdio.h>
int main(void) { printf("hello.\n"); return 0; }
[icculus@taise ~]$ gcc -m64 -o hello hello.c
[icculus@taise ~]$ file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
[icculus@taise ~]$ valgrind ./hello
==18291== Memcheck, a memory error detector
==18291== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==18291== Using Valgrind-
==18291== Command: ./hello
==18291==
hello.
==18291==
==18291== HEAP SUMMARY:
==18291== in use at exit: 0 bytes in 0 blocks
==18291== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==18291==
==18291== All heap blocks were freed -- no leaks are possible
==18291==
==18291== For counts of detected and suppressed errors, rerun with: -v
==18291== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
...however, it does not work with 32-bit binaries...
[icculus@taise ~]$ gcc -m32 -o hello hello.c
[icculus@taise ~]$ file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
[icculus@taise ~]$ valgrind ./hello
==18492== Memcheck, a memory error detector
==18492== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==18492== Using Valgrind-
==18492== Command: ./hello
==18492==
valgrind: Fatal error at startup: a function redirection
valgrind: which is mandatory for this platform-tool combination
valgrind: cannot be set up. Details of the redirection are:
valgrind:
valgrind: A must-be-redirected function
valgrind: whose name matches the pattern: index
valgrind: in an object with soname matching: ld-linux.so.2
valgrind: was not found whilst processing
valgrind: symbols from the object with soname: ld-linux.so.2
valgrind:
valgrind: Possible fixes: (1, short term): install glibc's debuginfo
valgrind: package on this machine. (2, longer term): ask the packagers
valgrind: for your Linux distribution to please in future ship a non-
valgrind: stripped ld.so (or whatever the dynamic linker .so is called)
valgrind: that exports the above-named function using the standard
valgrind: calling conventions for this platform. The package you need
valgrind: to install for fix (1) is called
valgrind:
valgrind: On Debian, Ubuntu: libc6-dbg
valgrind: On SuSE, openSuSE, Fedora, RHEL: glibc-debuginfo
valgrind:
valgrind: Cannot continue -- exiting now. Sorry.
Please note that "lib6-dbg" is installed on this system...
[icculus@taise ~]$ sudo apt-get install libc6-dbg
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dbg is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
This worked with 32-bit binaries in the past (perhaps as recently as 11.04, but I can't say for certain).
This is happening on a fresh 11.04 x86-64 desktop install, default Ubuntu (not Kubuntu, etc). There are some non-default packages installed, like multilib-gcc, as you can tell by the "gcc -m32" command line working, but I don't think these are causing issues.
Let me know if you need more information.
--ryan.
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: valgrind 1:3.6.1-0ubuntu3
ProcVersionSign
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelMo
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Tue Oct 25 01:13:48 2011
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: valgrind
UpgradeStatus: No upgrade log present (probably fresh install)
tags: | added: needs-packaging |
Works for me with 1:3.6.1-6ubuntu1 from Ubuntu precise:
gcc -m64 -o hello hello.c
valgrind ./hello
==20954== Memcheck, a memory error detector
==20954== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==20954== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==20954== Command: ./hello
==20954==
hello.
==20954==
==20954== HEAP SUMMARY:
==20954== in use at exit: 0 bytes in 0 blocks
==20954== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==20954==
==20954== All heap blocks were freed -- no leaks are possible
==20954==
==20954== For counts of detected and suppressed errors, rerun with: -v
==20954== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
I don't see which packaging change could have fixed this, so this might be a difference in our installed packages; one thing I would have thought would help is installing libc6-dbg:i386, but it turns out it's *not* installed on my system.
However my libc6-dbg:amd64 package does ship /usr/lib/ debug/lib32/ libc-2. 13.so and others.