cpptools causing vscode lock ups when bringing it up to foreground
So my VSCode has been having issues with small lock-ups for months now, and I've been putting off taking a look into it because I had other more important things. But it's gotten to a point that is really bothering me. For the last 2 weeks, I've been testing VSCode with all extensions disabled for one week, which I had no issues, and another week with only cpptools enabled, and it started to happen again. What happens is that, in a frequency that seems to be random, upon bringing any instance of VSCode to foreground, it locks up for about ~3 seconds, and that's per instance (it also happens when switching from one VSCode instance to another). I'm not exactly sure how to go about forcing this issue and gathering information about it. I think the information that it happens after bringing any single window of VSCode to foreground may be a clue. Not sure if perf would catch it, and it would have to monitor all instances for a long time. I'm on Fedora 42, VSCode 1.105.1, cpptools 1.28.3. Let me know what else I can help in debugging this.
@KaeLL What process do you see using CPU when the lockup happens? Does it repro for all workspaces? Does it repro when no files are open? With C_Cpp.loggingLevel set to "Debug" what logging do you see when it repros?
Do you have enough memory free? Have you seen it repro on any other OS?
Generally, our extension has no control over the VS Code UI so I'm not sure how we could be causing this.
@sean-mcmanus
What process do you see using CPU when the lockup happens?
I don't. I just used VSCode for about an hour with all extensions disabled, and within 2 minutes of using it with cpptools enabled, I could reproduce the issue.
Does it repro for all workspaces?
I didn't test it exhaustively, but it seems so.
Does it repro when no files are open?
No.
With C_Cpp.loggingLevel set to "Debug" what logging do you see when it repros?
Below is the log of one of the instances in which the issue happened.
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) cpptools/didChangeTextEditorSelection
LSP: (received) cpptools/getCodeActions: file:///home/ph/Documents/code/esp/main/main.c (id: 128)
LSP: (invoked) cpptools/getCodeActions: file:///home/ph/Documents/code/esp/main/main.c (id: 128)
LSP: Sending response (id: 128)
< LOCKS UP HERE FOR ABOUT ~2 SECONDS >
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) cpptools/didChangeTextEditorSelection
LSP: (received) cpptools/getCodeActions: file:///home/ph/Documents/code/esp/main/main.c (id: 129)
LSP: (invoked) cpptools/getCodeActions: file:///home/ph/Documents/code/esp/main/main.c (id: 129)
LSP: Sending response (id: 129)
Do you have enough memory free?
About 20GiB free.
Have you seen it repro on any other OS?
No, nor can I easily test that, since I don't have a Windows install on my machine anymore.
It only takes two open instances of VSCode, each with a source code file open, and the cursor on them, and by just alt-tabbing between them, clicking with the mouse on another section of the code, or scroolling up or down, I get the lock-ups.
Hey @sean-mcmanus, this issue might need further attention.
@KaeLL, you can help us out by closing this issue if the problem no longer exists, or adding more information.