Skip to content

cpptools_srv crashes in cpptools_srv!form_type_specifier() #13925

Closed

Description

@copyrat90

Environment

  • OS and Version: Windows 11 Home (23H2, build 22631.5472)
  • VS Code Version: 1.104.0 (commit f220831ea)
  • C/C++ Extension Version: both 1.26.4 and 1.26.5

Bug Summary and Steps to Reproduce

Bug Summary:
After 1.26.4, cpptools-srv constantly crashes with this window whenever I edit the C++ source with compilerPath set to arm-none-eabi-gcc.exe for devkitARM toolchain.
Image
It previously worked without issues in 1.26.3.

Steps to reproduce:

  1. Install devkitARM toolchain
    • I use GBA Development option on the graphical installer
  2. Set the compilerPath to point its arm-non-eabi-gcc.exe
    • On Windows, the default path is C:/devkitPro/devkitARM/bin/arm-none-eabi-gcc.exe
  3. Start editing the code.
  4. You'll see the crash in a few seconds.

Configuration and Logs

`c_cpp_properties.json` { "configurations": [ { "name": "devkitARM", "includePath": [ "${workspaceFolder}/**" ], "compilerPath": "C:/devkitPro/devkitARM/bin/arm-none-eabi-gcc.exe", "cppStandard": "c++23", "cStandard": "c17" } ], "version": 4 }
Language server logging ... LSP: Sending response (id: 40) LSP: (received) cpptools/getFoldingRanges: file:///c%3A/Users/Home/test4/main.cpp (id: 41) LSP: (invoked) cpptools/getFoldingRanges: file:///c%3A/Users/Home/test4/main.cpp (id: 41) LSP: Sending response (id: 41) LSP: (received) textDocument/willSaveWaitUntil: file:///c%3A/Users/Home/test4/main.cpp (id: 42) Intellisense update pending for: file:///c%3A/Users/Home/test4/main.cpp LSP: (invoked) textDocument/willSaveWaitUntil: file:///c%3A/Users/Home/test4/main.cpp (id: 42) LSP: Sending response (id: 42) willSaveWaitUntil: 0ms LSP: (received) textDocument/didSave: file:///c%3A/Users/Home/test4/main.cpp LSP: (invoked) textDocument/didSave: file:///c%3A/Users/Home/test4/main.cpp LSP: $/cancelRequest (textDocument/completion, id: 31) LSP: (received) cpptools/fileChanged: file:///c%3A/Users/Home/test4/main.cpp LSP: (invoked) cpptools/fileChanged: file:///c%3A/Users/Home/test4/main.cpp tag parsing file: C:\Users\Home\test4\main.cpp IntelliSense update scheduled and TU acquisition started for: file:///c%3A/Users/Home/test4/main.cpp IntelliSense process crash detected: handle_completion Update IntelliSense time (sec): 0.017 Shutting down IntelliSense server: C:\Users\Home\test4\main.cpp
C/C++: Log Diagnostics -------- Diagnostics - 9/12/2025, 9:45:29 AM Version: 1.26.5 Current Configuration: { "name": "devkitARM", "includePath": [ "c:/Users/Home/test4/**" ], "compilerPath": "C:/devkitPro/devkitARM/bin/arm-none-eabi-gcc.exe", "cppStandard": "c++23", "cStandard": "c17", "compilerPathIsExplicit": true, "cStandardIsExplicit": true, "cppStandardIsExplicit": true, "intelliSenseModeIsExplicit": true, "recursiveIncludesReduceIsExplicit": false, "recursiveIncludesPriorityIsExplicit": false, "recursiveIncludesOrderIsExplicit": false, "compilerPathInCppPropertiesJson": "C:/devkitPro/devkitARM/bin/arm-none-eabi-gcc.exe", "defines": [ "LOCAL" ], "intelliSenseMode": "windows-gcc-x64", "mergeConfigurations": false, "recursiveIncludes": {}, "browse": { "limitSymbolsToIncludedHeaders": true } } Modified Settings: { "C_Cpp.default.defines": [ "LOCAL" ], "C_Cpp.default.intelliSenseMode": "windows-gcc-x64", "C_Cpp.default.compilerPath": "C:/Library/mingw64/bin/g++.exe", "C_Cpp.default.cppStandard": "c++20", "C_Cpp.loggingLevel": "Debug", "C_Cpp.copilotHover": "disabled" } Additional Tracked Settings: { "editorTabSize": 4, "editorInsertSpaces": true, "editorAutoClosingBrackets": "languageDefined", "filesEncoding": "utf8", "filesAssociations": {}, "filesExclude": { "**/.git": true, "**/.svn": true, "**/.hg": true, "**/.DS_Store": true, "**/Thumbs.db": true }, "filesAutoSaveAfterDelay": true, "editorInlayHintsEnabled": true, "editorParameterHintsEnabled": true, "searchExclude": { "**/node_modules": true, "**/bower_components": true, "**/*.code-search": true }, "workbenchSettingsEditor": "ui" } cpptools version (native): 1.26.4.0 Current database path: C:\USERS\HOME\APPDATA\LOCAL\MICROSOFT\VSCODE-CPPTOOLS\429A146AB812450C7DEF67187448064E\.BROWSE.VC.DB Translation Unit Mappings: [ C:\Users\Home\test4\main.cpp - source TU]: Translation Unit Configurations: [ C:\Users\Home\test4\main.cpp ] Process ID: 9528 Memory Usage: 172 MB Compiler Path: C:\devkitPro\devkitARM\bin\arm-none-eabi-gcc.exe Include paths: system include: C:\devkitPro\devkitARM\arm-none-eabi\include\c++\15.1.0 system include: C:\devkitPro\devkitARM\arm-none-eabi\include\c++\15.1.0\arm-none-eabi system include: C:\devkitPro\devkitARM\arm-none-eabi\include\c++\15.1.0\backward system include: C:\devkitPro\devkitARM\lib\gcc\arm-none-eabi\15.1.0\include system include: C:\devkitPro\devkitARM\lib\gcc\arm-none-eabi\15.1.0\include-fixed system include: C:\devkitPro\devkitARM\arm-none-eabi\include Defines: LOCAL Standard Version: c++23 IntelliSense Mode: windows-gcc-arm Other Flags: --g++ --gnu_version=150100 Total Memory Usage: 172 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 1129

