microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

Crash in code_analysis::process_async::cleanup() #12615

Open sean-mcmanus opened 3 weeks ago

sean-mcmanus commented 3 weeks ago
          I have also this issue since some weeks. 
cpptools
8/22/2024, 3:51:00 PM
SIGSEGV
code_analysis::process_async::cleanup() const+767
code_analysis::process_async::main()+1419
code_analysis::process_async_work(unsigned int, file_uri const&, std::optional<file_uri>&&, std::shared_ptr<workspace_folder_context> const&, std::shared_ptr<intellisense_client_config> const&)+103
msvc::thread_manager_t::do_work(unsigned int)+486

With the same setup I had no troubles approx. two weeks before.

Originally posted by @daniel-brosche in https://github.com/microsoft/vscode-cpptools/issues/12554#issuecomment-2305163709

sean-mcmanus commented 3 weeks ago

@daniel-brosche Do you have any repro details? That might help.

i.e. does the repro require certain settings to be set or a particular repro file or particular actions?

sean-mcmanus commented 3 weeks ago

@daniel-brosche Is this a random crash? Do you know if it repros with more cores or with more clang-tidy processes running?

daniel-brosche commented 3 weeks ago

This crash happens during my regular work at least every hour or so and then the extension restarts automatically. I have configured clang-tidy to automatically format on save. I'm using vscode with WSL. Extension Version is: v1.21.6. What I have seen a couple of times is, that the crash also happens directly after starting C++ Debugger but also noticed it during other actions.

Here my cpp settings:


        // globaly disable format on save
        "editor.formatOnSave": false,
        // just enable for h/c/cpp files
        "[cpp]": {
            "editor.formatOnSave": true
        },
        "[c]": {
            "editor.formatOnSave": true
        },

        // paths that should be ignored in general, reduce overhead
        "files.watcherExclude": {
            "**/.git/objects/**": true,
            "**/node_modules/**": true,
            "**/__pycache__": true,
            "**/.ipch": true,
            // ignore toolchains
            "**/x86_64/**": true,
            "**/armhf/**": true,
        },

                ///////////////////////////////////////////////////////////////////////////////////////////
        // CPP settings
        ///////////////////////////////////////////////////////////////////////////////////////////
        "C_Cpp.intelliSenseCachePath": "${workspaceFolder}/.vscode/",
        "C_Cpp.intelliSenseCacheSize": 5120,
        "C_Cpp.intelliSenseMemoryLimit": 16384,
        "C_Cpp.intelliSenseEngine": "default",
        "C_Cpp.autocomplete": "default",
        "C_Cpp.errorSquiggles": "disabled",
        "C_Cpp.default.forcedInclude": [],
        "C_Cpp.default.systemIncludePath": [],
        "C_Cpp.default.includePath": [],
        "C_Cpp.default.compileCommands": "${workspaceFolder:server}/.vscode/build/compile_commands.json",
        "C_Cpp.default.browse.databaseFilename": "${workspaceFolder:server}/.vscode/ipch/intellisense.db",
        "C_Cpp.default.compilerPath": "${workspaceFolder:server}/../../tools/x86_64/bin/x86_64-linux-gnu-gcc",
        "C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
        "C_Cpp.default.cStandard": "gnu17",
        "C_Cpp.default.cppStandard": "gnu++17",
        "C_Cpp.default.intelliSenseMode": "gcc-x64",
        "C_Cpp.default.mergeConfigurations": true,

        ///////////////////////////////////////////////////////////////////////////////////////////
        // exclude folders from analyzing to reduce overhead
        "C_Cpp.exclusionPolicy": "checkFolders",
        "C_Cpp.files.exclude": {
            "**/.git": true,
            "**/.vscode": true,
            "**/.ipch": true,
            "**/build": true,
            "**/build_tools": true,
            // ignore toolchains
            "**/x86_64/**": true,
            "**/armhf/**": true
        },

        "C_Cpp.codeAnalysis.exclude": {
            "**/.git": true,
            "**/.vscode": true,
            "**/.ipch": true,
            "**/build": true,
            "**/fmt": true,
            "**/pugixml": true,
            "**/spdlog": true,
            "**/uuspr": true,
            "**/build_tools": true,
            // ignore toolchains
            "**/x86_64/**": true,
            "**/armhf/**": true,
        },

        ///////////////////////////////////////////////////////////////////////////////////////////
        // cpp formatting settings
        "C_Cpp.formatting": "clangFormat",
        "C_Cpp.clang_format_style": "file",

        ///////////////////////////////////////////////////////////////////////////////////////////
        // cpp clang tidy analyzing settings        
        "C_Cpp.codeAnalysis.runAutomatically": true,
        "C_Cpp.codeAnalysis.clangTidy.codeAction.formatFixes": false,
        "C_Cpp.codeAnalysis.clangTidy.useBuildPath": true,
        "C_Cpp.codeAnalysis.clangTidy.config": "",
        "C_Cpp.codeAnalysis.clangTidy.fallbackConfig": "",
        "C_Cpp.codeAnalysis.clangTidy.path": "${workspaceFolder}/../../tools/clang_tidy/bin/clang-tidy",
        "C_Cpp.codeAnalysis.clangTidy.args": [
            "--extra-arg=-ferror-limit=1" // show what have been found until error
        ],
        "C_Cpp.codeAnalysis.clangTidy.enabled": true,
sean-mcmanus commented 2 weeks ago

@daniel-brosche We made some potential fixes with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.22.0, but we don't know yet whether it's actually fixed or not.