[all-commits] [llvm/llvm-project] 710d9d: [DebugInfo] - DWARFDebugFrame: do not call abort()...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri May 15 03:06:06 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 710d9d66f8e2f8ac148ef9a3d226c6a8e22f15c5
      https://github.com/llvm/llvm-project/commit/710d9d66f8e2f8ac148ef9a3d226c6a8e22f15c5
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-05-15 (Fri, 15 May 2020)

  Changed paths:
    M llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
    M llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
    M llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
    M llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
    M llvm/test/DebugInfo/X86/eh-frame-cie-id.s
    M llvm/test/tools/llvm-readobj/ELF/unwind.test
    M llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h

  Log Message:
  -----------
  [DebugInfo] - DWARFDebugFrame: do not call abort() on errors.

Imagine we have a broken .eh_frame.
Below is a possible sample output of llvm-readelf:

```
...
    entry 2 {
      initial_location: 0x10f5
      address: 0x2080
    }
  }
}
.eh_frame section at offset 0x2028 address 0x2028:
LLVM ERROR: Parsing entry instructions at 0 failed
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /home/umb/LLVM/LLVM/llvm-project/build/bin/llvm-readelf -a 1
 #0 0x000055f4a2ff5a1a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/umb/LLVM/LLVM/llvm-project/build/bin/llvm-readelf+0x2b9a1a)
...
#15 0x00007fdae5dc209b __libc_start_main /build/glibc-B9XfQf/glibc-2.28/csu/../csu/libc-start.c:342:3
#16 0x000055f4a2db746a _start (/home/umb/LLVM/LLVM/llvm-project/build/bin/llvm-readelf+0x7b46a)
Aborted
```

I.e. it calls abort(), suggests to submit a bug report and exits with the code 134.
This patch changes the logic to propagate errors to callers.
This fixes the behavior for llvm-dwarfdump, llvm-readobj and other possible tools.

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




More information about the All-commits mailing list