Other Extensions

I've disabled all the other extensions, but the issue persists.

Additional context

Call stack of the cpptools-srv when crash happens:

ucrtbase.dll!abort() (Unknown Source:0)
ucrtbase.dll!terminate() (Unknown Source:0)
ucrtbase.dll!__C_specific_handler_noexcept() (Unknown Source:0)
ntdll.dll!RtlpExecuteHandlerForException() (Unknown Source:0)
ntdll.dll!RtlDispatchException() (Unknown Source:0)
ntdll.dll!KiUserExceptionDispatch() (Unknown Source:0)
KernelBase.dll!RaiseException() (Unknown Source:0)
vcruntime140.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 80 (d:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\throw.cpp:80)
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!term_compilation(enum an_error_severity) (Unknown Source:0)
cpptools-srv.exe!wrap_up_diagnostic() (Unknown Source:0)
cpptools-srv.exe!exit_unrecoverable_compilation(void) (Unknown Source:0)
cpptools-srv.exe!form_type_specifier() (Unknown Source:0)
cpptools-srv.exe!form_type_first_part(struct a_type *,int,int,unsigned int,int,struct an_il_to_str_output_control_block *) (Unknown Source:0)
cpptools-srv.exe!an_edge_typed_symbol_impl_t<struct edge::typedef_symbol>::form_declaration(struct msvc::buffer<char> *,unsigned int) (Unknown Source:0)
cpptools-srv.exe!``edge_intellisense_server_impl::handle_completion(struct cpp_intellisense::DocumentPosition const &,bool,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct cpp_intellisense::CompletionResponse &,struct snapshot::snapshot_session_t const &)'::`2'::<lambda_4>::operator()(class edge::intellisense_operation &,struct cpp_intellisense::CompletionResponse &)'::`2'::<lambda_3>::operator()(class std::unordered_map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct completion_item *,struct std::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct completion_item *> > > &,int) (Unknown Source:0)
cpptools-srv.exe!`edge_intellisense_server_impl::handle_completion(struct cpp_intellisense::DocumentPosition const &,bool,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct cpp_intellisense::CompletionResponse &,struct snapshot::snapshot_session_t const &)'::`2'::<lambda_4>::operator()(class edge::intellisense_operation &,struct cpp_intellisense::CompletionResponse &) (Unknown Source:0)
cpptools-srv.exe!edge_intellisense_operation::perform_isense_operation_helper<struct cpp_intellisense::CompletionResponse>(char const *,class edge::intellisense_operation &,struct a_canonicalized_file_name,class std::function<void (class edge::intellisense_operation &,struct cpp_intellisense::CompletionResponse &)> &&,struct cpp_intellisense::CompletionResponse &,struct snapshot::snapshot_session_t const &) (Unknown Source:0)
cpptools-srv.exe!edge_intellisense_operation::perform_isense_operation<struct cpp_intellisense::CompletionResponse>(char const *,struct edge::file_position const &,class std::function<void (class edge::intellisense_operation &,struct cpp_intellisense::CompletionResponse &)> &&,struct cpp_intellisense::CompletionResponse &,struct snapshot::snapshot_session_t const &,bool) (Unknown Source:0)
cpptools-srv.exe!edge_intellisense_server_impl::handle_completion(struct cpp_intellisense::DocumentPosition const &,bool,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct cpp_intellisense::CompletionResponse &,struct snapshot::snapshot_session_t const &) (Unknown Source:0)
cpptools-srv.exe!cpp_intellisense::server_stub::handle_completion(class msvc::deserializer_t &,class msvc::serializer_t &) (Unknown Source:0)
cpptools-srv.exe!msvc::base_channel_t::dispatch_message(class std::vector<unsigned char,class std::allocator<unsigned char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > &) (Unknown Source:0)
cpptools-srv.exe!msvc::common_channel_t::perform_call(unsigned int,class std::vector<unsigned char,class std::allocator<unsigned char> > const &) (Unknown Source:0)
cpptools-srv.exe!worker() (Unknown Source:0)
cpptools-srv.exe!uv__thread_start() (Unknown Source:0)
ucrtbase.dll!thread_start<unsigned int (__cdecl*)(void *),1>() (Unknown Source:0)
kernel32.dll!BaseThreadInitThunk() (Unknown Source:0)
ntdll.dll!RtlUserThreadStart() (Unknown Source:0)

Activity

  1. sean-mcmanus commented on Sep 12, 2025

    @sean-mcmanus
    Contributor

    copyrat90 That crash should happen with 1.26.3 too if you look at the C/C++ logging -- 1.26.4 just causes the UI to appear -- the crash UI should be configurable on the Windows OS so that it doesn't appear. Do you think we should attempt to override the Windows default crash UI behavior so that the crash is more hidden like with 1.26.3? Have you changed the default Windows settings to enable the crash UI to appear? For some reason, I don't get a crash UI on Windows (maybe due to internal Microsoft configuration?).

  2. copyrat90 commented on Sep 12, 2025

    @copyrat90
    Author

    That crash should happen with 1.26.3 too if you look at the C/C++ logging

    Yes, it seems that the same crash happens on 1.26.3 too with the same call stack. I missed that.

    Do you think we should attempt to override the Windows default crash UI behavior so that the crash is more hidden like with 1.26.3?

    I think if you can't fix this, you should at least provide the option to hide the crash UI.
    It appears every 5 seconds, making the linter basically unusable.

    Have you changed the default Windows settings to enable the crash UI to appear?

    I don't think I changed anything related to crash UI handling.
    (Edit: I tried enabling the Prevent display of the user interface for critical error in the local group policy settings and restarted my computer, but it still shows the crash UI.)

  3. sean-mcmanus commented on Sep 12, 2025

    @sean-mcmanus
    Contributor

    We have a fix for the crash.

    We're still looking into the WER UI issue (I don't know what is disabling the UI on my machine).

    Have you checked your reg key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting . There's a

    DontShowUI
    
    REG_DWORD
    
    Possible values:
    
    0 - UI (default)
    1 - No UI
    Enable or disable the WER UI
    

    from https://learn.microsoft.com/en-us/windows/win32/wer/wer-settings

    That you could potentially set to disable the UI.

  4. sean-mcmanus commented on Sep 13, 2025

    @sean-mcmanus
    Contributor

    We'll add a setting to disable that in our next 1.27.6 pre-release (and default to only having it enabled for the first crash in a session): #13929 . That version is our release candidate so we plan to ship it to release soon after.

  5. copyrat90 commented on Sep 13, 2025

    @copyrat90
    Author

    Have you checked your reg key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting.

    DontShowUI entry did not exist for me, and manually adding it disabled the crash UI. Thanks!

  6. sean-mcmanus commented on Sep 16, 2025

    @sean-mcmanus
    Contributor

    copyrat90 The crash should be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.27.6 ...we plan to ship that for non-pre-release on Thursday.

  7. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Sep 16, 2025
  8. moved this from Pull Request to Done in cpptoolson Sep 16, 2025
  9. copyrat90 commented on Sep 16, 2025

    @copyrat90
    Author

    I just tested it with the crash UI re-enabled, and it is indeed fixed. Thanks!

    The intellisense reacts much faster compared to before - I guess the crash and reload was making it slower.

  10. locked and limited conversation to collaborators on Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Language ServiceVisual StudioInherited from Visual StudiobugfixedCheck the Milestone for the release in which the fix is or will be available.parser

Type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions