Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm-addr2line does not exit when passed a non-existent file #42099

Closed
arichardson opened this issue Jul 25, 2019 · 0 comments
Closed

llvm-addr2line does not exit when passed a non-existent file #42099

arichardson opened this issue Jul 25, 2019 · 0 comments
Labels
bugzilla Issues migrated from bugzilla tools:llvm-symbolizer/addr2line

Comments

@arichardson
Copy link
Member

Bugzilla Link 42754
Version trunk
OS All

Extended Description

GNU addr2line and FreeBSD addr2line exit immediately when passed an invalid file with -e:
$ addr2line -fi -e /bad/file
addr2line: /bad/file: No such file or directory

However, llvm-addr2line does not exit and waits for input on stdin.
This causes compiler-rt/test/asan/TestCases/Posix/asan-symbolize-bad-path.cc to block forever if -DLLVM_INSTALL_BINUTILS_SYMLINKS=ON is enabled.
In that case the addr2line found in the path will be llvm-addr2line and then the test waits forever.

I wonder if we want to change llvm-addr2line (and possibly also llvm-symbolizer) to behave in the same way as GNU?

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
Chenyang-L pushed a commit to intel/llvm that referenced this issue Jul 11, 2023
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 found.

It fixes llvm/llvm-project#42099 (llvm-addr2line
does not exit when passed a non-existent file).

Differential Revision: https://reviews.llvm.org/D147652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla tools:llvm-symbolizer/addr2line
Projects
None yet
Development

No branches or pull requests

1 participant