-
Notifications
You must be signed in to change notification settings - Fork 393
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
CTU not working #3012
Comments
Thanks for reporting the issues! The unsupported nodes for CXXFoldExpr or ShuffleVectorExpr are fairly easy to implement in ASTNodeImporter (and any contribution is welcome). It simply means that we didn't have time to implement all (newer) C++ expressions in the Importer. I had a look at the 47K long stack trace you mention, and it requires further investigation. |
Thank you, I'm glad I cross posted the issues then. :-) Regarding the new nodes implementation in ASTNodeImporter, is there some patch that implements similar functionality? I'm curious to see if this is something I can pick. Could the segfault be a stack overflow, maybe because of infinite recursion? |
The other issue remains that |
I've already posted answers to bugzilla, but I prefer github, so let's communicate here.
Thanks, any contribution is welcome. Perhaps the implementation could be somewhat similar to
Yes, could you please check if there is a loop in the stack trace? If yes, could you please attach that (with at least two full iterations). Maybe there is something wrong with our ASTUnit caching mechanism in cross_tu::CrossTranslationUnitContext. |
Can you point me to the source on the web?
I had looked for loops, but the backtrace was so long and complicated that I couldn't find one. FWIW I tried capturing the crash with both gdb and lldb, still couldn't find a loop. I wonder if there is a tool to do that automatically. |
|
Hmmm, this goes outside my understanding so I'll have to pass, for now at least. |
There must be a Also, you then please provide the following information?
Maybe, with all this info we can reproduce the stack overflow. |
What you can do is to save the output of the debugger in a txt file. Then highlight one stack-frame with the address of the function and with the address of the first parameter. Then search the highlighted text in the whole output, between the two search results we should have a possible circle. |
I have just reproduced the segfault. Full command line and output:
|
Attaching backtrace from gdb. |
The project is qtbase at bbadd1b5c1. Let me know if the information I post is not enough, then I'll have to provide the exact command line sequence to reproduce this.
|
Ok, thanks for the update. I see that from the gdb log that we have an infinite loop in the ASTImporter code, so it is most probably not related to our cross_tu ASTUnit caching (@gamesh411).
Now I am trying to reproduce locally on the specific qt version you gave. |
FWIW at the bottom of the backtrace I see a call to BTW are you guys frequent on some IRC channel? I have faced different issues while setting up CodeServer for Qt, and might help to chat. |
Update: I am struggling with configuring qt, even though I have apt-getted the necessary gl libs (libgl1-mesa-dev libglu1-mesa-dev) I receive:
So, I tried to disable opengl with Overall, I am afraid that this is going to take a while until I can reproduce, perhaps another college will help with this issue.
I am sorry, but we are not available on IRC, but we try our best to address issues on github. TBH, we should be more watchful to CSA related tickets on llvm bugzilla as well, we'll try to improve that. |
Does this help?
|
I am on Ubuntu 18.04. |
Sorry I forgot an important detail on the command list above. To reproduce the segfault you need |
Good news, I could reproduce the segfault, with the stack overflow. I am going to investigate, and will come back to you with my findings. This may take a while. |
The problem stems from the missing support of C++17 deduction guides.
I hope I'll be able to fix this by importing the deduced template first during the import of the deduction guide. |
You might be check the similar issue recently fixed in CodeCompass: Ericsson/CodeCompass#483 |
Related LLVM/Clang patch to solve the infinite loop: |
Thank you, I'm looking forward to enabling CTU analysis in Qt! |
@martong how can I track which branch that will be merged in? I'm interested if it will make it to some minor update of Clang v11. |
So, the patch(https://reviews.llvm.org/D92209) is landed in the main branch (the used to be |
I've been checking on the release procedure and my understanding is that we should commit only regression fixes to the release branch. So, I think this will be only available in Clang 12. https://llvm.org/docs/HowToReleaseLLVM.html#release-patch-rules |
Well, TBH, the rules are not crystal clear, so I just have sent a mail to the release manager, I'll update if we can push it to Clang 11. |
It's too late to ship with 11.0.1. |
Thanks @martong! Nevertheless I see a flag |
--ctu-ast-mode parse-on-demand
is causing clangsa segfaults as reported at https://bugs.llvm.org/show_bug.cgi?id=47998--ctu-reanalyze-on-failure
flag, but this one is marked as deprecated.What is the recommended course of action, given that I don't see much activity on the LLVM bugtracker?
The text was updated successfully, but these errors were encountered: