-
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
cpptools crash - The language server crashed. Restarting...
#10651
Comments
Just to remind that on |
@H-G-Hristov Yes, but that issue mentions a work around via running |
I've reproed multiple crashes. I'm tracking it with #10636 . We may not need this issue anymore. |
Reopening. The intent of this issue was to be pinned so users experiencing a crash can find the issue and easily find instructions. I'd like to keep this open and pinned for now. |
@Colengms Yeah, that seems fine, but user should know that we don't currently have a widespread crashing issue (as of https://github.com/microsoft/vscode-cpptools/releases/tag/v1.14.5 or later). |
Working with a large Visual Studio solution of ~70 C# projects and one C++/CMake project. Also had the same solution open in Visual Studio at the same time. Performed a Rebuild in Visual Studio and then came back to 10000+ duplicate errors in VS Code like this:
|
@OnielN14 @chris0306 @doxxx That info is insufficient. We more info, particular the info that's described in the description for this issue, such as a call stack of cpptools or a repro. |
@OnielN14 @chris0306 @doxxx Also, 1.17.1 and 1.17.2 of our extension has some crash fixes, so that may be worth trying. |
I start to have the same issue since the extension auto-updated to 1.17.3 today. I'm running AlmaLinux 8.8 with kernel 4.18.0-477.15.1.el8_8.x86_64. The VSCode version is 1.81 Not sure if this is any useful, but the output message is:
Is there any known workaround for this problem? Fixed the problem by downgrading to 1.16.3. Downgrading from 1.17.3 to 1.17.2 didn't work. PS: This happens only when I try to use VSCode with a very large project. For a medium-sized project, it works fine. |
@vineetsoni it looks like the extension isn't recovering from a crash properly. There were some code changes in this area recently, so thank you for reporting it. I'll move your report into a new issue. |
Sadly, this is a showstopper for a full team of developers in our company. They have transitioned from QtCreator to VScode for C++ and the experience has been really bad for production grade projects. I have tried to attach to the C++ extension, but it does not show any crash or stops anywhere. Tested with:
I also removed .vscode-server && .vscode folder, installed again extensions. |
I encountered an escalation of issues when the system build was located within the source code folder, particularly when compiling gRPC libraries. By relocating the build ecosystem outside of the folder, the problems had diminished. You could try it. *I don't have more troubles with C++ extension |
@sean-mcmanus I'm supportive of a 1.18.6 release containing that patch if we can confirm that's the cause of these recent problems. @borjamunozf would you be willing to try 1.19.1 and see if that reduces the crashes you're seeing? |
Yes, absolutely! |
@borjamunozf This "issue" is just a generic issue tracking crashes -- there could be many potential causes, but we need a repro or call stack of the crash. What OS are you using? What process are you attaching to? |
@rganascim What do you mean by "escalation of issues"? Crashes? I don't repro a crash in that scenario. Putting your build folder in the workspace folder will trigger didChange messages that will cause IntelliSense updates, so it's not recommended to put your build folder in the workspace folder (for performance reasons). @bobbrow We haven't identified the source of 1.18.x crashes yet. |
Snippet of Developer Tools console after crash: I cannot reproduce the crash with the Debugger. These are the processes I can see; if i attach to the first one it shows this in Debug Console: New LWP 228881]
[New LWP 228882]
[New LWP 228883]
[New LWP 233149]
0x00007f09b7d500a9 in __stdio_read () If I attach to the second one in shows: [Detaching after fork from child process 553242]
[LWP 540987 exited]
[LWP 540986 exited]
[LWP 540985 exited]
[LWP 540983 exited]
[LWP 540982 exited]
[LWP 540981 exited]
[LWP 540980 exited]
[LWP 540984 exited]
[New process 540980]
Program terminated with signal SIGKILL, Killed.
The program no longer exists.
Debugger has disconnected from the program '/home/borjamf/.vscode-server/extensions/ms-vscode.cpptools-1.18.5-linux-x64/bin/cpptools'. We're using WSL2 - Ubuntu 22.04: 1.2.5 WSL and 2.0.9 |
Update:
c_cpp_properties.json, which it contains {
"configurations": [
{
"name": "Linux",
"includePath": [
"${default}"
],
"defines": [],
"compilerPath": "/usr/bin/g++",
"cStandard": "c17",
"cppStandard": "c++14",
"intelliSenseMode": "linux-gcc-x64",
"compileCommands": "${workspaceFolder}/build/Debug/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
} it's not failing. The easiest to reproduce the failure in our case is to execute Show Call Hierarchy: with the custom c_cpp_properties it ends usually with Crash, without it it works (or it's not failing yet) |
@sean-mcmanus it's extremely common to have the build folder in the workspace (e.g. CMake Tools and others do this by default). It is also very common to have a |
@borjamunozf were you able to try 1.19.1 yet? Your screenshots suggest you are attempting to attach to 1.18.5. Do you happen to be working on anything open source that we can clone and test locally? |
@borjamunozf, also I see that you opened microsoft/vscode-cmake-tools#3469. Not sure if these issues are related but I'm guessing you have a pretty big |
Same. Attach to process, 2-3 minutes showing lot of messages [Detaching after fork from child process 1163080]
[Detaching after fork from child process 1163081]
[Detaching after fork from child process 1163082]
[Detaching after fork from child process 1163083]
[Detaching after fork from child process 1163084]
[Detaching after fork from child process 1163085]
[Detaching after fork from child process 1163086]
[Detaching after fork from child process 1163087] and finally the crash. Sadly, we work on propietary code. It's all code from my company, complex and huge projects I guess.
It's not the same project, but yes, we have big compile_commands.json for all projects I have seen in my division. In that issue we have found that disabling the loadCompileCommands at least allows to run CMake Configure & build the project, but it's only a workaround. Just as reference, for this project the compile_commands.json is 47.56MB size., ~83000 lines In this project, as I mentioned above, removing or renaming c_cpp_properties seems to avoid the crash, but the IntelliSense misses stuff, of course. Also if comment out the "compileCommands" only it seems to not crash, or not crash so fast, but it also does not work any Show Call Hierarchy, for example. About the video call, that would be great. However I have to check given the nature of the code. Will let you know. |
Hi @borjamunozf . I see a number of clues in the information you've posted so far. In one of your images, I see that the IntelliSense process failed to be restarted. That would imply either an issue with our restart logic, or that something is immediately in a bad state when it starts back up, such as some anomolous configuration information. The fact you were unable to detect a process crash from the debugger suggests that perhaps the process isn't actually crashing, but being terminated by another process. We've seen symptoms like this in the past with overzealous anti-malware software killing our process. To my knowledge, we do not have an influx of users reporting these symptoms on Linux, so something specific to your environment could potentially be involved. Your C/C++ configuration refers to both use of CMake Tools as a One of the most useful sources of information for investigating issues with the C/C++ extension is its debug output. Could you enable the setting I'm hoping there is something in your log output immediately before the issue that might point to what's going on here, or at least what it was in the process of doing when the problem started to occur.
Given that this setting seems superfluous in your case, I would not expect any difference in behavior from removing it. Though, when using a |
@bobbrow fileChanged/Created/Deleted triggers an IntelliSense update unless the file or the file's folder is filtered from a files.exclude setting. So sure you can put the cmake build folder in your workspace folder, but you should also add it to the C_Cpp.files.exclude to avoid unnecessary IntelliSense updating. |
Can we change that behavior? If it's obviously not a C or C++ file, I don't see why we would want to trigger an IntelliSense update. We have filters for non-C/C++ files (based on file extension) in the TypeScript code so it doesn't seem wrong to do the same thing in the language server. |
How to get a call stack? I cannot attach a debugger because the crash arises before that. If I open cpptools.exe outside VS Code, I cannot reproduce the crash. The executable does nothing. |
@SemenAntonov Your issue is with the clangd extension and not our extension. |
Please tell me which previous version did not have this issue.
Open a cpp file , this issue will occur! |
I have tried many times and finally located the problematic version to be My vscode version is 1.89.1. |
@microsoft-github-policy-service agree company="Microsoft" |
I am remotely developing on my RPI5, it appears that the LSP server is crashing consistently. This is the only output of cpptools.
|
I'm seeing the same thing as well on a Raspberry Pi 4 with extension version 1.21.2. Downgrading the C/C++ extension to v1.20.5 fixed the problem for me. I'm running VS Code version 1.89.1 and have attached the crash stack here as instructed in the first post. |
I have been receiving the following error message ever since the update was released 2 days ago.
I just open up the VS code and this error is thrown. I am using Windows. |
On Windows 11, the extension is now crashing on Language server in the past few days. What can I provide you to help diagnose this? |
@abhishekd-1 That crash is fixed with 1.21.4. @dkvg-77 @imanabu Are you able to attach a debugger to the cpptools.exe process to get a crash call stack? https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv |
Hey @sean-mcmanus I have been trying to attach a debugger to the cpptools.exe process following the steps in the given URL. And, to talk about the problem of the extension, Also for an option called 'C/C++ tag parser status', it says 'initializing'. |
Well, here is what happens so with my knowledge of VSC extensions, right now I am at a loss how to get this attach while the extension is starting up. I have a flutter project with Windows target and I think when that gets detected, the extension starts and then it crashes. I am on 1.21.4 |
@dkvg-77 @imanabu It sounds like it's crashing too early to attach. Are you able to set C_Cpp.logginglevel to "Debug" and look at the C/C++ logging before the 2nd "cpptools/initialize" logging (which occurs after it crashes and re-initializes). Does it crash with an empty workspace folder without any C/C++ files open? Does opening a file trigger the crash or adding certain files to the workspace folder? If you can attach before it crashes and then do something to trigger the crash, then you can get a crash call stack that way. |
We're very interested in fixing crashes. Information that could help us fix crashes include:
If you're experiencing a crash, any of the above information could be extremely useful to us to investigate and fix it. Please consider opening a new issue in this repo. Or, add a comment on this issue.
I'm pinning this issue, to make this more obvious to users who might be browsing our repo due to experiencing a crash.
The text was updated successfully, but these errors were encountered: