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

C_Cpp.intelliSenseCacheSize initially empty, causing language server crashes #11426

Closed
npnkhoi opened this issue Sep 11, 2023 · 9 comments
Closed
Labels
Feature: Configuration An issue related to configuring the extension or IntelliSense fixed Check the Milestone for the release in which the fix is or will be available. Language Service reliability
Milestone

Comments

@npnkhoi
Copy link

npnkhoi commented Sep 11, 2023

Environment

  • OS and Version: Ubuntu 22.04.2
  • VS Code Version: 1.82.0
  • C/C++ Extension Version: 1.17.5
  • If using SSH remote, specify OS of remote machine: N/A

Bug Summary and Steps to Reproduce

Bug Summary:
When I download this extention (ms-vscode.cpptools) and open a simple .C file, the language server says it crashes for 5 times in 3 minutes. After that, nothing about this extention works.

Looking at the settings of the extension, I saw that C_Cpp.intelliSenseCacheSize was empty. However, this field is required (VsCode show a red warning). When I fill the value 5120 to it and reload VsCode, the error disappears and everything works normally.

Steps to reproduce:

  1. On a new VsCode install on an environment similar to mine, download and install ms-vscode.cpptools.
  2. Open a simple .C file (e.g., hello world)
  3. See error -- the language server crashes.

Expected behavior:
The language server should not crash by default like that.

Configuration and Logs

{
  "configurations": [
    {
      "name": "linux-gcc-x64",
      "includePath": [
        "${workspaceFolder}/**"
      ],
      "compilerPath": "/usr/bin/gcc",
      "cStandard": "${default}",
      "cppStandard": "${default}",
      "intelliSenseMode": "linux-gcc-x64",
      "compilerArgs": [
        ""
      ]
    }
  ],
  "version": 4
}

// I cannot retrieve the Output now because I cannot clear the value of C_Cpp.intelliSenseCacheSize after setting it to a number.

Other Extensions

No response

Additional context

No response

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Sep 11, 2023

What exactly do you mean by "empty"? Also, what does the red warning say? I'm not able to get a crash or red error and I don't see where in the code it could be crashing.

@sean-mcmanus sean-mcmanus self-assigned this Sep 11, 2023
@sean-mcmanus sean-mcmanus added Language Service 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). Feature: Configuration An issue related to configuring the extension or IntelliSense reliability labels Sep 11, 2023
@npnkhoi
Copy link
Author

npnkhoi commented Sep 11, 2023

This is what I meant by "empty". I saw it like this when I was going through the settings of the extension. After I set it to 5120, the crashes went away.

image

@sean-mcmanus
Copy link
Contributor

@npnkhoi Can you click the Open JSON settings button in the top right of the settings UI? That will show what is actually being used.

@sean-mcmanus
Copy link
Contributor

@npnkhoi I just reproed the crash via setting it to a string instead of a number.

@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 Sep 12, 2023
@sean-mcmanus sean-mcmanus added this to the 1.18.0 milestone Sep 12, 2023
@sean-mcmanus
Copy link
Contributor

@npnkhoi But if your setting is set to something other than a string, let us know so we can handle that case too.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Sep 12, 2023

@npnkhoi FYI, this general issue is known to potentially be problematic/crash-causing and is tracked by #11375 , i.e. this could be considered a duplicate of that.

@sean-mcmanus
Copy link
Contributor

@npnkhoi Also, I assume you or something else must have set that to a string? I don't know how it could default to an invalid value. Maybe the workspace you opened had that setting already set?

@npnkhoi
Copy link
Author

npnkhoi commented Sep 12, 2023

Yes, it is possible that I might set it to some illegal values in JSON while messing around with the settings some time ago, but I cannot be sure because once I set it back to a valid number via GUI, I cannot set it to anything else.

To repro, I tried deleting the JSON setting file of the extension, and reinstall it (not a good repro in hindsight). The crashes went way then. So it is very likely that my existing JSON settings already had that invalid value.

@michelleangela michelleangela self-assigned this Sep 13, 2023
@bobbrow bobbrow added the fixed Check the Milestone for the release in which the fix is or will be available. label Sep 19, 2023
@michelleangela michelleangela removed their assignment Oct 10, 2023
@sean-mcmanus sean-mcmanus removed this from the 1.18 milestone Oct 12, 2023
@sean-mcmanus sean-mcmanus added this to the 1.18.0 milestone Oct 12, 2023
@sean-mcmanus
Copy link
Contributor

@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: Configuration An issue related to configuring the extension or IntelliSense 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

5 participants