[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [valgrind] [Bug 356044] Dwarf line info reader misinterprets is_stmt register
From:       Ivo Raisr via KDE Bugzilla <bugzilla_noreply () kde ! org>
Date:       2015-11-30 12:40:36
Message-ID: bug-356044-17878-icg3JDLVBy () http ! bugs ! kde ! org/
[Download RAW message or body]

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

--- Comment #4 from Ivo Raisr <ivosh@ivosh.net> ---
So I spotted the problem by a chance, because another redirected function got
used on Solaris/x86+amd64 (using gcc 4.8.2). However this is a generic problem
with location info on Linux as well.

Consider the following decoded "Line Number Statements" as displayed by
"readelf --debug-dump=rawline":
  (previous instructions were related to line 868)
  ...
  Set is_stmt to 1
  Special opcode 174: advance Address by 12 to 0x1c72 and Line by 1 to 869
  Advance PC by constant 17 to 0x1c83
  Special opcode 5: advance Address by 0 to 0x1c83 and Line by 0 to 869
  Extended opcode 4: set Discriminator to 1
  Set is_stmt to 0
  Special opcode 131: advance Address by 9 to 0x1c8c and Line by 0 to 869
  Extended opcode 4: set Discriminator to 2
  Special opcode 75: advance Address by 5 to 0x1c91 and Line by 0 to 869
  Extended opcode 4: set Discriminator to 1
  Special opcode 75: advance Address by 5 to 0x1c96 and Line by 0 to 869
  Extended opcode 4: set Discriminator to 2
  Copy
  Extended opcode 4: set Discriminator to 1
  Special opcode 131: advance Address by 9 to 0x1c9f and Line by 0 to 869
  Extended opcode 4: set Discriminator to 2
  Advance PC by constant 17 to 0x1cb0
  Special opcode 89: advance Address by 6 to 0x1cb6 and Line by 0 to 869
  Extended opcode 4: set Discriminator to 1
  Special opcode 159: advance Address by 11 to 0x1cc1 and Line by 0 to 869
  Extended opcode 4: set Discriminator to 2
  Special opcode 131: advance Address by 9 to 0x1cca and Line by 0 to 869
  Special opcode 131: advance Address by 9 to 0x1cd3 and Line by 0 to 869
  Extended opcode 4: set Discriminator to 3
  Special opcode 117: advance Address by 8 to 0x1cdb and Line by 0 to 869
  Extended opcode 4: set Discriminator to 1
  Advance PC by 88 to 0x1d33
  Special opcode 5: advance Address by 0 to 0x1d33 and Line by 0 to 869
  Extended opcode 4: set Discriminator to 2
  Advance PC by constant 17 to 0x1d44
  Special opcode 47: advance Address by 3 to 0x1d47 and Line by 0 to 869
  Advance PC by 12 to 0x1d53
  Extended opcode 1: End of Sequence

Line 869 corresponds to function _vgr10110ZU_VgSoSynsomalloc_memalign() - which
happens to be the last one in this compilation unit. Its size is 0xe1 (225)
bytes as confirmed by nm, readelf and also disassembly.

However current Valgrind functionality adds DiLoc entries only for addresses
where "is_stmt = 1", that is address range
0x1c72-0x1c83 (17 bytes). This is clearly wrong; address ranges for "is_stmt =
0" should be covered as well.

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic