#928224 Valgrind is broken on armhf

Package:
src:valgrind
Source:
valgrind
Submitter:
Benjamin Wozniak
Date:
2022-07-06 12:51:07 UTC
Severity:
grave
Tags:
#928224#5
Date:
2019-04-30 09:13:21 UTC
From:
To:
Hi,
i encountered a bug in valgrind. I tried to analyze an application on an armhf
platform but valgrind didn't worked. It does not even work on /bin/true (output below).
Installed libc6 version: libc6-dgb:armhf 2.28-8

valgrind /bin/true

==12463== Memcheck, a memory error detector
==12463== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==12463== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==12463== Command: /bin/true
==12463==

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-armhf.so.3
valgrind:  was not found whilst processing
valgrind:  symbols from the object with soname: ld-linux-armhf.so.3
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:  Note that if you are debugging a 32 bit process on a
valgrind:  64 bit system, you will need a corresponding 32 bit debuginfo
valgrind:  package (e.g. libc6-dbg:i386).
valgrind:
valgrind:  Cannot continue -- exiting now.  Sorry.

Best regards,
Benjamin

#928224#10
Date:
2019-05-01 16:20:46 UTC
From:
To:
Hello Benjamin Wozniak,
I just wanted to help triaging this issue.

For this I started a qemu vexpress-a15 emulation
with current Buster armhf installed.

Unfortunately I could not reproduce this valgrind error.
Some more details about my test in attached file.

So maybe the valgrind maintainer will need some more
information about the system showing this behaviour.

Kind regards,
Bernhard

#928224#15
Date:
2019-05-03 05:21:44 UTC
From:
To:
Hi Bernhard,

thanks for your support. I installed the packages valgrind-dbg, libc6-l10n and locales
so that we can compare our systems. But the problem is still present.
I attached a file with my debugging output.

Kind regards,
Benjamin

#928224#20
Date:
2019-05-03 16:00:03 UTC
From:
To:
Hi Benjamin,
Maybe the commands below can reveal any difference?

Kind regards,
Bernhard


# From a VM running current buster with valgrind not showing a problem:

root@debian:~# ls -lisah /lib/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf/ld-2.28.so /lib/arm-linux-gnueabihf/ld-2.28.so
787943 104K -rwxr-xr-x 1 root root 104K Feb 28 06:56 /lib/arm-linux-gnueabihf/ld-2.28.so
787943 104K -rwxr-xr-x 1 root root 104K Feb 28 06:56 /lib/arm-linux-gnueabihf/ld-2.28.so
789695    0 lrwxrwxrwx 1 root root   10 Feb 28 06:56 /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 -> ld-2.28.so
789740    0 lrwxrwxrwx 1 root root   30 Feb 28 06:56 /lib/ld-linux-armhf.so.3 -> arm-linux-gnueabihf/ld-2.28.so

root@debian:~# md5sum /lib/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf/ld-2.28.so /lib/arm-linux-gnueabihf/ld-2.28.so
a4b6b7a988547a464b0c57a74b32f9c4  /lib/ld-linux-armhf.so.3
a4b6b7a988547a464b0c57a74b32f9c4  /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3
a4b6b7a988547a464b0c57a74b32f9c4  /lib/arm-linux-gnueabihf/ld-2.28.so
a4b6b7a988547a464b0c57a74b32f9c4  /lib/arm-linux-gnueabihf/ld-2.28.so

root@debian:~# gdb -q -ex 'b index' -ex 'q' --args /lib/arm-linux-gnueabihf/ld-2.28.so
Reading symbols from /lib/arm-linux-gnueabihf/ld-2.28.so...Reading symbols from /usr/lib/debug/.build-id/3c/95192f00377a31cf9a97cdbfe02020846ca790.debug...done.
done.
Breakpoint 1 at 0x12090: file ../sysdeps/arm/armv6/strchr.S, line 28.

root@debian:~# strace -f valgrind /bin/true 2>&1 | grep ld-linux-armhf.so.3
pread64(3, "/lib/ld-linux-armhf.so.3\0", 25, 340) = 25
open("/lib/ld-linux-armhf.so.3", O_RDONLY) = 4

#928224#27
Date:
2022-06-27 12:39:44 UTC
From:
To:
Confirmed on abel.d.org

% schroot -r -c $sessionid
% gdb /usr/bin/valgrind.bin
GNU gdb (Debian 12.1-2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/valgrind.bin...
Reading symbols from
/usr/lib/debug/.build-id/d3/59a9719a2a752d677ee819fce076e1969552ef.debug...
(gdb) r --help
Starting program: /usr/bin/valgrind.bin --help
process 31588 is executing new program: /usr/libexec/valgrind/memcheck-arm-linux

Program received signal SIGILL, Illegal instruction.
vgPlain_am_startup (sp_at_startup=3204445840) at
m_aspacemgr/aspacemgr-linux.c:1626
1626       init_nsegment(&seg);
(gdb) bt
#0  vgPlain_am_startup (sp_at_startup=3204445840) at
m_aspacemgr/aspacemgr-linux.c:1626
#1  0x580cc5e4 in valgrind_main (envp=0xbefff6a0, argv=0xbefff694,
argc=2) at m_main.c:1387
#2  _start_in_C_linux (pArgc=0xbefff690) at m_main.c:3081
#3  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

#928224#34
Date:
2022-06-27 13:00:24 UTC
From:
To:
% gdb "/usr/libexec/valgrind/memcheck-arm-linux"
GNU gdb (Debian 12.1-2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/libexec/valgrind/memcheck-arm-linux...
Reading symbols from
/usr/lib/debug/.build-id/c8/4acaae37749c83c7183bc7a37bbde299e52e82.debug...
(gdb) r
Starting program: /usr/libexec/valgrind/memcheck-arm-linux

Program received signal SIGILL, Illegal instruction.
vgPlain_am_startup (sp_at_startup=3204445888) at
m_aspacemgr/aspacemgr-linux.c:1626
1626       init_nsegment(&seg);
(gdb) bt full
#0  vgPlain_am_startup (sp_at_startup=3204445888) at
m_aspacemgr/aspacemgr-linux.c:1626
        seg = {kind = 0, start = 0, end = 0, smode = SmLower, dev = 0,
ino = 0, offset = 5376491600740352, mode = 3204445892, fnIdx =
-1090521408, hasR = 0 '\000', hasW = 160 '\240', hasX = 37 '%',
          hasT = 88 'X', isCH = 248 '\370'}
        suggested_clstack_end = <optimized out>
        __PRETTY_FUNCTION__ = "vgPlain_am_startup"
#1  0x580cc5e4 in valgrind_main (envp=0xbefff6cc, argv=0xbefff6c4,
argc=1) at m_main.c:1387
        loglevel = <optimized out>
        i = <optimized out>
        vex_archinfo = {hwcaps = 0, endness = 0, hwcache_info =
{num_levels = 0, num_caches = 0, caches = 0x0,
icaches_maintain_coherence = 0 '\000'}, ppc_icache_line_szB = 0,
ppc_dcbz_szB = 0,
          ppc_dcbzl_szB = 0, arm64_dMinLine_lg2_szB = 0,
arm64_iMinLine_lg2_szB = 0, arm64_requires_fallback_LLSC = 0 '\000'}
        need_help = <optimized out>
        tid_main = 0
        addr2dihandle = 0x0
        wd = <optimized out>
        need_help = <optimized out>
        tid_main = <optimized out>
        loglevel = <optimized out>
        i = <optimized out>
        addr2dihandle = <optimized out>
        __PRETTY_FUNCTION__ = "valgrind_main"
        vex_archinfo = <optimized out>
        wd = <optimized out>
        tmp_str = <optimized out>
        res = <optimized out>
        val = <optimized out>
        res = <optimized out>
        val = <optimized out>
        s = <optimized out>
        n = <optimized out>
        res = <optimized out>
        val = <optimized out>
        s = <optimized out>
        n = <optimized out>
        val = <optimized out>
        ok = <optimized out>
        errmsg = <optimized out>
        limLo = <optimized out>
        limHi = <optimized out>
        aLocal = <optimized out>
        p = <optimized out>
        cp = <optimized out>
        vex_arch = <optimized out>
        ok = <optimized out>
        buf = <optimized out>
        buf2 = <optimized out>
        fd = <optimized out>
        r = <optimized out>
        nul = <optimized out>
        exename = <optimized out>
        client_auxv = <optimized out>
        client_auxv_len = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        arg = <optimized out>
        s = <optimized out>
        ok = <optimized out>
        seg_starts = <optimized out>
        n_seg_starts = <optimized out>
        anu = <optimized out>
        change_ownership_v_c_OK = <optimized out>
        co_start = <optimized out>
        co_endPlus = <optimized out>
        buf = <optimized out>
        seg_starts = <optimized out>
        n_seg_starts = <optimized out>
        j = <optimized out>
        n = <optimized out>
        seg = <optimized out>
        anl = <optimized out>
        inaccessible_len = <optimized out>
        seg = <optimized out>
        seg = <optimized out>
#2  _start_in_C_linux (pArgc=0xbefff6c0) at m_main.c:3081
        r = <optimized out>
        argc = 1
        argv = 0xbefff6c4
        envp = 0xbefff6cc
#3  0x00000000 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

#928224#43
Date:
2022-07-01 09:54:58 UTC
From:
To:
valgrind should apply the following patch:

sed -i -e 's/cortex-a8/generic-armv7-a+vfpv3-d16/g' Makefile.all.am

#928224#60
Date:
2022-07-01 10:09:18 UTC
From:
To:
   sed -i -e 's/cortex-a8/generic-armv7-a/g' Makefile.all.am

There's no need for the fpu selection to be specified as generic-armv7-a
defaults to vfpv3-d16.

R.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#928224#67
Date:
2022-07-06 12:49:29 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
valgrind, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 928224@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mathieu Malaterre <malat@debian.org> (supplier of updated valgrind package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 01 Jul 2022 13:58:19 +0200
Source: valgrind
Architecture: source
Version: 1:3.18.1-1.1
Distribution: unstable
Urgency: medium
Maintainer: Alessandro Ghedini <ghedo@debian.org>
Changed-By: Mathieu Malaterre <malat@debian.org>
Closes: 928224
Changes:
 valgrind (1:3.18.1-1.1) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Fix remove neon requirement from armhf binaries. Closes: #928224
Checksums-Sha1:
 17b6cbaef40901ab75ab29bf8788d0ffa2ce52af 2446 valgrind_3.18.1-1.1.dsc
 97dd37dfb5dae75c1a547f7e6af309fe4cbacd55 27132 valgrind_3.18.1-1.1.debian.tar.xz
 1eb869485b29559281b9993cb8ab50a9c779344d 9302 valgrind_3.18.1-1.1_source.buildinfo
Checksums-Sha256:
 9608e9978c79d3e3c4fe350afd263fdd66dfa3cf3048f1d6982c548f1a1b412d 2446 valgrind_3.18.1-1.1.dsc
 a94dda87a22ba869836f214204cbe55b50d3906b7a10c31b605f3b357db851b4 27132 valgrind_3.18.1-1.1.debian.tar.xz
 ef9cb66c3372c3e816ad10dcce194b110947db9fdd7f05b65d3b83d6615fe320 9302 valgrind_3.18.1-1.1_source.buildinfo
Files:
 205ea8be27cf683952cf8f17528cf5b8 2446 devel optional valgrind_3.18.1-1.1.dsc
 530ba2c98295ba16e03db9585723051b 27132 devel optional valgrind_3.18.1-1.1.debian.tar.xz
 5219011eb9f3197c432c32f20651b101 9302 devel optional valgrind_3.18.1-1.1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEEaTNn/67NjqrNHwY7AXHhgorgk0UFAmK+5HkRHG1hbGF0QGRl
Ymlhbi5vcmcACgkQAXHhgorgk0VDIBAAlGWtcLH8XxDAykLc0MwezWYcyIldmMU9
nKSQZxbc3SzLE6XsLWLf00J28YhVumS2JmBpOOHXyC71LQeAaxmYX8+yGeC4qc+j
PrzMe0xpnrLxyLtIDZRsky8OZOzXoRbVsgO26xJeHfXFySm0dWN9Om6XykF5mMMo
cokSptsyOc38K5XBaRhCYL6vQWff47inVI3No2CoKRRPSa5CwnGhXiImnIE5wzsU
dFudSS8JLDYUhLavyz0a5WKTH+D3wowvB+C+mGoVbsyaqQ99vMDezob/99uLNVfk
5zi4VMmMpjfboeulB4UJ3OXsICCCQz5ngMcWAY9aD3zKcaGFuKJJww/9xQeXOIR0
0ZgsHB+rNXRTLLQZmShn45HilYOq1tXDHLRN5r48ZZPA2fiI8+derZwUH/NLHi+Z
2imaIAEOk64bMSlxQS5k8W8aNehNzybgszTe1+ORHC2bparsA916iPoDgUgajLGU
0p1jIIFhPLFIANOEdTITRuD+BLp/9ytc8EhYDb03Z+hZrk1zlwmfNsnbR+yV97Yp
N6yUC3xXtnbRnuDI6VcZiYCXhSAkU0oymHUBQ7YYBASuv+qL/6LtpzVLeLaQx+Qe
dU9GC6qLlwTH8s0J6TAiWKZ35evoMjVeIfWg6SwtImMX3vv2A1uElA5zy7UBiV9P
S8OIqfrP5oE=
=A7t5
-----END PGP SIGNATURE-----