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

clang-scan-deps crashes when input file does not exist #64144

Closed
namniav opened this issue Jul 27, 2023 · 0 comments · Fixed by #75545
Closed

clang-scan-deps crashes when input file does not exist #64144

namniav opened this issue Jul 27, 2023 · 0 comments · Fixed by #75545

Comments

@namniav
Copy link

namniav commented Jul 27, 2023

Simple repro:

clang-scan-deps --format=p1689 -- `which clang++` --std=c++20 this-file-does-not-exist.cpp

Result:

error: no such file or directory: 'this-file-does-not-exist.cpp'
error: no input files
PLEASE submit a bug report to https://github.com/Homebrew/homebrew-core/issues and include the crash backtrace.
Stack dump:
0.	Program arguments: clang-scan-deps --format=p1689 -- /opt/homebrew/opt/llvm/bin/clang++ --std=c++20 this-file-does-not-exist.cpp
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.dylib            0x0000000114052494 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  libLLVM.dylib            0x0000000117e9d550 SignalHandler(int) + 304
2  libsystem_platform.dylib 0x000000019880d4c4 _sigtramp + 56
3  clang-scan-deps          0x0000000102c4aae4 main + 5448
4  dyld                     0x0000000102df1088 start + 516
[1]    25079 segmentation fault  clang-scan-deps --format=p1689 -- /opt/homebrew/opt/llvm/bin/clang++ 

Version info:

$ clang-scan-deps --version
Homebrew LLVM version 16.0.6
  Optimized build.

I can reproduce this with non-Homebrew builds, so I report here instead of to Homebrew.

ChuanqiXu9 pushed a commit that referenced this issue Jan 31, 2024
Closes #64144

Instead of checking for `nullptr` we need to ensure that `JobList` is
not empty to proceed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants