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

Ryzen 3000 RDRAND bug causes cpptools to crash. (Can be fixed by updating BIOS, but probably shouldn't crash). #12201

Open
4 tasks done
shenjiangqiu opened this issue Apr 15, 2024 · 6 comments
Labels
investigate This issue needs to be investigated/confirmed Language Service reliability

Comments

@shenjiangqiu
Copy link

shenjiangqiu commented Apr 15, 2024

Environment

  • OS and Version: Macos 14.4.1, archlinux rolling
  • VS Code Version: 1.88.1
  • C/C++ Extension Version: v1.20.1, v1.19.9 (tested both and older )
  • If using SSH remote, specify OS of remote machine: archlinux rolling(tested) ubuntu 22.04(tested)

Bug Summary and Steps to Reproduce

Bug Summary:
for any project, the language server crashed.

Steps to reproduce:

  1. create a new folder
  2. create a main.cc: int main(){return 0;}
  3. open that folder on vscode
  4. open that main.cc
  5. crashed.

Expected behavior:
not crash

Configuration and Logs

logs:

loggingLevel: Debug
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.20.1
cpptools version (native): 1.20.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: Sending response (id: 1)
LSP: (received) cpptools/queryCompilerDefaults (id: 2)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 2)
Querying compiler for default C++ language standard using command line: /usr/bin/clang -x c++ -E -dM /dev/null
Detected language standard version: c++14
Querying compiler's default target using command line: "/usr/bin/clang" -dumpmachine
Compiler returned default target value: x86_64-pc-linux-gnu
Compiler query command line: /usr/bin/clang -std=c17 -m64 -Wp,-v -fno-blocks -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/clang'
Compiler query command line: /usr/bin/clang -std=c++14 -m64 -Wp,-v -fno-blocks -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/clang'
LSP: Sending response (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 3)
LSP: (received) cpptools/didChangeCppProperties (id: 4)
LSP: Sending response (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 4)
initializing full-text search tables
populating full-text search tables
enabling full-text triggers
Code browsing service initialized
  Folder: /usr/include/ will be indexed
  Folder: /usr/lib/llvm-14/lib/clang/14.0.0/include/ will be indexed
  Folder: /usr/local/include/ will be indexed
  Folder: /home/sjq/Docs/ will be indexed
LSP: Sending response (id: 4)
Discovering files...
  Processing folder (recursive): /usr/include/
  Processing folder (recursive): /usr/lib/llvm-14/lib/clang/14.0.0/include/
  Processing folder (recursive): /usr/local/include/
  Processing folder (recursive): /home/sjq/Docs/
  Discovering files: 5041 file(s) processed
  0 file(s) removed from database
Done discovering files.
Populating include completion cache.
Parsing remaining files...
  Parsing: 0 files(s) processed
Done parsing remaining files.
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: Message ignored due to no registered handler: $/setTrace
LSP: (received) cpptools/didChangeSettings
LSP: (invoked) cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Database safe to open.
LSP: (received) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (invoked) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
  tag parsing file: /home/sjq/Docs/main.cc
LSP: (received) cpptools/fileCreated: file:///home/sjq/Docs/main.cc
LSP: (invoked) cpptools/fileCreated: file:///home/sjq/Docs/main.cc
Intellisense update pending for: file:///home/sjq/Docs/main.cc
LSP: (received) textDocument/didSave: file:///home/sjq/Docs/main.cc
LSP: (invoked) textDocument/didSave: file:///home/sjq/Docs/main.cc
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (received) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
  tag parsing file: /home/sjq/Docs/main.cc
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Intellisense update pending for: file:///home/sjq/Docs/main.cc
LSP: (invoked) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: Sending response (id: 5)
LSP: (received) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: Sending response (id: 6)
LSP: (received) cpptools/fileChanged: file:///home/sjq/Docs/main.cc
LSP: (invoked) cpptools/fileChanged: file:///home/sjq/Docs/main.cc
IntelliSense update scheduled and TU acquisition started for: file:///home/sjq/Docs/main.cc
Populating file name cache...
Done populating filename cache. Elapsed time: 6 ms
Resolving recursive includes...
Done resolving recursive includes.
LSP: (received) cpptools/getFoldingRanges: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (invoked) cpptools/getFoldingRanges: file:///home/sjq/Docs/main.cc (id: 7)
LSP: Sending response (id: 7)
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)
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.20.1
cpptools version (native): 1.20.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: Sending response (id: 1)
LSP: (received) cpptools/queryCompilerDefaults (id: 2)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 2)
Querying compiler for default C++ language standard using command line: /usr/bin/clang -x c++ -E -dM /dev/null
Detected language standard version: c++14
Querying compiler's default target using command line: "/usr/bin/clang" -dumpmachine
Compiler returned default target value: x86_64-pc-linux-gnu
Compiler query command line: /usr/bin/clang -std=c17 -m64 -Wp,-v -fno-blocks -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/clang'
Compiler query command line: /usr/bin/clang -std=c++14 -m64 -Wp,-v -fno-blocks -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/clang'
LSP: Sending response (id: 2)
LSP: (received) cpptools/didChangeCppProperties (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 3)
LSP: (received - deferred) textDocument/didOpen: file:///home/sjq/Docs/main.cc
Warning: Database safety check failed. Recreating database.
[rc=0x80004005] (DB: false, Expected: true)
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (received - deferred) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (received - deferred) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (received - deferred) cpptools/resumeParsing
LSP: (received - deferred) cpptools/didChangeVisibleTextEditors
initializing full-text search tables
populating full-text search tables
enabling full-text triggers
Code browsing service initialized
  Folder: /usr/include/ will be indexed
  Folder: /usr/lib/llvm-14/lib/clang/14.0.0/include/ will be indexed
  Folder: /usr/local/include/ will be indexed
  Folder: /home/sjq/Docs/ will be indexed
LSP: (queued) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (queued) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (queued) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (queued) cpptools/resumeParsing
LSP: (queued) cpptools/didChangeVisibleTextEditors
LSP: Sending response (id: 3)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (invoked) textDocument/didOpen: file:///home/sjq/Docs/main.cc
Discovering files...
  Processing folder (recursive): /usr/include/
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: Sending response (id: 6)
LSP: (invoked) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
Intellisense update pending for: file:///home/sjq/Docs/main.cc
  tag parsing file: /home/sjq/Docs/main.cc
LSP: $/cancelRequest (cpptools/getDocumentSymbols, id: 4)
LSP: $/cancelRequest (cpptools/getDocumentSymbols, id: 5)
LSP: $/cancelRequest (<unknown/completed>, id: 6)
LSP: (received) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (received) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
LSP: (invoked) cpptools/resumeParsing
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Intellisense update pending for: file:///home/sjq/Docs/main.cc
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
LSP: Sending response (id: 8)
LSP: Sending response (id: 7)
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.
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.20.1
cpptools version (native): 1.20.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: Sending response (id: 1)
LSP: (received) cpptools/queryCompilerDefaults (id: 2)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 2)
Querying compiler for default C++ language standard using command line: /usr/bin/clang -x c++ -E -dM /dev/null
Detected language standard version: c++14
Querying compiler's default target using command line: "/usr/bin/clang" -dumpmachine
Compiler returned default target value: x86_64-pc-linux-gnu
Compiler query command line: /usr/bin/clang -std=c17 -m64 -Wp,-v -fno-blocks -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/clang'
Compiler query command line: /usr/bin/clang -std=c++14 -m64 -Wp,-v -fno-blocks -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/clang'
LSP: Sending response (id: 2)
LSP: (received) cpptools/didChangeCppProperties (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 3)
LSP: (received - deferred) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (received - deferred) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (received - deferred) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (received - deferred) cpptools/resumeParsing
LSP: (received - deferred) cpptools/didChangeVisibleTextEditors
Warning: Database safety check failed. Recreating database.
[rc=0x80004005] (DB: false, Expected: true)
initializing full-text search tables
LSP: $/cancelRequest (cpptools/getDocumentSymbols, id: 4)
LSP: $/cancelRequest (cpptools/getDocumentSymbols, id: 5)
LSP: $/cancelRequest (cpptools/getCodeActions, id: 6)
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (received - deferred) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
populating full-text search tables
enabling full-text triggers
Code browsing service initialized
  Folder: /usr/include/ will be indexed
  Folder: /usr/lib/llvm-14/lib/clang/14.0.0/include/ will be indexed
  Folder: /usr/local/include/ will be indexed
  Folder: /home/sjq/Docs/ will be indexed
LSP: (queued) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (queued) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (queued) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (queued) cpptools/resumeParsing
LSP: (queued) cpptools/didChangeVisibleTextEditors
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (queued) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
LSP: Sending response (id: 3)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
Discovering files...
LSP: (invoked) textDocument/didOpen: file:///home/sjq/Docs/main.cc
  Processing folder (recursive): /usr/include/
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (invoked) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
Intellisense update pending for: file:///home/sjq/Docs/main.cc
  tag parsing file: /home/sjq/Docs/main.cc
LSP: (invoked) cpptools/resumeParsing
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Intellisense update pending for: file:///home/sjq/Docs/main.cc
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
LSP: Sending response (id: 8)
LSP: Sending response (id: 7)
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.
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.20.1
cpptools version (native): 1.20.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: Sending response (id: 1)
LSP: (received) cpptools/queryCompilerDefaults (id: 2)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 2)
Querying compiler for default C++ language standard using command line: /usr/bin/clang -x c++ -E -dM /dev/null
Detected language standard version: c++14
Querying compiler's default target using command line: "/usr/bin/clang" -dumpmachine
Compiler returned default target value: x86_64-pc-linux-gnu
Compiler query command line: /usr/bin/clang -std=c17 -m64 -Wp,-v -fno-blocks -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/clang'
Compiler query command line: /usr/bin/clang -std=c++14 -m64 -Wp,-v -fno-blocks -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/clang'
LSP: Sending response (id: 2)
LSP: (received) cpptools/didChangeCppProperties (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 3)
LSP: (received - deferred) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (received - deferred) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (received - deferred) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (received - deferred) cpptools/resumeParsing
LSP: (received - deferred) cpptools/didChangeVisibleTextEditors
Warning: Database safety check failed. Recreating database.
[rc=0x80004005] (DB: false, Expected: true)
initializing full-text search tables
populating full-text search tables
enabling full-text triggers
Code browsing service initialized
  Folder: /usr/include/ will be indexed
  Folder: /usr/lib/llvm-14/lib/clang/14.0.0/include/ will be indexed
  Folder: /usr/local/include/ will be indexed
  Folder: /home/sjq/Docs/ will be indexed
LSP: (queued) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (queued) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (queued) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (queued) cpptools/resumeParsing
LSP: (queued) cpptools/didChangeVisibleTextEditors
LSP: Sending response (id: 3)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (invoked) textDocument/didOpen: file:///home/sjq/Docs/main.cc
Discovering files...
  Processing folder (recursive): /usr/include/
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: Sending response (id: 6)
LSP: (invoked) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
Intellisense update pending for: file:///home/sjq/Docs/main.cc
LSP: $/cancelRequest (cpptools/getDocumentSymbols, id: 4)
LSP: $/cancelRequest (cpptools/getDocumentSymbols, id: 5)
LSP: (received) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
  tag parsing file: /home/sjq/Docs/main.cc
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (received) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
LSP: (invoked) cpptools/resumeParsing
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Intellisense update pending for: file:///home/sjq/Docs/main.cc
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
LSP: Sending response (id: 8)
LSP: Sending response (id: 7)
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.
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.20.1
cpptools version (native): 1.20.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: Sending response (id: 1)
LSP: (received) cpptools/queryCompilerDefaults (id: 2)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 2)
Querying compiler for default C++ language standard using command line: /usr/bin/clang -x c++ -E -dM /dev/null
Detected language standard version: c++14
Querying compiler's default target using command line: "/usr/bin/clang" -dumpmachine
Compiler returned default target value: x86_64-pc-linux-gnu
Compiler query command line: /usr/bin/clang -std=c17 -m64 -Wp,-v -fno-blocks -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/clang'
Compiler query command line: /usr/bin/clang -std=c++14 -m64 -Wp,-v -fno-blocks -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/clang'
LSP: Sending response (id: 2)
LSP: (received) cpptools/didChangeCppProperties (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 3)
LSP: (received - deferred) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (received - deferred) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (received - deferred) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (received - deferred) cpptools/resumeParsing
Warning: Database safety check failed. Recreating database.
[rc=0x80004005] (DB: false, Expected: true)
LSP: (received - deferred) cpptools/didChangeVisibleTextEditors
initializing full-text search tables
LSP: $/cancelRequest (cpptools/getDocumentSymbols, id: 4)
LSP: $/cancelRequest (cpptools/getDocumentSymbols, id: 5)
LSP: $/cancelRequest (cpptools/getCodeActions, id: 6)
LSP: (received - deferred) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (received - deferred) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
populating full-text search tables
enabling full-text triggers
Code browsing service initialized
  Folder: /usr/include/ will be indexed
  Folder: /usr/lib/llvm-14/lib/clang/14.0.0/include/ will be indexed
  Folder: /usr/local/include/ will be indexed
  Folder: /home/sjq/Docs/ will be indexed
LSP: (queued) textDocument/didOpen: file:///home/sjq/Docs/main.cc
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 4)
LSP: (queued) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (queued) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
LSP: (queued) cpptools/resumeParsing
LSP: (queued) cpptools/didChangeVisibleTextEditors
LSP: (queued) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (queued) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
LSP: Sending response (id: 3)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 5)
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/sjq/Docs/main.cc (id: 7)
LSP: (invoked) textDocument/didOpen: file:///home/sjq/Docs/main.cc
Discovering files...
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 6)
LSP: (invoked) cpptools/didChangeActiveEditor: file:///home/sjq/Docs/main.cc
Intellisense update pending for: file:///home/sjq/Docs/main.cc
  tag parsing file: /home/sjq/Docs/main.cc
  Processing folder (recursive): /usr/include/
LSP: (invoked) cpptools/resumeParsing
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Intellisense update pending for: file:///home/sjq/Docs/main.cc
LSP: (invoked) cpptools/getCodeActions: file:///home/sjq/Docs/main.cc (id: 8)
LSP: Sending response (id: 8)
LSP: Sending response (id: 7)
IntelliSense update scheduled and TU acquisition started for: file:///home/sjq/Docs/main.cc
Populating file name cache...
Done populating filename cache. Elapsed time: 1 ms
Resolving recursive includes...
Done resolving recursive includes.

config:

config:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "linux-clang-x64",
            
        }
    ],
    "version": 4
}

language server logs:

[Error - 7:54:26 PM] The language server crashed 5 times in the last 3 minutes. It will not be restarted.

Other Extensions

  • C++
  • Cmake
  • Cmake Tools
  • C++ themes

Additional context

I have do the following tests:

  • reinstall the os on the same disk on remote machine ( from archlinux to ubuntu 22.04)
  • I tested to connect the remote machine from several local machine
  • I tried to fully delete and install the code server, and the extensions.
  • I tried some older versions and the pre-release version.

I think it might be a hardware error. But I don't know how to confirm, any suggesstions?

@Colengms
Copy link
Collaborator

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.

@shenjiangqiu
Copy link
Author

@Colengms The main.cc is a simple empty main function. It crashes for every source file I tried.

@shenjiangqiu
Copy link
Author

@Colengms I just reinstalled Ubuntu 22.04 on another disk, the problems happened again. So I think it's not a disk problem.

@shenjiangqiu
Copy link
Author

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.

@sean-mcmanus sean-mcmanus closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@Colengms
Copy link
Collaborator

Aha. I'm glad you figured it out. This would appear to be the same issue as: #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 Colengms reopened this Apr 16, 2024
@Colengms Colengms changed the title Language server crashed: Warning: Database safety check failed. Recreating database. [rc=0x80004005] (DB: false, Expected: true) Ryzen 3000 RDRAND bug causes cpptools to crash. (Can be fixed by updating BIOS, but probably shouldn't crash). Apr 16, 2024
@Colengms Colengms added Language Service reliability investigate This issue needs to be investigated/confirmed labels Apr 16, 2024
@shenjiangqiu
Copy link
Author

@Colengms Yes, It's Ryzen 3700x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate This issue needs to be investigated/confirmed Language Service reliability
Projects
Status: No status
Development

No branches or pull requests

3 participants