Closed shenjiangqiu closed 2 months ago
Hi @shenjiangqiu . I'm trying to make sense of your logs. I see that the crash seems to be happening here:
LSP: (received) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 8)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 8)
LSP: Sending response (id: 8)
<crashed here>
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
IntelliSense update scheduled and TU acquisition started for: file:///home/sjq/Docs/main.cc
Populating file name cache...
Done populating filename cache. Elapsed time: 2 ms
Resolving recursive includes...
Done resolving recursive includes.
<crashed here>
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
These seem to suggest the crash is somehow related to processing IntelliSense for that file. Does the crash occur if you use a source file with very simple contents (no includes and maybe a variable in it), or is the problem specific to content in main.cc
?
If the crash does not occur until you open that (or any) file, could you try attaching a debugger to the main cpptools process prior to opening the source file, and capturing all stacks once the crash is caught? Instruction on how to do this are here: https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv Crash stacks could be very helpful.
@Colengms The main.cc is a simple empty main function. It crashes for every source file I tried.
@Colengms I just reinstalled Ubuntu 22.04 on another disk, the problems happened again. So I think it's not a disk problem.
the problem has been fixed:
I update the MSI bios to latest version and this bug disappeared. It might be helpful for preventing further similar problem.
I find there is an error message from system boot:
RDRAND gives funky smelling output, might consider not using it
and the log from plugin says Warning: Database safety check failed. Recreating database.[rc=0x80004005] (DB: false, Expected: true)
I thing there might be some relation ship between the random device and the cpp plugin.
Aha. I'm glad you figured it out. This would appear to be the same issue as: https://github.com/microsoft/vscode-cpptools/issues/8386
Note that we may still have a bug here that could be fixed. I don't think the Ryzen 3000(?) bug with RDRAND would cause a crash, just insufficiently random values. If we're crashing, there may be another issue here that could be addressed, perhaps when duplicate randomly generated GUID values are used for RPC channels. Re-opening the issue, to investigate... Maybe we can repro the crash by injecting insufficiently random values.
@Colengms Yes, It's Ryzen 3700x.
@shenjiangqiu Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.21.1
Environment
Bug Summary and Steps to Reproduce
Bug Summary: for any project, the language server crashed.
Steps to reproduce:
Expected behavior: not crash
Configuration and Logs
logs:
config:
config:
language server logs:
Other Extensions
Additional context
I have do the following tests:
I think it might be a hardware error. But I don't know how to confirm, any suggesstions?