-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
*.cpp not found in compile_commands.json, IntelliSense stuck #1777
Comments
The message about a file not being found in your compile commands is "by design" -- however, I think we should change it to be a warning and not an error (should be fixed in our next release, #1783). So far I'm not able to repro any problem with your project. My settings seem to match what you're using. What file is causing IntelliSense to get stuck? |
Ah, ok. Yeah, changing it to a warning or even info with a note that this is deliberately ignored would be nice.
No idea. I'm having this problem with a lot of projects... I just thought I'd pick a rather simple and public one for demonstration. I had the engine switched to Anything I can/should do to collect more info? |
"Loading..." means our main process is stuck for some reason (F12 not working means the same thing). The usual culprit is the red flame, but if that's not there, then it's something else. On Linux, you can attach a debugger (i.e. using VS Code, launch.json, gdb attach config, setting the "program" to be Of if you let me know the exact file and variable that repros this I can try that. I know 0.16.0 had a deadlock caused by logging that got fixed with 0.16.1, but this sounds like a different/new one. |
It seems to happen with every file/variable, e.g. Two callstacks that might be interesting:
the others basically wait on conditions/wait for events. |
Some other callstacks, just in case...
and two with:
|
Update: But starting it again (so with a new/existing database), I have the same problem again... |
Based on the callstacks this doesn't look like a database problem. This looks like either a deadlock in the IntelliSense client lookup/creation, or the IntelliSense server is hung and not responding to messages from the extension. |
The threads are blocked on the IntelliSense operation "contains_source". It looks like Microsoft.VSCode.CPP.IntelliSense.Msvc.linux is stuck -- if you could attach a debugger and report any suspicious stuck threads that could help. The includePath setting is ignored when compile commands is used, so the only difference would be the /usr/bin/c++ which is queried for compiler includes/defines -- what version of clang/gcc does that point to for you? Also, if you temporarily set the loggingLevel to the hidden value of "6", you would want to verify that no errors are occuring and the correct compiler includes/defines are output after "sending compilation args" in the C/C++ section in the Output panel. |
So there are three of these processes running, one looks suspicious:
and all three processes seem to wait for that:
Don't think so, because of the already mentioned
I have c++ (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
That looks ok to me: |
@flixr Thanks a lot for those call stacks -- those look promising. It appears both processes are deadlocked on each other.
|
Actually, looks like we need more info still. We're not able to determine why the main process is not able to handle the IntelliSense processes source file request given the call stacks provided for the main process. Is the main process blocked on "handle_get_source"? This appears to be the same freeze as described in #1407 , which we were never able to figure out a cause. If handle_get_source or a thread with the comm_server isn't in the main process, then the thread could be exiting for some reason. Maybe we'll need to add some timeout. |
Which "main process" do you mean? Attached the backtraces off all cpptools processes. |
Yeah, those are the call stacks for the main process (Microsoft.VSCode.CPP.Extension.linux) -- the comm_server is waiting for requests, but the call stack for the IntelliSense process shows that it has already sent the request and is blocked waiting for the reply. This is exactly what I saw on Windows with the dmp provided in #1407. It's as if the request was just lost somehow. I'll have to brainstorm with @bobbrow on how to deal with this. I think our previous conclusion was we needed a repro. |
@flixr We finally figured out the cause of all the deadlocks in which the intellisense process is stuck sending a GetSourceRequest (and potentially other deadlocks). We're in the process of figuring out a fix for 0.17.1. |
This deadlock issue should be fixed now with 0.17.1. |
With 0.17.4 I still get
|
Yeah, that's "by design", we changed it to a warning and fixed the deadlocks. |
So this really means that compile_commands.json is ignored and it reverts to the 'includePath' setting? If compile_commands is actually still used, then the warning not say that it reverts to 'includePath' setting. |
We only ignore compile_commands.json for the individual files you open that don't exist in the json database. We will use compile_commands.json for all of the other files that are present. |
Perhaps we can clarify the message to say that we are using |
👍
Bob Brown <notifications@github.com> schrieb am Do., 14. Juni 2018, 18:09:
… Perhaps we can clarify the message to say that we are using includePath
just for this translation unit in question.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1777 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGXQUWSSlFdqgP3PAb9lt0cPuC2BsWiks5t8oqngaJpZM4TE3Lw>
.
|
Hi,all! Meanwhile,it responds with If the compile_commands.json have something to do with the issue? To fix the issue,I have tried tons of methods.However,It still doesn't work even after that I completely remove and reinstall all of the vscode and all of the px4's code.what is the problem about the vscode?And how could I fix it? Thank you? To fix the issue,I have tried tons of methods.However,It still doesn't work even after that I completely remove and reinstall all of the vscode and all of the git's code.what is the problem about the vscode?And how could I fix it? Thank you? |
I keep seeing these warning popping up one above another and it is so distracting. |
@nurp You didn't have these errors before what? We haven't changed this behavior in a long time. One potential workaround is to multiple workspace folders. Would an option to "don't show again" be good or did you have another solution? |
@sean-mcmanus , there is no "don't show again" option. The only option is "manage extension" and it opens the page for C/C++ ms-vscode.cpptools. |
@nurp Yeah, I was suggesting we could add a "don't show again" option to the notification. |
IntelliSense seems to get stuck (red flame still showing, loading, stale processes as in #1246).
I get an error from cpptools that it can't find a CMake generated file in compile_commands.json
I think that IntelliSense/cpptools should ignore this file, as it is not actually compiled...
But I'm not sure if this actually the cause for IntelliSense being stuck...
OS: Ubuntu 14.04 x64
VS Code: 1.21.1
cpptools: 0.16.1
cmake-tools: 0.10.0
cmake: 3.11
Example project I see this problem with: https://github.com/roboception/rcdiscover
My c_cpp_properties.json:
The compile_commands.json is generated by cmake 3.11 in my build dir.
Log output of
C/C++
on info level:The text was updated successfully, but these errors were encountered: