[PATCH] D147652: [symbolizer] Check existence of input file in GNU mode

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 5 11:58:06 PDT 2023


sepavloff created this revision.
sepavloff added reviewers: jhenderson, mgorny, MaskRay, dblaikie.
Herald added a subscriber: hiraditya.
Herald added a project: All.
sepavloff requested review of this revision.
Herald added a project: LLVM.

GNU addr2line exits immediately if it cannot open the file specified as
executable/relocatable. In contrast llvm-addr2line does not exit and, if
addresses are not specified in command line, waits for input on stdin. This
causes the test compiler-rt/test/asan/TestCases/Posix/asan-symbolize-bad-path.cc to block
forever on Gentoo (see https://reviews.llvm.org/rG27c4777f41d2ab204c1cf84ff1cccd5ba41354da#1190273).
To fix this issue the behavior llvm-addr2line now exits if
executable/relocatable file cannot be opened.

It fixes https://github.com/llvm/llvm-project/issues/42099 (llvm-addr2line
does not exit when passed a non-existent file).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147652

Files:
  llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
  llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
  llvm/test/tools/llvm-symbolizer/input-base.test
  llvm/test/tools/llvm-symbolizer/untag-addresses.test
  llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147652.511179.patch
Type: text/x-patch
Size: 5257 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230405/bcd31c3b/attachment.bin>


More information about the llvm-commits mailing list