Comment 5 for bug 881236

Revision history for this message
Loïc Minier (lool) wrote : Re: valgrind on amd64 no longer works with 32-bit binaries

Oh wow, sorry for the thinko, I actually typed gcc -m64 machinally instead of -m32; indeed I can reproduce your issue with Ubuntu precise / 12.04 and -m32.

I also confirmed that the initial idea of installing libc6-dbg:i386 was the right one, albeit it has conflicts.

After unpacking /usr/lib/debug/lib/i386-linux-gnu from /libc6-dbg_2.13-20ubuntu5_i386.deb, valgrind passed.

So what this means is that since Ubuntu 11.10, you need to install the multiarch debugging symbols for libc on i386 before valgrind-ing 32-bits binaries on an amd64 system; theoritically this should be achieved with:
apt-get install libc6-dbg:i386

but this breaks with:
Unpacking libc6-dbg:i386 (from .../libc6-dbg_2.13-20ubuntu5_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libc6-dbg_2.13-20ubuntu5_i386.deb (--unpack):
 './usr/lib/debug/usr/lib/pt_chown' is different from the same file on the system

due to file conflicts

I guess it means we need to break the debugging symbols into two packages, libc-bin-dbg and libc6-dbg.

I don't think there is anything to change in valgrind as I can't think of a way to automatically pull in valgrind's i386-debugging deps, so I'm reassigning the bug to eglibc for the -dbg packaging changes.

Now, the -dbg packages come from Debian and should work in Ubuntu too, but Ubuntu has an additional -dbgsym repository which should have installable packages for i386 and amd64; theoritically, one should be able to add:
deb http://ddebs.ubuntu.com/ <your dist here> main restricted universe multiverse
to sources.list and then install libc6-dbgsym and libc6-dbgsym:i386; unfortunately this fails too because valgrind depends on libc6-dbg and libc6-dbg conflicts with libc6-dbgsym (on any arch); *sigh*.
  However I confirmed that forcing the installation of libc6-dbgsym:i386 solved the problem too.

This is likely going to affect Debian too as it moves to multiarch.