[I'm resending in plain-text sorry for not configuring before sending...]

Dear Mr. Maintainer,

I have problems running 32-bit binaries in my 64-bit valgrind, however
this likely a bug related to eglibc or possibly in how valgrind
depends on eglibc's packages. I expect that both 32-bit and 64-bit
binaries can be run inside valgrind (or at least that there are
packages recommended by valgrind that I install to do so).

The output from my 64-bit valgrind when running a 32-bit binary:

        --22537-- Reading syms from /lib32/ld-2.13.so (0x4400000)
        --22537--    object doesn't have a symbol table
        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:      strlen
        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

As far as I can see /lib32/ld-2.13.so (installed by libc6-i386) is
missing a .gnu_debuglink section which points to a corresponding
debug-version located under /usr/lib/debug. The reason for this is
likely that the installed libc6-dbg does not contain any libraries
with debug information for the libraries installed by libc6-i386.

        --23048-- Reading syms from /lib/x86_64-linux-gnu/libc-2.13.so 
(0x4a22000)
        --23048--   Considering /lib/x86_64-linux-gnu/libc-2.13.so ..
        --23048--   .. CRC mismatch (computed 9d6b2fdb wanted f9c6fbfb)
        --23048--   Considering 
/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.13.so ..
        --23048--   .. CRC is valid

For 64-bit binaries (shown above) /lib/x86_64-linux-gnu/ld-2.13.so
(installed by libc6) does have a .gnu_debuglink section pointing to
the debug-version of located in /usr/lib/debug (more specifically
/usr/lib/debug/lib/x86_64-linux-gnu/ld-2.13.so) which is installed by
libc6-dbg.

This small script collects some (hopefully relevant) information and
shows concisely what the problem is:
        #!/bin/bash
        dpkg -l valgrind | tail -1
        dpkg -l gcc | tail -1
        dpkg -l libc6 | tail -1
        dpkg -l libc6-dbg | tail -1
        dpkg -l libc6-i386 | tail -1
        dpkg -l linux-image-amd64 | tail -1
        echo -e '#include <stdio.h>\nint main() { printf("goodbye world!\\n"); 
}' > testing.c
        gcc -m64 -o ./testing-64 testing.c
        echo "=============64646464============="
        valgrind -v ./testing-64
        gcc -m32 -o ./testing-32 testing.c
        echo "=============32323232============="
        valgrind -v ./testing-32

A log of the output of the script is attached.

If there is any other information you need to help me solve this
problem I'm naturally happy to provide it. :)

 / Sebastian

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages valgrind depends on:
ii  libc6      2.13-27
ii  libc6-dbg  2.13-27

Versions of packages valgrind recommends:
ii  gdb  7.4really-1

Versions of packages valgrind suggests:
pn  alleyoop     <none>
pn  kcachegrind  4:4.7.4-3
pn  valkyrie     <none>

