vscode-cpptools
vscode-cpptools copied to clipboard
llvm-project file causes tag parser crash (Warning: Database safety check failed. Recreating database)
Environment
- OS and version: windows 10
- VS Code: 1.69.2
- C/C++ extension: 1.11.4
Bug Summary and Steps to Reproduce
Bug Summary:
- cpptools: Connection to server got closed. Server will not be restarted.
- c/c++ : Warning: Database safety check failed. Recreating database. directory used as a project: https://github.com/llvm/llvm-project
-
you can download it only because an error occurs when analyzing this file https://github.com/llvm/llvm-project/blob/main/libcxx/test/support/test.support/make_string_header.pass.cpp
-
open folder in vs code
-
automatic analize
-
error
Expected behavior
when installing c/c++ 1.10.8, the project analyzes normally and no errors appear
Code sample and Logs
c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe",
"cStandard": "c17",
"cppStandard": "c++14",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
Screenshots
- C/C++ extension: 1.11.4 output to the console when analyzing a file when an error occurs, and start re-analyzing the project.
G:\2\libcxx\test\support\test.support\make_string_header.pass.cpp
cpptools console error
when installing c/c++ 1.10.8, the project analyzes normally and no errors appear, a message about the completion of the analysis is displayed in the console
Additional context
No response
The contents of the file https://github.com/llvm/llvm-project/blob/main/libcxx/test/support/test.support/make_string_header.pass.cpp cause the language server to crash.
As a workaround, add this file path to "C_Cpp.files.exclude"
setting.
@Bestie123 Is it possible the crash was caused by? : clang\test\parser\parser_overflow.c
https://github.com/microsoft/vscode-cpptools/issues/9653
Without that file, I'm able to parse all of the latest code currently in the llvm-project repo. (Though, perhaps there was recent change that removed your repro?).
@Colengms https://github.com/llvm/llvm-project/releases LLVM 14.06 LLVM 15.0.0-rc1 also tried the current latest copy of the repository
clang\test\parser\parser_overflow.c analyzed without errors
tested on versions of c/c++: 1.10.8, pre release version (1.12.0, 1.11.4, 1.11.3)
but I did not run the analysis of the entire project, but only the clang\test\parser directory
in my case, the error is related to the file libcxx\test\support\test.support\make_string_header.pass.cpp and this manifests itself when analyzing a single file or the entire project on version c/c++ 1.11.4, on version 1.10.8 this error does not appear and the entire project is analyzed normally
@Colengms I tried to run the analysis libcxx\test\support\test.support\make_string_header.pass.cpp on cpptools version 1.12.0, but the analysis also gives an error
@sean-mcmanus
the error in version 1.12.0 no longer appears during analysis
libcxx\test\support\test.support\make_string_header.pass.cpp
FYI, 1.11.5 and 1.12.1 have a workaround for this (avoid tag parsing that file), but 1.12.2 should have a real fix.
You may be seeing it fixed in 1.12.0 because it may have saved the parsed state in the database, but it would still crash if the database were reset or if the file was edited/saved.
UPDATE: https://github.com/microsoft/vscode-cpptools/releases/tag/v1.12.2 has a fix for the root crash.