Comment 1 for bug 1826811

Revision history for this message
In , fweimer (fweimer-redhat-bugs) wrote :

+++ This bug was initially created as a clone of Bug #1464085 +++

valgrind currently does not know anything about the CPUID flag added to the HWCAP auxv entry in kernel 4.11. It passes this flag through to applications, but it will then choke when the application uses it, like this:

ARM64 front end: branch_etc
disInstr(arm64): unhandled instruction 0xD5380000
disInstr(arm64): 1101'0101 0011'1000 0000'0000 0000'0000
==924== valgrind: Unrecognised instruction at address 0x11f548.
==924== at 0x11F548: init_cpu_features (cpu-features.c:32)
==924== by 0x11F548: dl_platform_init (dl-machine.h:241)
==924== by 0x11F548: _dl_sysdep_start (dl-sysdep.c:231)
==924== by 0x10981B: _dl_start_final (rtld.c:412)
==924== by 0x109AAB: _dl_start (rtld.c:520)

The crashing instruction is the mrs in the glibc startup code, which means that currently no applications run under valgrind:

  if (hwcap & HWCAP_CPUID)
    {
      register uint64_t id = 0;
      asm volatile ("mrs %0, midr_el1" : "=r"(id));
      cpu_features->midr_el1 = id;
    }
  else
    cpu_features->midr_el1 = 0;

Perhaps valgrind should mask all the HWCAP bits it knows nothing about.

Workaround: Run with “LD_HWCAP_MASK=1”.