-
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
VSCode C/C++ Intellisense Always Crashing when the IntelliSense cache is used #10789
Comments
Does it crash with 1.15.1 (pre-release)? Does it crash with an empty file? If it doesn't crash with the empty file, can you run "lldb -p ", continue, add code to cause the crash, and maybe run "bt all" if the crash call stack doesn't appear. |
I also have this issues. I used ubuntu 20.04 run in virtual box, if I enable c/c++ extension(v1.14.5), after run vs code sometime later, the system will suspend and cpu utilization is very high about virtual box in host system check. in this condition, power off and restart is the only option for virtual ubuntu system. but when disable c/c++ extension, vs code can run forever and no meet issue. |
@sean-mcmanus The intellisense process crashes even with an empty file. To verify that the file is empty, here's the screenshot: I run on both 1.15.1 and 1.14.5 and they exhibit the same behavior. Here are the log diagnostics for both:
Thanks in advance for the help! I hope we can get down to the root cause and hope this can be a valuable troubleshooting guide also for those that faces similar problems! |
Your issue is different. Can you attach a debugger to the process that is using a lot of CPU and get a callstack and add that info to a new issue? Also, can you use some program like top to check the CPU and memory usage for the cpptools and cpptools-srv process (or whatever process is using the CPU/memory)? Also, does using Reload Window reset the resource usage without rebooting the machine? |
@AudreyFelicio Crashing on an empty file is unusual. It crashes in the Open Folder scenario too? Can you check what version of the extension you have installed, in your ~/.vscode/extensions folder, e.g. is it ms-vscode.cpptools-1.15.2-darwin-arm64? Then can you run the ms-vscode.cpptools-1.15.2-darwin-arm64/bin/cpptools-srv process to make sure it runs without any error output? Then can you set |
@AudreyFelicio Another potential thing to try is setting C_Cpp.intelliSenseCacheSize to 0. |
Fast edit: Hi @sean-mcmanus, very sorry for the late reply again. I was finishing up my thesis and only finished recently. "It crashes in the Open Folder scenario too?" "Can you check what version of the extension you have installed, in your ~/.vscode/extensions folder, e.g. is it ms-vscode.cpptools-1.15.2-darwin-arm64?" "Then can you run the ms-vscode.cpptools-1.15.2-darwin-arm64/bin/cpptools-srv process to make sure it runs without any error output?" "Then can you set "C_Cpp.default.compilerPath": "" in your settings and see if that fixes it?" "If not, can you set "C_Cpp.loggingLevel": "Debug" and see if there's any unusual logging other than the crash?"
And here are the extra logs after I Cmd + S the
Thanks in advance again! @sean-mcmanus. I can reply more often now since I'm free, please give me a ping if you need more information 😄 |
Something unusual about your system is causing our IntelliSense cache creation to fail and cause our cpptools-srv process to crash. That feature uses some memory mapping that is dependent on the OS implementation, but we have lots of Mac 13.3 users and we haven't gotten other reports like this. I'm not sure how to get more info yet. If you can find a way to get your OS to generate a crash log report with a call stack that could help us identify which call is causing the crash. |
@sean-mcmanus Hey Sean, thanks again for helping resolve the issue. "If you can find a way to get your OS to generate a crash log report with a call stack that could help us identify which call is causing the crash." I'm very keen to help with this so that VSCode can further improve! |
I know in some cases Mac will log crashes to /Library/Logs/DiagnosticReports, but it's possible there might be some configuration step required and/or VS Code itself might be suppressing that crash logging. Otherwise, we theoretically could change it so the cpptools-srv process doesn't restart when the intelliSenseCacheSize changes: #10872 . |
I see it crash even with 1.15.4 on on macOS Ventura 13.3.1 (a). I have tried with Intellisense Memory Limit set to 16K and that does not help.
|
@pgaryali Your crash may be different. This particular issue has a workaround of setting C_Cpp.intelliSenseCacheSize to 0. If that workaround doesn't work for you, then you're hitting a different crash, so we'd need a crash call stack or other repro info (in a separate issue). |
It seems I've started having the same problem. It appeared after I updated my Mac OS from Big Sur to Ventura 13.4.1. I also updated xcode command line tools and gcc to latest versions. So I updated quite a lot of things, so it is hard to say what exactly caused it. Setting cache size to 0 fixes it, as was mentioned before. I'm attaching my crash report if it could help. Mac OS Crash Report
I guess, it confirms that the issue is related to memory mapping, as it was supposed before. I don't know if it is important, but I installed/upgraded Mac OS in a bit hacky way - using OpenCore Legacy Patcher, as my Macbook is a bit dated, so Apple dropped support for it. But if others, who experience same issue, using "normal" Mac OS, then probably it doesn't matter. Hmm, there are not that much information about this error, but I found some comments (1, 2) that it could happen when SIP is disabled or partially disabled (as in my case). I'm not sure if this is the same issue or not, but chances are it's an OS/OCLP level issue and not VSCode. I quickly tried to reproduce it using a simple python script that uses memory mapping, but it worked without any issues. However I'm not sure if it used same library under the hood. Or maybe VSCode uses more sophisticated mapping than in my basic script. Update: Well, after I updated OCLP to the latest version (0.6.8) which includes AMFIPass, which enables AMFI back (it was disabled in previous versions), seems like intellisense is working now again with cache size > 0. I don't know if it has any relation to other's setup, but it might be one of the reasons. |
The fix for this is available in 1.17.5 |
Environment
macOS Ventura 13.3
Version: 1.77.0 (Universal)
Commit: 7f329fe6c66b0f86ae1574c2911b681ad5a45d63
Date: 2023-03-29T09:57:11.797Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: Yes
v1.14.5
NA
Bug Summary and Steps to Reproduce
Bug Summary:
Intellisense always crash on my machine even with clean (fresh) install of VSCode. Have been having this issue since the first installation of VSCode. I thought wiping everything (settings + extensions + vscode itself) and then reinstalling would fix, but issue still persists. Am at my wits end on how to fix, really need some help to have intellisense running for C/C++. Thanks in advance!
Steps to reproduce:
helloworld.cpp
Expected behavior:
Intellisense process crash detected :(
Configuration and Logs
The text was updated successfully, but these errors were encountered: