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

cpptools-srv stuck at 100% CPU, blocking VScode CoPilot #12750

Open
janfeitsma opened this issue Sep 22, 2024 · 4 comments
Open

cpptools-srv stuck at 100% CPU, blocking VScode CoPilot #12750

janfeitsma opened this issue Sep 22, 2024 · 4 comments
Assignees
Labels
bug Feature: Copilot Context Integration with GitHub Copilot that provides additional context info Feature: Copilot Hover GitHub Copilot hover "Generate Copilot summary" feature fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix regression A bug that didn't exist in a previous release
Milestone

Comments

@janfeitsma
Copy link

Environment

  • OS and Version: Ubuntu20.04
  • VS Code Version: 1.93.1
  • C/C++ Extension Version: v1.22.4 (pre-release)
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:

Laptop heats up, fan goes to 100% when using VScode. Inline copilot symbol (yellow stars) disappeared.
Process cpptools-srv is at 100% for 30minutes already.

Steps to reproduce:
Depends on my codebase / branch. If needed, I can share a link.
But I would prefer instead some debug logging / insight which file it is having so much trouble with.

Expected behavior:
No laptop overheating. Proper copilot function.

Configuration and Logs

Configurations in c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}
-------- Diagnostics - 9/22/2024, 3:05:02 PM
Version: 1.22.4
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/home/jan/github/MRA-components/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "c11",
    "cppStandard": "c++17",
    "intelliSenseMode": "gcc-x64",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "compilerPathInCppPropertiesJson": "/usr/bin/gcc",
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "myredactedrepo/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Modified Settings:
{
    "C_Cpp.intelliSenseEngine": "Tag Parser",
    "C_Cpp.intelliSenseCacheSize": 0,
    "C_Cpp.loggingLevel": "Debug",
    "C_Cpp.updateChannel": "Insiders"
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {
        "*.inc": "cpp",
        "cctype": "cpp",
        "clocale": "cpp",
        "cmath": "cpp",
        "csetjmp": "cpp",
        "csignal": "cpp",
        "cstdarg": "cpp",
        "cstddef": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cstring": "cpp",
        "ctime": "cpp",
        "cwchar": "cpp",
        "cwctype": "cpp",
        "*.ipp": "cpp",
        "any": "cpp",
        "array": "cpp",
        "atomic": "cpp",
        "hash_map": "cpp",
        "hash_set": "cpp",
        "strstream": "cpp",
        "*.tcc": "cpp",
        "bitset": "cpp",
        "cfenv": "cpp",
        "charconv": "cpp",
        "chrono": "cpp",
        "cinttypes": "cpp",
        "codecvt": "cpp",
        "complex": "cpp",
        "condition_variable": "cpp",
        "cstdint": "cpp",
        "deque": "cpp",
        "forward_list": "cpp",
        "list": "cpp",
        "unordered_map": "cpp",
        "unordered_set": "cpp",
        "vector": "cpp",
        "exception": "cpp",
        "algorithm": "cpp",
        "functional": "cpp",
        "iterator": "cpp",
        "map": "cpp",
        "memory": "cpp",
        "memory_resource": "cpp",
        "numeric": "cpp",
        "optional": "cpp",
        "random": "cpp",
        "ratio": "cpp",
        "regex": "cpp",
        "set": "cpp",
        "string": "cpp",
        "string_view": "cpp",
        "system_error": "cpp",
        "tuple": "cpp",
        "type_traits": "cpp",
        "utility": "cpp",
        "fstream": "cpp",
        "future": "cpp",
        "initializer_list": "cpp",
        "iomanip": "cpp",
        "iosfwd": "cpp",
        "iostream": "cpp",
        "istream": "cpp",
        "limits": "cpp",
        "mutex": "cpp",
        "new": "cpp",
        "ostream": "cpp",
        "scoped_allocator": "cpp",
        "shared_mutex": "cpp",
        "sstream": "cpp",
        "stdexcept": "cpp",
        "streambuf": "cpp",
        "thread": "cpp",
        "typeindex": "cpp",
        "typeinfo": "cpp",
        "valarray": "cpp",
        "variant": "cpp",
        "bit": "cpp"
    },
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.22.4.0
No active translation units.

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 495041
Number of files parsed: 27317



### Other Extensions

_No response_

### Additional context

Tried various settings already. Tried debugger but could not see anything. (May also be my fault for not being expert enough.)
@sean-mcmanus
Copy link
Contributor

With "C_Cpp.intelliSenseEngine": "Tag Parser", set, cpptools-srv is not supposed to be launched. I'm guessing the copilot call back code is not checking for that setting and trying to launch cpptools-srv when it shouldn't. Changing Cpp.intelliSenseEngine to "default" might fix it, not sure yet.

@sean-mcmanus sean-mcmanus added bug Language Service regression A bug that didn't exist in a previous release insiders Currently only repros with our latest Insiders release. labels Sep 23, 2024
@sean-mcmanus sean-mcmanus added this to the 1.22 milestone Sep 23, 2024
@sean-mcmanus
Copy link
Contributor

I'm not able to repro this. I don't see a cpptools-srv launched when C_Cpp.intelliSenseEngine is "Tag Parser". I'll ask if anyone else on our team is able to repro it.

@sean-mcmanus sean-mcmanus added more info needed The issue report is not actionable in its current state not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one). labels Sep 23, 2024
@janfeitsma
Copy link
Author

Thanks Sean.

I kicked out all the custom C_Cpp settings which I gathered over the past weeks trying to debug this specifically:

myrepo/.vscode/settings.json

    "C_Cpp.intelliSenseCacheSize": 0,
    "C_Cpp.intelliSenseUpdateDelay": 300,
    "C_Cpp.intelliSenseEngine": "Tag Parser",
    "C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
    "C_Cpp.loggingLevel": "Debug"

Had a closer look at the ps tree, I noticed two versions of cpptools running: 1.22.4 and 1.22.3. Now I wonder: maybe cpptools-srv was somehow associated to the older one. So I did a reboot.

Soon after restarting vscode and resuming development, cpptools-srv appeared again. Running 100% CPU for a while.
Problem persists.

Maybe relevant to mention I use bazel build.
What other info should I provide?

@sean-mcmanus sean-mcmanus modified the milestones: 1.22, 1.23 Oct 3, 2024
@sean-mcmanus sean-mcmanus removed the insiders Currently only repros with our latest Insiders release. label Dec 14, 2024
@sean-mcmanus sean-mcmanus modified the milestones: 1.23, 1.23.3 Dec 14, 2024
@sean-mcmanus sean-mcmanus self-assigned this Dec 14, 2024
@sean-mcmanus sean-mcmanus removed more info needed The issue report is not actionable in its current state not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one). labels Dec 14, 2024
@sean-mcmanus
Copy link
Contributor

@janfeitsma We can fix it so it doesn't launch the cpptools-srv process (#13058). I'm guessing I might not have reproed it earlier due to some Copilot issue may not have triggered the getIncludes request.

@sean-mcmanus sean-mcmanus added quick fix Feature: Copilot Context Integration with GitHub Copilot that provides additional context info Feature: Copilot Hover GitHub Copilot hover "Generate Copilot summary" feature labels Dec 14, 2024
@sean-mcmanus sean-mcmanus moved this to Pull Request in cpptools Dec 16, 2024
@sean-mcmanus sean-mcmanus moved this from Pull Request to Done in cpptools Dec 17, 2024
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature: Copilot Context Integration with GitHub Copilot that provides additional context info Feature: Copilot Hover GitHub Copilot hover "Generate Copilot summary" feature fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix regression A bug that didn't exist in a previous release
Projects
Status: Done
Development

No branches or pull requests

2 participants