-
Notifications
You must be signed in to change notification settings - Fork 13.5k
AST importer crash with CTU analysis enabled. #133144
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
@llvm/issue-subscribers-clang-frontend Author: None (earnol) I have encountered compiler crash with the following stack trace signifying error in the ASTImporter.
Please look at the place with While investigating the issue i was able to create a fix which apparently addresses the issue:
But it seems what it addressess is not a root cause. Stack trace:
|
Fixes a regression introduced in #130537 and reported here #133144 This fixes a crash in ASTStructuralEquivalence where the non-null precondition for IsStructurallyEquivalent would be violated, when comparing member pointers with a dependent class. This also drive-by fixes the ast node traverser for member pointers so it doesn't traverse into the qualifier in case it's not a type, or the class declaration in case there is none. This avoids printing of `<<<NULL>>>` on the text node dumper, which is redundant. No release notes since the regression was never released. Fixes #133144
#133343 should fix it. However, I can't reproduce the analyzer crash as the command line invocation is system specific. Can you provide a pre-processed reproducer? |
…er pointer (#133343) Fixes a regression introduced in llvm/llvm-project#130537 and reported here llvm/llvm-project#133144 This fixes a crash in ASTStructuralEquivalence where the non-null precondition for IsStructurallyEquivalent would be violated, when comparing member pointers with a dependent class. This also drive-by fixes the ast node traverser for member pointers so it doesn't traverse into the qualifier in case it's not a type, or the class declaration in case it would be equivalent to what the qualifier refers. This avoids printing of `<<<NULL>>>` on the text node dumper, which is redundant. No release notes since the regression was never released. Fixes llvm/llvm-project#133144
Verified the fix with revision 772173f, which includes #133343. Thank you. |
The ast-dump showing null values is not the same thing as the crash. It would be good to include a regression test for the analyzer. |
I see your point. The crash happened ONLY if serialized-binary AST has NULL values and class with NULL values got compared. I will think how such test can be constructed.
|
The AST dump containing NULL was not the problem. The nulls are still there, my patch changed the ast-dumper so it doesn't print those properties which are null. The patch fixed a case where the null was unexpected. However, I could see the problem, but not reproduce it, because I am not so familiar with the analyzer. If we could add a regression test for this bug, that would be appreciated. |
I have encountered compiler crash with the following stack trace signifying error in the ASTImporter (reproducible with 9269aae).
The reason of the error is improper import of some AST subtrees:
Please look at the place with
<<<NULL>>>
. This is what causing issue while processingclang::StructuralEquivalenceContext::CheckKindSpecificEquivalence
invokation and having identical subtrees.While investigating the issue i was able to create a fix which apparently addresses the issue:
But it seems what it addressess is not a root cause.
Created minimal reproducer showing the issue with AST: https://gcc.godbolt.org/z/5fx54Yx6W . The isseu will be after mark
line:29:1, line:31:46
.Complex explanation how i run into the issue in the first place:
The whole issue reproduction involved code checker and that it what i have done:
The actual crash will happen during the follow invocation:
Another way to reproduce the problem without CodeChecker is to call:
to get a problematic AST in human readable form in file bstrwrap.cpp.hhast and search for the line
line:496:3, line:498:47
. The NULL issue will be a few lines below.Stack trace:
The text was updated successfully, but these errors were encountered: