Valgrind fails to run on osmc

Hi,

when running valgrind to find cause of segmentation fault in a program compiled on OSMC, valgrind bails out with a fatal error:

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

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.

steps to reproduce (minimalistic example)
compile following program (main.c)

#include <stdio.h>
int main()
{
printf(“Hello, World!”);
return 0;
}

compile using gcc main.c
then run valgrind ./a.out

additional info:
OSMC version 2021.12-1 (kernel: linux 5.18.78-2-osmc)
gcc --version
gcc (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sudo apt install libc6-dbg
Reading package lists… Done
Building dependency tree
Reading state information… Done
libc6-dbg is already the newest version (2.28-110.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ ./a.out

Hello, World!

Any suggestion how to fix this?

(re)installing libc6-dbg does not fix this issue…

P.S. I searched the forum(s) and osmc’s github and only found one issue mentioning valgrind and that was from 2016, so I considered that unrelated.

I have used valgrind successfully on OSMC some time ago (last year?)

It would help to know which model of Pi you are using.

cat /proc/cpuinfo

processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Hardware : BCM2835
Revision : a020d3
Model : Raspberry Pi 3 Model B Plus Rev 1.3

Please post a full set of logs

Sam

https://paste.osmc.tv/bipecopebi

Nothing obvious. My initial suspicion was you were using Pi 4 (aarch64 kernel; armhf userland); but this doesn’t seem to be the case.

Maybe Valgrind is too old for the kernel and needs building from source.

You could try using strace to see exactly what invokes that message.

running strace valgrind ./a.out gives
execve("/usr/bin/valgrind", [“valgrind”, “./a.out”], 0x7ebc1594 /* 32 vars /) = 0
brk(NULL) = 0xc82000
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f79000
access("/etc/ld.so.preload", R_OK) = 0
openat(AT_FDCWD, “/etc/ld.so.preload”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22, …}) = 0
mmap2(NULL, 22, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x76f78000
close(3) = 0
openat(AT_FDCWD, “/usr/lib/libarmmem.so”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0P\3\0\0004\0\0\0”…, 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=15640, …}) = 0
mmap2(NULL, 77868, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76f3f000
mprotect(0x76f42000, 61440, PROT_NONE) = 0
mmap2(0x76f51000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x76f51000
close(3) = 0
munmap(0x76f78000, 22) = 0
openat(AT_FDCWD, “/etc/ld.so.cache”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=49488, …}) = 0
mmap2(NULL, 49488, PROT_READ, MAP_PRIVATE, 3, 0) = 0x76f6c000
close(3) = 0
openat(AT_FDCWD, “/lib/arm-linux-gnueabihf/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, “\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\09v\1\0004\0\0\0”…, 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=952028, …}) = 0
mmap2(NULL, 1020732, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76e45000
mprotect(0x76f29000, 65536, PROT_NONE) = 0
mmap2(0x76f39000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe4000) = 0x76f39000
mmap2(0x76f3c000, 9020, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76f3c000
close(3) = 0
set_tls(0x76f7a100) = 0
mprotect(0x76f39000, 8192, PROT_READ) = 0
mprotect(0x76f51000, 4096, PROT_READ) = 0
mprotect(0x501000, 4096, PROT_READ) = 0
mprotect(0x76f7b000, 4096, PROT_READ) = 0
munmap(0x76f6c000, 49488) = 0
getuid32() = 1000
getgid32() = 1000
getpid() = 24413
rt_sigaction(SIGCHLD, {sa_handler=0x4ec549, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x76e6aca1}, NULL, 8) = 0
geteuid32() = 1000
brk(NULL) = 0xc82000
brk(0xca3000) = 0xca3000
getppid() = 24409
stat64("/HDD/projects/HelloWorld", {st_mode=S_IFDIR|S_ISGID|0755, st_size=4096, …}) = 0
stat64(".", {st_mode=S_IFDIR|S_ISGID|0755, st_size=4096, …}) = 0
openat(AT_FDCWD, “/usr/bin/valgrind”, O_RDONLY|O_LARGEFILE) = 3
fcntl64(3, F_DUPFD, 10) = 10
close(3) = 0
fcntl64(10, F_SETFD, FD_CLOEXEC) = 0
geteuid32() = 1000
getegid32() = 1000
rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=0x4ec549, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x76e6aca1}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x76e6aca1}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=SIG_DFL, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x76e6aca1}, NULL, 8) = 0
read(10, “#!/bin/sh -e\n#\n# Valgrind wrappe”…, 8192) = 528
execve("/usr/bin/valgrind.bin", ["/usr/bin/valgrind.bin", “./a.out”], 0x504638 /
35 vars /) = 0
brk(NULL) = 0x1530000
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f4c000
access("/etc/ld.so.preload", R_OK) = 0
openat(AT_FDCWD, “/etc/ld.so.preload”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22, …}) = 0
mmap2(NULL, 22, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x76f4b000
close(3) = 0
openat(AT_FDCWD, “/usr/lib/libarmmem.so”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0P\3\0\0004\0\0\0”…, 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=15640, …}) = 0
mmap2(NULL, 77868, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76f12000
mprotect(0x76f15000, 61440, PROT_NONE) = 0
mmap2(0x76f24000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x76f24000
close(3) = 0
munmap(0x76f4b000, 22) = 0
openat(AT_FDCWD, “/usr/lib/debug/tls/v7l/neon/vfp/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/tls/v7l/neon/vfp", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/tls/v7l/neon/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/tls/v7l/neon", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/tls/v7l/vfp/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/tls/v7l/vfp", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/tls/v7l/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/tls/v7l", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/tls/neon/vfp/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/tls/neon/vfp", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/tls/neon/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/tls/neon", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/tls/vfp/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/tls/vfp", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/tls/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/tls", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/v7l/neon/vfp/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/v7l/neon/vfp", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/v7l/neon/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/v7l/neon", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/v7l/vfp/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/v7l/vfp", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/v7l/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/v7l", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/neon/vfp/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/neon/vfp", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/neon/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/neon", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/vfp/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug/vfp", 0x7e984940) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, “/usr/lib/debug/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/debug", {st_mode=S_IFDIR|0755, st_size=4096, …}) = 0
openat(AT_FDCWD, “/etc/ld.so.cache”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=49488, …}) = 0
mmap2(NULL, 49488, PROT_READ, MAP_PRIVATE, 3, 0) = 0x76f3f000
close(3) = 0
openat(AT_FDCWD, “/lib/arm-linux-gnueabihf/libc.so.6”, O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, “\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\09v\1\0004\0\0\0”…, 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=952028, …}) = 0
mmap2(NULL, 1020732, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76e18000
mprotect(0x76efc000, 65536, PROT_NONE) = 0
mmap2(0x76f0c000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe4000) = 0x76f0c000
mmap2(0x76f0f000, 9020, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76f0f000
close(3) = 0
set_tls(0x76f4d180) = 0
mprotect(0x76f0c000, 8192, PROT_READ) = 0
mprotect(0x76f24000, 4096, PROT_READ) = 0
mprotect(0x444000, 4096, PROT_READ) = 0
mprotect(0x76f4e000, 4096, PROT_READ) = 0
munmap(0x76f3f000, 49488) = 0
openat(AT_FDCWD, “./a.out”, O_RDONLY) = 3
read(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\375\3\0\0004\0\0\0”…, 4096) = 4096
close(3) = 0
brk(NULL) = 0x1530000
brk(0x1551000) = 0x1551000
readlink("/proc/self/exe", “/usr/bin/valgrind.bin”, 500) = 21
execve("/usr/lib/arm-linux-gnueabihf/valgrind/memcheck-arm-linux", ["/usr/bin/valgrind.bin", “./a.out”], 0x1530378 /
36 vars /) = 0
open("/proc/self/maps", O_RDONLY) = 3
read(3, "58000000-58263000 r-xp 00000000 "…, 100000) = 540
read(3, “”, 99460) = 0
close(3) = 0
mmap2(0x4156f000, 4194304, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x4156f000
ugetrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192
1024, rlim_max=RLIM_INFINITY}) = 0
rt_sigprocmask(SIG_UNBLOCK, [ILL FPE], , 8) = 0
rt_sigaction(SIGILL, NULL, {sa_handler=SIG_DFL, sa_mask=, sa_flags=0}, 8) = 0
rt_sigaction(SIGFPE, NULL, {sa_handler=SIG_DFL, sa_mask=, sa_flags=0}, 8) = 0
rt_sigaction(SIGILL, {sa_handler=0x58053b18, sa_mask=, sa_flags=SA_NODEFER}, NULL, 8) = 0
rt_sigaction(SIGFPE, {sa_handler=0x58053b18, sa_mask=, sa_flags=SA_NODEFER}, NULL, 8) = 0
rt_sigaction(SIGILL, {sa_handler=SIG_DFL, sa_mask=, sa_flags=0}, NULL, 8) = 0
rt_sigaction(SIGFPE, {sa_handler=SIG_DFL, sa_mask=, sa_flags=0}, NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, , NULL, 8) = 0
getcwd("/HDD/projects/HelloWorld", 499) = 25
open("/home/osmc/.valgrindrc", O_RDONLY) = -1 ENOENT (No such file or directory)
open("./.valgrindrc", O_RDONLY) = -1 ENOENT (No such file or directory)
open("./a.out", O_RDONLY) = 3
stat64("./a.out", {st_mode=S_IFREG|0755, st_size=8136, …}) = 0
getxattr("./a.out", “security.capability”, NULL, 0) = -1 ENODATA (No data available)
geteuid32() = 1000
fstat64(3, {st_mode=S_IFREG|0755, st_size=8136, …}) = 0
pread64(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\375\3\0\0004\0\0\0”…, 4096, 0) = 4096
pread64(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\375\3\0\0004\0\0\0”…, 52, 0) = 52
pread64(3, “\1\0\0p\204\5\0\0\204\5\0\0\204\5\0\0\10\0\0\0\10\0\0\0\4\0\0\0\4\0\0\0”…, 288, 52) = 288
pread64(3, “/lib/ld-linux-armhf.so.3\0”, 25, 340) = 25
open("/lib/ld-linux-armhf.so.3", O_RDONLY) = 4
pread64(4, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0@\n\0\0004\0\0\0”…, 52, 0) = 52
pread64(4, “\1\0\0p\230z\1\0\230z\1\0\230z\1\0\260\0\0\0\260\0\0\0\4\0\0\0\4\0\0\0”…, 224, 52) = 224
mmap2(0x108000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x108000
fstat64(3, {st_mode=S_IFREG|0755, st_size=8136, …}) = 0
readlink("/proc/self/fd/3", “/HDD/projects/HelloWorld/a.out”, 4096) = 30
mmap2(0x118000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x118000
fstat64(3, {st_mode=S_IFREG|0755, st_size=8136, …}) = 0
readlink("/proc/self/fd/3", “/HDD/projects/HelloWorld/a.out”, 4096) = 30
mmap2(0x4000000, 98304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0x4000000
fstat64(4, {st_mode=S_IFREG|0755, st_size=105844, …}) = 0
readlink("/proc/self/fd/4", “/lib/arm-linux-gnueabihf/ld-2.28”…, 4096) = 35
mmap2(0x4028000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x18000) = 0x4028000
fstat64(4, {st_mode=S_IFREG|0755, st_size=105844, …}) = 0
readlink("/proc/self/fd/4", “/lib/arm-linux-gnueabihf/ld-2.28”…, 4096) = 35
close(4) = 0
close(3) = 0
open("./a.out", O_RDONLY) = 3
access("/usr/lib/arm-linux-gnueabihf/valgrind/vgpreload_memcheck-arm-linux.so", R_OK) = 0
mmap2(0x7dadc000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x7dadc000
munmap(0x7eb3d000, 4096) = 0
mmap2(0x402a000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x402a000
ugetrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=10241024}) = 0
setrlimit(RLIMIT_NOFILE, {rlim_cur=1036, rlim_max=1024
1024}) = 0
fcntl(3, F_DUPFD, 1024) = 1024
close(3) = 0
fcntl(1024, F_SETFD, FD_CLOEXEC) = 0
getpid() = 24413
getpid() = 24413
getppid() = 24409
open("/tmp/valgrind_proc_24413_cmdline_76fef51e", O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3
fcntl(3, F_DUPFD, 1024) = 1025
close(3) = 0
fcntl(1025, F_SETFD, FD_CLOEXEC) = 0
write(1025, “./a.out”, 7) = 7
write(1025, “\0”, 1) = 1
unlink("/tmp/valgrind_proc_24413_cmdline_76fef51e") = 0
getpid() = 24413
getpid() = 24413
getppid() = 24409
open("/tmp/valgrind_proc_24413_auxv_76fef51e", O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3
fcntl(3, F_DUPFD, 1024) = 1026
close(3) = 0
fcntl(1026, F_SETFD, FD_CLOEXEC) = 0
write(1026, “\1\0\0\0\0\320\263~\20\0\0\0\326\260?\0\6\0\0\0\0\20\0\0\21\0\0\0d\0\0\0”…, 160) = 160
unlink("/tmp/valgrind_proc_24413_auxv_76fef51e") = 0
mmap2(0x4196f000, 4194304, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x4196f000
fcntl(2, F_DUPFD, 1024) = 1027
fcntl(1027, F_SETFD, FD_CLOEXEC) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=51774, tv_nsec=75007759}) = 0
getpid() = 24413
write(1027, “==24413== Memcheck, a memory err”…, 44==24413== Memcheck, a memory error detector
) = 44
getpid() = 24413
write(1027, “==24413== Copyright (C) 2002-201”…, 74==24413== Copyright (C) 2002-2017, and GNU GPL’d, by Julian Seward et al.
) = 74
getpid() = 24413
write(1027, “==24413== Using Valgrind-3.14.0 “…, 77==24413== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
) = 77
getpid() = 24413
write(1027, “==24413== Command: ./a.out\n”, 27==24413== Command: ./a.out
) = 27
getpid() = 24413
write(1027, “==24413== \n”, 11==24413==
) = 11
mmap2(0x41d6f000, 500000, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x41d6f000
mmap2(0x41dea000, 1048576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x41dea000
stat64(”/HDD/projects/HelloWorld/a.out”, {st_mode=S_IFREG|0755, st_size=8136, …}) = 0
open("/HDD/projects/HelloWorld/a.out", O_RDONLY|O_NOFOLLOW) = 3
pread64(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\375\3\0\0004\0\0\0”…, 1024, 0) = 1024
close(3) = 0
stat64("/HDD/projects/HelloWorld/a.out", {st_mode=S_IFREG|0755, st_size=8136, …}) = 0
open("/HDD/projects/HelloWorld/a.out", O_RDONLY|O_NOFOLLOW) = 3
pread64(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\375\3\0\0004\0\0\0”…, 1024, 0) = 1024
close(3) = 0
open("/HDD/projects/HelloWorld/a.out", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=8136, …}) = 0
pread64(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\375\3\0\0004\0\0\0”…, 8136, 0) = 8136
open("/usr/lib/debug/.build-id/ee/203f96532854d379401f54eabe05c25076c126.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
close(3) = 0
mmap2(0x41eea000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x41eea000
stat64("/lib/arm-linux-gnueabihf/ld-2.28.so", {st_mode=S_IFREG|0755, st_size=105844, …}) = 0
open("/lib/arm-linux-gnueabihf/ld-2.28.so", O_RDONLY|O_NOFOLLOW) = 3
pread64(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0@\n\0\0004\0\0\0”…, 1024, 0) = 1024
close(3) = 0
stat64("/lib/arm-linux-gnueabihf/ld-2.28.so", {st_mode=S_IFREG|0755, st_size=105844, …}) = 0
open("/lib/arm-linux-gnueabihf/ld-2.28.so", O_RDONLY|O_NOFOLLOW) = 3
pread64(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0@\n\0\0004\0\0\0”…, 1024, 0) = 1024
close(3) = 0
open("/lib/arm-linux-gnueabihf/ld-2.28.so", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=105844, …}) = 0
pread64(3, “\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0@\n\0\0004\0\0\0”…, 8192, 0) = 8192
pread64(3, “\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0”…, 7540, 98304) = 7540
open("/usr/lib/debug/.build-id/e6/c80bf7a6ac41070833da70cd457e3255886dcc.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/c80bf7a6ac41070833da70cd457e3255886dcc.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/.debug/c80bf7a6ac41070833da70cd457e3255886dcc.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/debug/lib/arm-linux-gnueabihf/c80bf7a6ac41070833da70cd457e3255886dcc.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
close(3) = 0
write(1027, “\n”, 1
) = 1
write(1027, “valgrind: Fatal error at startu”…, 58valgrind: Fatal error at startup: a function redirection
) = 58
write(1027, “valgrind: which is mandatory fo”…, 65valgrind: which is mandatory for this platform-tool combination
) = 65
write(1027, “valgrind: cannot be set up. De”…, 62valgrind: cannot be set up. Details of the redirection are:
) = 62
write(1027, “valgrind: \n”, 12valgrind:
) = 12
write(1027, "valgrind: A must-be-redirected "…, 41valgrind: A must-be-redirected function
) = 41
write(1027, “valgrind: whose name matches th”…, 54valgrind: whose name matches the pattern: index
) = 54
write(1027, “valgrind: in an object with son”…, 68valgrind: in an object with soname matching: ld-linux-armhf.so.3
) = 68
write(1027, "valgrind: was not found whilst "…, 43valgrind: was not found whilst processing
) = 43
write(1027, “valgrind: symbols from the obje”…, 68valgrind: symbols from the object with soname: ld-linux-armhf.so.3
) = 68
write(1027, “valgrind: \n”, 12valgrind:
) = 12
write(1027, “valgrind: Possible fixes: (1, s”…, 70valgrind: Possible fixes: (1, short term): install glibc’s debuginfo
) = 70
write(1027, “valgrind: package on this machi”…, 73valgrind: package on this machine. (2, longer term): ask the packagers
) = 73
write(1027, “valgrind: for your Linux distri”…, 71valgrind: for your Linux distribution to please in future ship a non-
) = 71
write(1027, “valgrind: stripped ld.so (or wh”…, 73valgrind: stripped ld.so (or whatever the dynamic linker .so is called)
) = 73
write(1027, “valgrind: that exports the abov”…, 68valgrind: that exports the above-named function using the standard
) = 68
write(1027, “valgrind: calling conventions f”…, 72valgrind: calling conventions for this platform. The package you need
) = 72
write(1027, “valgrind: to install for fix (1”…, 44valgrind: to install for fix (1) is called
) = 44
write(1027, “valgrind: \n”, 12valgrind:
) = 12
write(1027, "valgrind: On Debian, Ubuntu: "…, 58valgrind: On Debian, Ubuntu: libc6-dbg
) = 58
write(1027, "valgrind: On SuSE, openSuSE, "…, 64valgrind: On SuSE, openSuSE, Fedora, RHEL: glibc-debuginfo
) = 64
write(1027, “valgrind: \n”, 12valgrind:
) = 12
write(1027, "valgrind: Note that if you are "…, 64valgrind: Note that if you are debugging a 32 bit process on a
) = 64
write(1027, “valgrind: 64 bit system, you wi”…, 73valgrind: 64 bit system, you will need a corresponding 32 bit debuginfo
) = 73
write(1027, “valgrind: package (e.g. libc6-d”…, 42valgrind: package (e.g. libc6-dbg:i386).
) = 42
write(1027, “valgrind: \n”, 12valgrind:
) = 12
write(1027, “valgrind: Cannot continue – ex”…, 51valgrind: Cannot continue – exiting now. Sorry.
) = 51
write(1027, “\n”, 1
) = 1
exit_group(1) = ?
+++ exited with 1 +++
I am not able from that how to proceed or fix this.

It’s probably because we ship custom libc6 for Widevine and maybe Valgrind needs to be built again this version.

Sam

from https://valgrind.org : valgrind current release: Valgrind 3.18.1
installed valgrind version:
valgrind --version
valgrind-3.14.0

build from source following instructions found at

git clone git://sourceware.org/git/valgrind.git
cd valgrind
./autogen.sh
./configure
make

Then run the vg-in-place binary built at the root of the clone.
./vg-in-place ./a.out results in same error
==26445== Memcheck, a memory error detector
==26445== Copyright (C) 2002-2017, and GNU GPL’d, by Julian Seward et al.
==26445== Using Valgrind-3.19.0.GIT and LibVEX; rerun with -h for copyright info
==26445== Command: ./a.out
==26445==

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.