Skip to content
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

The language server crashes for large number of files #11226

Closed
MightTower opened this issue Jul 20, 2023 · 7 comments
Closed

The language server crashes for large number of files #11226

MightTower opened this issue Jul 20, 2023 · 7 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service reliability
Milestone

Comments

@MightTower
Copy link

Environment

  • OS and Version: Windows 10 Enterprise 22H2
  • VS Code Version: 1.74.1
  • C/C++ Extension Version: v1.16.3

Bug Summary and Steps to Reproduce

Bug Summary:
As soon as I open VSCode and open a cpp file I get the warning "The language server crashed. Restarting..." after some delay and after that "The language server crashed 5 times in the last 3 minutes. It will not be restarted.".
If I attach a debugger I get a "Stack overflow exception" and 5000 times "cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)" in the callstack.
I tried to reinstall the extension and VSCode completely.

Steps to reproduce:

  1. Open c cpp file in VSCode
  2. See warnings "The language server crashed. Restarting..." and " "The language server crashed 5 times in the last 3 minutes. It will not be restarted."

Expected behavior:
The extension works and does not crash

Configuration and Logs

Configurations in c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Win32",
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.10586.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "intelliSenseMode": "msvc-x64",
            "configurationProvider": "vector-of-bool.cmake-tools",
            "compileCommands": "${TOM_COMPILE_DIR}/compile_commands.json"
        }
    ],
    "version": 4
}

Logs from running C/C++: Log Diagnostics from the VS Code command palette

-------- Diagnostics - 20.7.2023, 12:15:24
Version: 1.16.3
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "x"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.22000.0",
    "compilerPath": "cl.exe",
    "cStandard": "c17",
    "cppStandard": "c++17",
    "compilerPathInCppPropertiesJson": "cl.exe",
    "intelliSenseMode": "windows-msvc-x64",
    "intelliSenseModeIsExplicit": true,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPathIsExplicit": false,
    "configurationProvider": "ms-vscode.cmake-tools",
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": [
		x
    ],
    "compilerPath": "c:/program files/microsoft visual studio/2022/17.2/vc/tools/msvc/14.32.31326/bin/hostx64/x64/cl.exe",
    "compilerArgs": [],
    "compilerFragments": []
}
Custom configurations:
[ x ]
{
    "includePath": [
       x
    ],
    "defines": [
       x
    ],
    "compilerPath": "c:/program files/microsoft visual studio/2022/17.2/vc/tools/msvc/14.32.31326/bin/hostx64/x64/cl.exe",
    "compilerArgs": [],
    "compilerFragments": [
        "/DWIN32 /D_WINDOWS /EHsc /W4 /Ob0 /Od /RTC1 -std:c++17 -MD -Zi",
        "/X",
        "/nologo",
        "/c",
        "/Zo",
        "/FC",
        "/Zc:forScope",
        "/bigobj",
        "/EHcs",
        "/Zm300",
        "/Zc:referenceBinding",
        "/wd4290",
        "/wd4288",
        "/wd4355",
        "/wd4351",
        "/wd4996",
        "/we4062",
        "/w14018",
        "/w14789",
        "/w14701",
        "/w14703",
        "/wd4127",
        "/wd4245",
        "/wd4267",
        "/wd4512",
        "/wd4510",
        "/wd4250",
        "/wd4251",
        "/wd4201",
        "/wd4834",
        "/wd4456",
        "/wd4189",
        "/wd4101",
        "/wd4324",
        "/wd4714",
        "/openmp"
    ]
}
cpptools version (native): 1.16.3.0
Translation Unit Mappings:
[ x ]:
    x
Translation Unit Configurations:
[ x ]:
    Process ID: 22560
    Memory Usage: 365 MB
    Compiler Path: C:\Program Files\Microsoft Visual Studio\2022\17.2\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\cl.exe
    Includes:
        x
    Defines:
        x
    Standard Version: ms_c++17
    IntelliSense Mode: windows-msvc-x64
    Other Flags:
        --new_for_init
        --no_nonconst_ref_anachronism
Total Memory Usage: 365 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 38055





Logs from the language server logging:
[Error - 12:14:05] Sending request cpptools/getSemanticTokens failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:14:05] Sending request cpptools/getInlayHints failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:14:05] The language server crashed. Restarting...

Other Extensions

Some but even if I disable them all, the behavior does not change.

Additional context

cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
cpptools.exe!std::_Ref_count_obj2::_Destroy(void) (Unknown Source:0)
...... (5000 lines until
The maximum number of stack frames supported by Visual Studio has been exceeded. (Unknown Source:0)

@michelleangela
Copy link
Contributor

@MightTower
Does the language server crash if you try to down grade to the previous version 1.15.4? Does it only crash for a specific project, or does it call crash for any project such as a folder with a one simple source file?

Also as an FYI, the owner of the configuration provider vector-of-bool.cmake-tools has changed from vector-of-bool to Microsoft and is now published as ms-vscode.cmake-tools. Though the logs show that the extension does change it to ms-vscode.cmake-tools internally when it's processed.

@michelleangela michelleangela added Language Service more info needed The issue report is not actionable in its current state labels Jul 20, 2023
@MightTower
Copy link
Author

@michelleangela
Does the language server crash if you try to down grade to the previous version 1.15.4?
Yes

Does it only crash for a specific project, or does it call crash for any project such as a folder with a one simple source file?
It only crashes for some projects (the newer branches of our project) for older branches or really simple projects I can not reproduce it. I will try to figure out what changed but it probably will take me some time, so if you have any hit what to look for or any other suggestion I would appreciate it.

Thanks for the hint with cmake, I updated it to the newest release version now.

@Colengms Colengms added bug fixed Check the Milestone for the release in which the fix is or will be available. and removed more info needed The issue report is not actionable in its current state labels Jul 21, 2023
@Colengms Colengms added this to the 1.17 milestone Jul 21, 2023
@Colengms
Copy link
Collaborator

Colengms commented Jul 21, 2023

This particular crash stack had been reported (outside of GitHub) and has been fixed. Using this issue to track the fix in 1.17.0.

I believe the cause is related to parsing directories containing a very large number of files, in case that might suggest any potential work-arounds.

@michelleangela michelleangela modified the milestones: 1.17, 1.17.0 Jul 21, 2023
@michelleangela michelleangela changed the title The language server crashed. Restarting... The language server crashes for large number of files Jul 21, 2023
@michelleangela
Copy link
Contributor

@michelleangela
Copy link
Contributor

@michelleangela
Copy link
Contributor

@MightTower
Could you try out 1.17.2 and see if the issue is fixed?

@MightTower
Copy link
Author

With the pre-release it worked, I have just installed 1.17.2 and it seems the issue is fixed here as well.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service reliability
Projects
None yet
Development

No branches or pull requests

3 participants