https://bugs.kde.org/show_bug.cgi?id=511304

            Bug ID: 511304
           Summary: instruction decoding misaligned
    Classification: Developer tools
           Product: valgrind
      Version First 3.23.0
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: vex
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

SUMMARY

the instruction boundary used by valgrind is offset for even the first
instruction of the main. without valgrind, the application runs fine (well,
except for a memory leak that i'm trying to debug ;-)

STEPS TO REPRODUCE

1. start valgrind for any application using musl libc on mips

OBSERVED RESULT

valgrind crashes because it tries to use the invalid instruction encodings at a
wrong boundary. so far, the only offset i've encountered is: <main> + 1.

EXPECTED RESULT

normal operation of valgrind

SOFTWARE/OS VERSIONS

Openwrt (commit f5fd7ef8886)
these patches are applied:
https://github.com/openwrt/openwrt/tree/1a55d90320c169e1e45faa88e5ade69f85af1c9c/package/devel/valgrind/patches

ADDITIONAL INFORMATION

valgrind /bin/busybox:

vex mips->IR: unhandled instruction bytes: 0xF8 0x1A 0x20 0x2A
==24440== valgrind: Unrecognised instruction at address 0x40985d.

0040985c <main>:
  40985c:       64f8            save    64,ra,s0-s1
  40985e:       1a20 2acc       jal     44ab30 <__errno_location@mips16plt>


homegrown application:

vex mips->IR: unhandled instruction bytes: 0xF9 0x67 0x7F 0xD3
==23528== valgrind: Unrecognised instruction at address 0x4049a1.

004049a0 <main>:
  4049a0:       63f9            addiu   sp,-56

int main(void)
{
  4049a2:       677f            move    v1,ra
  4049a4:       d30d            sw      v1,52(sp)
  4049a6:       d10c            sw      s1,48(sp)
  4049a8:       0106            addiu   s1,sp,24

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to