microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.52k stars 1.55k forks source link

lsp crash on opening xml file in project #11453

Closed shevernitskiy closed 1 year ago

shevernitskiy commented 1 year ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: I have some xml's in a project (it can be valid or not). LSP crashed everytime, when i open a tab with one of those xml.

XML file example (remove .txt): df.announcements.xml.txt

image

Configuration and Logs

Project workspace has no separate c_cpp_properties.json

Output from C/C++:

Unable to access browse database. (get_structure_version)
Unable to access browse database. (parse_file(2))

Output from cpptools:

[Error - 7:09:43 PM] The language server crashed. Restarting...

Other Extensions

No extansions for xml installed.

Additional context

No response

Colengms commented 1 year ago

Hi @shevernitskiy . The C/C++ Extension is not associated with files with the .xml extension by default. If that association were added (such as using the files.associations setting), that should simply cause the files to be treated as C++ source file (which is what occurs for me when I try to repro).

The "Unable to access browse database" error message is logged when the C/C++ Extension is unable to access its primary database. Can you tell if this message occurs before or after the crash? (It may be occurring after the cpptools.exe processed is relaunched, if the prior file handle were not cleaned up for some reason.)

Could you enable "C_Cpp.loggingLevel": "Debug" and provide the output of the C/C++ output channel leading up to the repro?

It might also be possible to connect the debugger to cpptools.exe to obtain a crash stack from the crash. https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv Though, if the Unable to access browse database error message is occurring prior to the crash, the root cause of the issue may be prior to the crash itself.

shevernitskiy commented 1 year ago

I found the exact point of the crash. It occurs when i comeback to cpp file tab from xml file tab. Not on opening xml doc.

setting.json

{
  "cmake.configureOnOpen": false,
  "files.associations": {
    "*.txt": "log",
    "*.yml": "yaml",
    "tuple": "cpp",
    "vector": "cpp",
    "random": "cpp",
    "xutility": "cpp",
    "xstring": "cpp",
    "algorithm": "cpp",
    "array": "cpp",
    "atomic": "cpp",
    "bit": "cpp",
    "bitset": "cpp",
    "cctype": "cpp",
    "charconv": "cpp",
    "chrono": "cpp",
    "cinttypes": "cpp",
    "clocale": "cpp",
    "cmath": "cpp",
    "compare": "cpp",
    "concepts": "cpp",
    "condition_variable": "cpp",
    "csignal": "cpp",
    "cstdarg": "cpp",
    "cstddef": "cpp",
    "cstdint": "cpp",
    "cstdio": "cpp",
    "cstdlib": "cpp",
    "cstring": "cpp",
    "ctime": "cpp",
    "cuchar": "cpp",
    "cwchar": "cpp",
    "deque": "cpp",
    "exception": "cpp",
    "coroutine": "cpp",
    "forward_list": "cpp",
    "list": "cpp",
    "map": "cpp",
    "resumable": "cpp",
    "set": "cpp",
    "string": "cpp",
    "unordered_map": "cpp",
    "unordered_set": "cpp",
    "format": "cpp",
    "fstream": "cpp",
    "functional": "cpp",
    "future": "cpp",
    "hash_map": "cpp",
    "hash_set": "cpp",
    "initializer_list": "cpp",
    "iomanip": "cpp",
    "ios": "cpp",
    "iosfwd": "cpp",
    "iostream": "cpp",
    "istream": "cpp",
    "iterator": "cpp",
    "limits": "cpp",
    "locale": "cpp",
    "memory": "cpp",
    "mutex": "cpp",
    "new": "cpp",
    "numeric": "cpp",
    "optional": "cpp",
    "ostream": "cpp",
    "queue": "cpp",
    "ranges": "cpp",
    "ratio": "cpp",
    "regex": "cpp",
    "span": "cpp",
    "sstream": "cpp",
    "stack": "cpp",
    "stdexcept": "cpp",
    "stop_token": "cpp",
    "streambuf": "cpp",
    "system_error": "cpp",
    "thread": "cpp",
    "type_traits": "cpp",
    "typeinfo": "cpp",
    "utility": "cpp",
    "xfacet": "cpp",
    "xhash": "cpp",
    "xiosbase": "cpp",
    "xlocale": "cpp",
    "xlocbuf": "cpp",
    "xlocinfo": "cpp",
    "xlocmes": "cpp",
    "xlocmon": "cpp",
    "xlocnum": "cpp",
    "xloctime": "cpp",
    "xmemory": "cpp",
    "xtr1common": "cpp",
    "xtree": "cpp",
    "codecvt": "cpp",
    "*.inc": "cpp",
    "shared_mutex": "cpp",
    "execution": "cpp",
    "filesystem": "cpp"
  }
}

C/C++ output:

loggingLevel: Debug
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
LSP: cpptools/queryCompilerDefaults (id: 2)
LSP: cpptools/didChangeCppProperties (id: 3)
LSP: textDocument/didOpen: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp
LSP: cpptools/activeDocumentChange: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp
LSP: cpptools/textEditorSelectionChange
Code browsing service initialized
Attempting to get defaults from C++ compiler in "compilerPath" property: 'cl.exe'
Attempting to get defaults from C compiler in "compilerPath" property: 'cl.exe'
  Folder: C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2022/BUILDTOOLS/VC/TOOLS/MSVC/14.37.32822/INCLUDE/* will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/CPPWINRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/SHARED/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/UCRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/UM/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/WINRT/ will be indexed
  Folder: E:/PROGRAMMING/CPLUS/DFHACK/ will be indexed
  Folder: C:/USERS/MAHAH/APPDATA/LOCAL/.XMAKE/PACKAGES/ will be indexed
  Folder: C:/VCPKG/PACKAGES/ will be indexed
Discovering files...
  Processing folder (non-recursive): C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2022/BUILDTOOLS/VC/TOOLS/MSVC/14.37.32822/INCLUDE
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/CPPWINRT/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/SHARED/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/UCRT/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/UM/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/WINRT/
  Processing folder (recursive): E:/PROGRAMMING/CPLUS/DFHACK/
Unable to resolve include path: e:/programming/cplus/dfhack/pch.h
Unable to resolve include path: e:/programming/cplus/dfhack/src/pch.h
Unable to resolve include path: e:/programming/cplus/dfhack/src/hook/pch.h
  Processing folder (recursive): C:/USERS/MAHAH/APPDATA/LOCAL/.XMAKE/PACKAGES/
  Processing folder (recursive): C:/VCPKG/PACKAGES/
LSP: cpptools/getInlayHints: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 4)
  Discovering files: 19188 file(s) processed
  3 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: cpptools/getFoldingRanges: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 5)
LSP: Message ignored due to no registered handler: $/setTrace
LSP: cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: cpptools/getSemanticTokens: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 6)
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 7)
LSP: $/cancelRequest (<unknown/completed>, id: 7)
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 8)
Checking for syntax errors: E:\programming\cplus\dfhack\library\modules\Textures.cpp
LSP: Message ignored due to no registered handler: $/setTrace
LSP: cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
  tag parsing file: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include\CodeAnalysis\sourceannotations.h
  tag parsing file: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include\experimental\resumable
  tag parsing file: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include\experimental\coroutine
sending compilation args for E:\programming\cplus\dfhack\library\modules\Textures.cpp
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2022\BUILDTOOLS\VC\TOOLS\MSVC\14.37.32822\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\CPPWINRT
  include: E:\PROGRAMMING\CPLUS\DFHACK\DEPENDS\LIBEXPAT\EXPAT\LIB
  include: E:\PROGRAMMING\CPLUS\DFHACK\LIBRARY\INCLUDE
  include: E:\PROGRAMMING\CPLUS\DFHACK\DEPENDS\SDL2\SDL2-2.26.2\INCLUDE
  include: E:\PROGRAMMING\CPLUS\DFHACK\DEPENDS\LUA\INCLUDE
  define: _DEBUG
  define: UNICODE
  define: _UNICODE
  stdver: ms_c++latest
  intelliSenseMode: windows-msvc-x64
Checking for syntax errors: E:\programming\cplus\dfhack\library\modules\Textures.cpp
Queueing IntelliSense update for files in translation unit of: E:\programming\cplus\dfhack\library\modules\Textures.cpp
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 9)
LSP: $/cancelRequest (<unknown/completed>, id: 9)
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 10)
LSP: Message ignored due to no registered handler: $/setTrace
LSP: cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: Message ignored due to no registered handler: $/setTrace
LSP: cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
LSP: Message ignored due to no registered handler: $/setTrace
LSP: cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
Error squiggle count: 0
Update IntelliSense time (sec): 4.619
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 11)
LSP: cpptools/getDocumentSymbols: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 12)
LSP: Message ignored due to no registered handler: $/setTrace
LSP: cpptools/didChangeSettings
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
Enhanced Colorization is enabled.
  tag parsing file: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include\CodeAnalysis\sourceannotations.h
  tag parsing file: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include\experimental\resumable
  tag parsing file: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include\experimental\coroutine
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 13)
LSP: cpptools/getFoldingRanges: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 14)
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 15)
LSP: cpptools/getFoldingRanges: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 16)
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 17)
LSP: $/cancelRequest (<unknown/completed>, id: 17)
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 18)
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 19)
LSP: cpptools/getFoldingRanges: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 20)
LSP: cpptools/fileDeleted: file:///e%3A/programming/cplus/dfhack/.git/modules/plugins/stonesense/objects/maintenance.lock
Custom configuration provider 'CMake Tools' registered
LSP: cpptools/didChangeCppProperties (id: 21)
LSP: cpptools/clearCustomConfigurations
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 22)
LSP: cpptools/clearCustomConfigurations
LSP: cpptools/getFoldingRanges: file:///e%3A/programming/cplus/dfhack/library/modules/Textures.cpp (id: 23)
LSP: cpptools/fileDeleted: file:///e%3A/programming/cplus/dfhack/.git/modules/library/xml/objects/maintenance.lock
LSP: cpptools/clearCustomConfigurations
LSP: cpptools/fileDeleted: file:///e%3A/programming/cplus/dfhack/.git/modules/depends/jsoncpp/objects/maintenance.lock
LSP: cpptools/fileDeleted: file:///e%3A/programming/cplus/dfhack/.git/modules/depends/xlsxio/objects/maintenance.lock
LSP: cpptools/fileDeleted: file:///e%3A/programming/cplus/dfhack/.git/modules/depends/libzip/objects/maintenance.lock
LSP: cpptools/fileDeleted: file:///e%3A/programming/cplus/dfhack/.git/modules/depends/libexpat/objects/maintenance.lock
LSP: cpptools/fileDeleted: file:///e%3A/programming/cplus/dfhack/.git/modules/plugins/isoworld/modules/agui/objects/maintenance.lock
LSP: cpptools/fileDeleted: file:///e%3A/programming/cplus/dfhack/.git/modules/plugins/isoworld/modules/allegro/objects/maintenance.lock
Database safe to open.
Shutting down IntelliSense server: E:\programming\cplus\dfhack\library\modules\Textures.cpp
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)

cpptools-srv.exe callstack on exception:

KernelBase.dll!RaiseException() (Unknown Source:0)
cpptools-srv.exe!_CxxThrowException() (Unknown Source:0)
cpptools-srv.exe!cfe_throw(void) (Unknown Source:0)
cpptools-srv.exe!cfe_exit() (Unknown Source:0)
cpptools-srv.exe!exit_compilation(enum an_error_severity) (Unknown Source:0)
cpptools-srv.exe!before_tu_wrapup(void) (Unknown Source:0)
cpptools-srv.exe!process_translation_unit(char const *,int,struct an_exported_template_file *) (Unknown Source:0)
cpptools-srv.exe!cfe_main(int,char * * const) (Unknown Source:0)
cpptools-srv.exe!cfe_main_exception_handler(int,char * * const) (Unknown Source:0)
cpptools-srv.exe!invoke_edge_compiler() (Unknown Source:0)
cpptools-srv.exe!edge_compiler_main(int,char const * * const) (Unknown Source:0)
cpptools-srv.exe!a_compiler_thread::compiler_thread_routine(class a_compiler_thread *) (Unknown Source:0)
cpptools-srv.exe!msvc::thread_helper_t::thread_entry(void *) (Unknown Source:0)
cpptools-srv.exe!thread_start<unsigned int (__cdecl*)(void *),1>() (Unknown Source:0)
kernel32.dll!BaseThreadInitThunk() (Unknown Source:0)
ntdll.dll!RtlUserThreadStart() (Unknown Source:0)

cpptools.exe callstack on exception:

KernelBase.dll!RaiseException() (Unknown Source:0)
cpptools.exe!_CxxThrowException() (Unknown Source:0)
cpptools.exe!cfe_throw(void) (Unknown Source:0)
cpptools.exe!cfe_exit() (Unknown Source:0)
cpptools.exe!exit_compilation(enum an_error_severity) (Unknown Source:0)
cpptools.exe!cfe_main(int,char * * const) (Unknown Source:0)
cpptools.exe!cfe_main_exception_handler(int,char * * const) (Unknown Source:0)
cpptools.exe!antlr_parse_routine() (Unknown Source:0)
cpptools.exe!msvc::thread_helper_t::thread_entry(void *) (Unknown Source:0)
cpptools.exe!thread_start<unsigned int (__cdecl*)(void *),1>() (Unknown Source:0)
kernel32.dll!BaseThreadInitThunk() (Unknown Source:0)
ntdll.dll!RtlUserThreadStart() (Unknown Source:0)
Colengms commented 1 year ago

Hi @shevernitskiy . The stacks you provided appear to indicate either normal termination of the native process, or some sort of internal error. (Perhaps unexpected termination, not an actual crash, per se).. Though, I see from your logs that the last message received, which likely instigated the issue, is cpptools/didChangeSettings. Had you also made a settings change? There is a known issue (https://github.com/microsoft/vscode-cpptools/issues/11375, fixed in 1.18, pending release) where failures may occur due to unexpected/invalid JSON content for particular settings.

Are you able to replicate this issue with a simple project and a simple xml file? I'm not able to. If this repro's for you with a simple project, can you tell me if there is anything unusual about your system or environment? Or, if this only happens within a particular project, perhaps there is something specific about that project that we might need to identify in order to reproduce the issue and investigate further.

shevernitskiy commented 1 year ago

I was abled to reproduce this issue on simple project. Crash on switch back from xml to cpp file.

image

There is no local settings.json in the project workspace. Also I commented all the C_Cpp options except debug in global one.

I'm not sure what you mean, but a have pretty common env: win 11 pro, last stable vscode, last stable msvc from build tools.

cpptools/didChangeSettings happend on startup.

C/C++ output:

loggingLevel: Debug
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
LSP: Message ignored due to no registered handler: $/setTrace
LSP: cpptools/queryCompilerDefaults (id: 2)
LSP: cpptools/didChangeCppProperties (id: 3)
LSP: textDocument/didOpen: file:///e%3A/programming/cplus/test/src/main.cpp
Code browsing service initialized
Attempting to get defaults from C++ compiler in "compilerPath" property: 'cl.exe'
Attempting to get defaults from C compiler in "compilerPath" property: 'cl.exe'
  Folder: C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2022/BUILDTOOLS/VC/TOOLS/MSVC/14.37.32822/INCLUDE/* will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/CPPWINRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/SHARED/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/UCRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/UM/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/WINRT/ will be indexed
  Folder: E:/PROGRAMMING/CPLUS/TEST/ will be indexed
  Folder: C:/VCPKG/INSTALLED/X64-WINDOWS-STATIC/INCLUDE/ will be indexed
Discovering files...
  Processing folder (non-recursive): C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2022/BUILDTOOLS/VC/TOOLS/MSVC/14.37.32822/INCLUDE
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/CPPWINRT/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/SHARED/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/UCRT/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/UM/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.22000.0/WINRT/
  Processing folder (recursive): E:/PROGRAMMING/CPLUS/TEST/
  Processing folder (recursive): C:/VCPKG/INSTALLED/X64-WINDOWS-STATIC/INCLUDE/
  Discovering files: 5090 file(s) processed
LSP: 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.
  1 file(s) removed from database
Done discovering files.
Populating include completion cache.
LSP: cpptools/activeDocumentChange: file:///e%3A/programming/cplus/test/src/main.cpp
LSP: cpptools/textEditorSelectionChange
Parsing remaining files...
  Parsing: 0 files(s) processed
Done parsing remaining files.
LSP: cpptools/getDocumentSymbols: file:///e%3A/programming/cplus/test/src/main.cpp (id: 4)
LSP: cpptools/getCodeActions: file:///e%3A/programming/cplus/test/src/main.cpp (id: 5)
LSP: cpptools/getInlayHints: file:///e%3A/programming/cplus/test/src/main.cpp (id: 6)
LSP: cpptools/getFoldingRanges: file:///e%3A/programming/cplus/test/src/main.cpp (id: 7)
LSP: cpptools/getSemanticTokens: file:///e%3A/programming/cplus/test/src/main.cpp (id: 8)
  tag parsing file: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include\CodeAnalysis\sourceannotations.h
sending compilation args for E:\programming\cplus\test\src\main.cpp
  include: C:\VCPKG\INSTALLED\X64-WINDOWS-STATIC\INCLUDE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2022\BUILDTOOLS\VC\TOOLS\MSVC\14.37.32822\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.22000.0\CPPWINRT
  define: _DEBUG
  define: UNICODE
  define: _UNICODE
  stdver: ms_c++17
  intelliSenseMode: windows-msvc-x64
Checking for syntax errors: E:\programming\cplus\test\src\main.cpp
Queueing IntelliSense update for files in translation unit of: E:\programming\cplus\test\src\main.cpp
Error squiggle count: 0
Update IntelliSense time (sec): 1.526
LSP: cpptools/getFoldingRanges: file:///e%3A/programming/cplus/test/src/main.cpp (id: 9)
Database safe to open.
Shutting down IntelliSense server: E:\programming\cplus\test\src\main.cpp
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
cpptools version (TypeScript): 1.17.5
cpptools version (native): 1.17.5.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: cpptools/queryCompilerDefaults (id: 1)
sean-mcmanus commented 1 year ago

This may be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.18.0

shevernitskiy commented 1 year ago

This may be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.18.0

Unfortunately, 1.18.0 doesn't fix it.

Colengms commented 1 year ago

Hi @shevernitskiy . Could you provide an updated log from a repro using 1.18.0? It has some additional logging at start-up that might help explain the repeated crashes when this starts to repro.

Are you able to repro with no other extensions installed? Does it occur with any other types of file? (The C/C++ extension does not treat an XML file any differently than any other file extension that is not C or C++. In fact, the native process would get no notification of its existence, which is evident by no occurances of a didOpen or activeDocumentChange message for that file.) Do you have another machine which you can try this on? Simply switching to/from an XML file does not repro any issue for me, and I suspect many users are able to do so without issue. Since this repro's for you with a simple project, there would seem to be something about your system, environment or global VS Code configuration that we may need to uncover to understand what's happening.

shevernitskiy commented 1 year ago

I decided to reinstall vscode from scratch. On a fresh new setup there is no issue. Well, it seems like that was unique special env case. Thanks for reposponses! Issue may be closed now, i guess.