[all-commits] [llvm/llvm-project] 256978: [DebugInfo] - Fix multiple issues in DWARFDebugFra...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Tue May 26 02:13:40 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2569787e44595d31942da2bb5558931351929e57
      https://github.com/llvm/llvm-project/commit/2569787e44595d31942da2bb5558931351929e57
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-05-26 (Tue, 26 May 2020)

  Changed paths:
    M llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
    A llvm/test/DebugInfo/X86/eh-frame-truncated.s
    M llvm/test/tools/llvm-objdump/eh_frame-mipsel.test
    M llvm/test/tools/llvm-objdump/eh_frame_zero_cie.test
    M llvm/test/tools/llvm-readobj/ELF/unwind.test

  Log Message:
  -----------
  [DebugInfo] - Fix multiple issues in DWARFDebugFrame::parse().

I've noticed an issue with "Data.getRelocatedValue(...)" call.

it might silently ignore an error when a content is truncated.
That leads to an infinite loop in the code (e.g. llvm-readobj hangs).

After fixing the issue I've found that actually we always tried
to read past the end of a section, even when a content was valid.
It happened because the terminator CIE (a CIE with the length == 0)
was never handled. At first I've tried just to stop adding the terminator
entry (and return), but it does not seem to be correct, because tools like
llvm-objdump might want to print something for such entries
(see comments in the code and test cases).

This patch fixes issues mentioned, provides new test cases for
both llvm-readobj and lib/DebugInfo and adds FIXMEs to existent
test cases related.

Differential revision: https://reviews.llvm.org/D80299




More information about the All-commits mailing list