-
Notifications
You must be signed in to change notification settings - Fork 13.4k
clang-repl: SIGSEGV in libclang #72980
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
Comments
I was able to get debug info: |
@EugeneZelenko are you sure clang-repl is clang-tools-extra? The repository layout suggests it's just a part of clang itself. Sorry for tag. |
@p4vook: Is it separate binary? If so, it's not exactly |
@p4vook, can you move the fix of this issue out of the bigger pull request and add a regression test for it? |
Check if the last translation unit or its first declaration are actually empty and do not nead cleanup. Previously this caused segmentation fault on empty PTUs. Add a regression test. Fixes: llvm#72980 Signed-off-by: Pavel Kalugin <[email protected]>
Done
|
I believe this is a deeper issue, it shouldn't be fixed up just by a simple check for nullptr, this seems to be an issue of inserting statements into wrong nodes of syntax tree if namespaces are present. I'll convert the PR to draft. |
Minimal example
Expected result
Error is shown, but the evaluation continues
Actual result
Error is shown,
clang-repl
gets terminated by SIGSEGV.Stack trace
LLVM 17.0.4
Also tested with current master (commit 0d77978), same result.
UPD: worth mentioning that
clang++
itself processes this file correctly, without segfaults.The text was updated successfully, but these errors were encountered: