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

            Bug ID: 384442
           Summary: ARM: bad pc in complaint if instruction changes pc
           Product: valgrind
           Version: 3.13 SVN
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: jrei...@bitwagon.com
  Target Milestone: ---

On ARM(32-bit) the instruction "ldmdb r11, {0xAFF0}" writes r15(==pc), and if
the instruction generates a complaint (such as by fetching from below the stack
pointer) then memcheck reports the new value of pc in its "at 0x..." complaint.
 Instead, the complaint should specify the pc of the ldmdb.  This can be fixed
by adding a new thread-state variable "pc_original" which changes only at the
beginning of each instruction.

"ldmdb r11, {0xAFF0}" also writes r13(==sp), and that is the source of another
problem.  The instruction is atomic, and in effect all memory fetches occur
before sp is written, yet memcheck uses the new value of sp for checking
fetches from the stack for subsequent registers.  This leads to spurious
"Invalid read of size 4" at address (sp - 20).

This problem is seen on OpenWrt Chaos Calmer 15.05 using gcc-5.3.0 and/or
gcc-4.8-Linaro.  The compiler could avoid both problems by generating better
code, but until then memcheck should point to the actual offender.

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

Reply via email to