microsoft / microsoft/vscode-cpptools

IntelliSense process crash when aliasing std::tuple

Open
#14,098 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Language Service Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • C/C++ Extension Version: 1.29.2
Bug Summary and Steps to Reproduce

The following will crash the language server.

#include <tuple>
template<typename... T> using tup = std::tuple<T...>;

auto crashed(){
    return tup{5};
}

Results in: IntelliSense process crash detected: handle_initialize

You can also write

void crashed(){
    auto x = tup{5};
}

To receive IntelliSense process crash detected: handle_update_intellisense

However, the following will not crash it.

void ok(){
    tup<int> x = {5};
}
Configuration and Logs
Log Diagnostics:
-------- Diagnostics - 12/10/2025, 12:43:44 AM
Version: 1.29.2
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "b:/Documents/Code/ReproducibleIntellisenseCrash/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.22621.0",
    "cStandard": "gnu23",
    "cppStandard": "c++26",
    "intelliSenseMode": "windows-gcc-x64",
    "intelliSenseModeIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "mergeConfigurations": false,
    "recursiveIncludes": {},
    "recursiveIncludesReduceIsExplicit": false,
    "recursiveIncludesPriorityIsExplicit": false,
    "recursiveIncludesOrderIsExplicit": false,
    "compilerPath": "C:\\msys64\\ucrt64\\bin\\gcc.exe",
    "compilerPathIsExplicit": true,
    "browse": {
        "limitSymbolsToIncludedHeaders": true
    }
}
Modified Settings:
{
    "C_Cpp.default.intelliSenseMode": "windows-gcc-x64",
    "C_Cpp.default.compilerPath": "C:\\msys64\\ucrt64\\bin\\gcc.exe",
    "C_Cpp.default.cStandard": "gnu23",
    "C_Cpp.default.cppStandard": "c++26",
    "C_Cpp.clang_format_style": "file:A:/Coding/.clang-format",
    "C_Cpp.clang_format_fallbackStyle": "WebKit",
    "C_Cpp.loggingLevel": "Debug"
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {
        "*.asm": "arm",
        "*.atsln": "sln",
        "*.f": "glsl",
        "*.fsh": "glsl",
        "*.inc": "arm",
        "*.ipp": "cpp",
        "*.js.download": "javascript",
        "*.Rmd": "markdown",
        "*.s": "arm",
        "*.sasmproj": "toml",
        "*.tpp": "cpp",
        "*.v": "glsl",
        "*.vsh": "glsl"
    },
    "filesExclude": {
        "**/.git": false,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true,
        "**/.acpmeta": true,
        "**/CVS": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.29.2.0
Current database path: C:\USERS\_____\APPDATA\LOCAL\MICROSOFT\VSCODE-CPPTOOLS\AE7C2A44E0E3386F3C69C9A14F8F4682\.BROWSE.VC.DB
No active translation units.

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 14353
Number of files parsed: 2419


Call stack of "compiler_thread_routine":
--------------------------
cpptools-srv.exe!copy_pack_expansion_descr_with_substitution() (Unknown Source:0)
cpptools-srv.exe!copy_template_arg_list_with_substitution(struct a_symbol *,struct a_template_arg *,struct a_template_param *,struct a_template_param *,struct a_template_arg *,struct a_template_param *,struct a_source_position *,int,int *,struct a_ctws_state *) (Unknown Source:0)
cpptools-srv.exe!copy_template_class_reference_with_substitution() (Unknown Source:0)
cpptools-srv.exe!copy_type_with_substitution(struct a_type *,struct a_template_arg *,struct a_template_param *,struct a_source_position *,int,int *,struct a_ctws_state *) (Unknown Source:0)
cpptools-srv.exe!copy_parent_type_with_substitution(struct a_symbol *,struct a_type *,struct a_template_arg *,struct a_template_param *,struct a_source_position *,int,struct a_type * *,int,int *,struct a_ctws_state *) (Unknown Source:0)
cpptools-srv.exe!symbol_for_template_param_unknown_entity_con_after_substitution(struct a_constant *,struct a_template_arg *,struct a_template_param *,struct a_source_position *,struct a_ctws_state *,int) (Unknown Source:0)
cpptools-srv.exe!make_operand_for_rescanned_identifier() (Unknown Source:0)
cpptools-srv.exe!rescan_expr_with_substitution_internal(struct an_expr_node *,struct a_rescan_control_block *,int,struct an_operand *,struct an_operand *,int) (Unknown Source:0)
cpptools-srv.exe!make_rescan_operand_full(struct an_expr_node *,struct a_rescan_control_block *,int,struct an_operand *,struct an_operand *) (Unknown Source:0)
cpptools-srv.exe!scan_function_call() (Unknown Source:0)
cpptools-srv.exe!rescan_expr_with_substitution_internal(struct an_expr_node *,struct a_rescan_control_block *,int,struct an_operand *,struct an_operand *,int) (Unknown Source:0)
cpptools-srv.exe!rescan_expr_with_substitution(struct an_expr_node *,struct a_type *,struct a_rescan_control_block *,struct a_constant *) (Unknown Source:0)
cpptools-srv.exe!copy_template_param_expr(struct an_expr_node *,struct a_template_arg *,struct a_template_param *,struct a_type *,struct a_source_position *,int,int *,struct a_ctws_state *,struct a_constant *,struct a_constant * *) (Unknown Source:0)
cpptools-srv.exe!create_transformed_deduction_guide_for_alias_template(struct a_symbol *,struct a_symbol *) (Unknown Source:0)
cpptools-srv.exe!create_deduction_guides_for_alias_template() (Unknown Source:0)
cpptools-srv.exe!update_implicit_deduction_guides(struct a_symbol *) (Unknown Source:0)
cpptools-srv.exe!deduce_class_template_args(struct a_type *,int,int,int,struct an_init_component *,struct a_source_position *,struct a_type * *,int *) (Unknown Source:0)
cpptools-srv.exe!deduce_placeholder_type() (Unknown Source:0)
cpptools-srv.exe!prescan_initializer_for_auto_type_deduction(struct a_decl_parse_state *,int) (Unknown Source:0)
cpptools-srv.exe!scan_functional_notation_type_conversion() (Unknown Source:0)
Additional context

I've prepared a minimal reproducable example attached here for use with CMake-Tools providing the intellisense configuration. All compilers I've tested resulted in a crash (msvc-17.14.19, gcc15-msys2-ucrt, clang21-msys2-ucrt)

UsingTupleCrash.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached UsingTupleCrash.zip and reproduce the crash using the alias-template examples. Trace the listed cpptools-srv.exe entry points around create_deduction_guides_for_alias_template and deduce_class_template_args; done means IntelliSense remains running for both crashing cases while the existing explicit tuple case still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.