-- no debconf information
                                                                                
  
ii  valgrind                              1:3.7.0-3                       
memory debugger and profiler
ii  gcc                                   4:4.6.2-4                       GNU C 
compiler
ii  libc6:amd64                           2.13-27                         
Embedded GNU C Library: Shared libraries
ii  libc6-dbg:amd64                       2.13-27                         
Embedded GNU C Library: detached debugging symbols
ii  libc6-i386                            2.13-27                         
Embedded GNU C Library: 32-bit shared libraries for AMD64
ii  linux-image-amd64                     3.2+44                          Linux 
for 64-bit PCs (meta-package)
=============64646464=============
==23345== Memcheck, a memory error detector
==23345== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==23345== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==23345== Command: ./testing-64
==23345== 
--23345-- Valgrind options:
--23345--    --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--23345--    -v
--23345-- Contents of /proc/version:
--23345--   Linux version 3.2.0-2-amd64 (Debian 3.2.12-1) 
(debian-ker...@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-1) ) #1 SMP 
Tue Mar 20 18:36:37 UTC 2012
--23345-- Arch and hwcaps: AMD64, amd64-sse3-cx16
--23345-- Page sizes: currently 4096, max supported 4096
--23345-- Valgrind library directory: /usr/lib/valgrind
--23345-- Reading syms from /tmp/test/testing-64 (0x400000)
--23345-- Reading syms from /lib/x86_64-linux-gnu/ld-2.13.so (0x4000000)
--23345--   Considering /lib/x86_64-linux-gnu/ld-2.13.so ..
--23345--   .. CRC mismatch (computed 6da8e8c1 wanted c5172abb)
--23345--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.13.so ..
--23345--   .. CRC is valid
--23345-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux (0x38000000)
--23345--    object doesn't have a symbol table
--23345--    object doesn't have a dynamic symbol table
--23345-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--23345-- Reading suppressions file: /usr/lib/valgrind/default.supp
==23345== embedded gdbserver: reading from 
/tmp/vgdb-pipe-from-vgdb-to-23345-by-sebras-on-hostname
==23345== embedded gdbserver: writing to   
/tmp/vgdb-pipe-to-vgdb-from-23345-by-sebras-on-hostname
==23345== embedded gdbserver: shared mem   
/tmp/vgdb-pipe-shared-mem-vgdb-23345-by-sebras-on-hostname
==23345== 
==23345== TO CONTROL THIS PROCESS USING vgdb (which you probably
==23345== don't want to do, unless you know exactly what you're doing,
==23345== or are doing some strange experiment):
==23345==   /usr/lib/valgrind/../../bin/vgdb --pid=23345 ...command...
==23345== 
==23345== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==23345==   /path/to/gdb ./testing-64
==23345== and then give GDB the following command
==23345==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=23345
==23345== --pid is optional if only one valgrind process is running
==23345== 
--23345-- REDIR: 0x4016720 (strlen) redirected to 0x380438c7 (???)
--23345-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so 
(0x4022000)
--23345--    object doesn't have a symbol table
--23345-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so 
(0x4024000)
--23345--    object doesn't have a symbol table
--23345-- REDIR: 0x4016590 (index) redirected to 0x4029060 (index)
--23345-- REDIR: 0x4016610 (strcmp) redirected to 0x402a020 (strcmp)
--23345-- Reading syms from /lib/x86_64-linux-gnu/libc-2.13.so (0x4a22000)
--23345--   Considering /lib/x86_64-linux-gnu/libc-2.13.so ..
--23345--   .. CRC mismatch (computed 9d6b2fdb wanted f9c6fbfb)
--23345--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.13.so ..
--23345--   .. CRC is valid
--23345-- REDIR: 0x4aa55d0 (strcasecmp) redirected to 0x4022640 
(_vgnU_ifunc_wrapper)
--23345-- REDIR: 0x4aa7890 (strncasecmp) redirected to 0x4022640 
(_vgnU_ifunc_wrapper)
--23345-- REDIR: 0x4aa3630 (__GI_strrchr) redirected to 0x4028e80 (__GI_strrchr)
--23345-- REDIR: 0x4aa1b50 (__GI_strlen) redirected to 0x40293c0 (__GI_strlen)
goodbye world!
--23345-- REDIR: 0x4a9c780 (free) redirected to 0x4027a40 (free)
==23345== 
==23345== HEAP SUMMARY:
==23345==     in use at exit: 0 bytes in 0 blocks
==23345==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==23345== 
==23345== All heap blocks were freed -- no leaks are possible
==23345== 
==23345== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
--23345-- 
--23345-- used_suppression:      4 dl-hack3-cond-1
==23345== 
==23345== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
=============32323232=============
==23354== Memcheck, a memory error detector
==23354== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==23354== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==23354== Command: ./testing-32
==23354== 
--23354-- Valgrind options:
--23354--    --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--23354--    -v
--23354-- Contents of /proc/version:
--23354--   Linux version 3.2.0-2-amd64 (Debian 3.2.12-1) 
(debian-ker...@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-1) ) #1 SMP 
Tue Mar 20 18:36:37 UTC 2012
--23354-- Arch and hwcaps: X86, x86-sse1-sse2
--23354-- Page sizes: currently 4096, max supported 4096
--23354-- Valgrind library directory: /usr/lib/valgrind
--23354-- Reading syms from /lib32/ld-2.13.so (0x4400000)
--23354--    object doesn't have a symbol table

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:      strlen
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.

Reply via email to