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

Multiple Intellisense server crashes handle_update_intellisense, handle_initialize #13035

Open
BluTree opened this issue Dec 9, 2024 · 2 comments
Assignees
Labels
bug Language Service more info needed The issue report is not actionable in its current state

Comments

@BluTree
Copy link

BluTree commented Dec 9, 2024

Environment

  • OS and Version: 22631.3447
  • VS Code Version: 1.95.3
  • C/C++ Extension Version: 1.23.2

Bug Summary and Steps to Reproduce

Bug Summary:
I am on an environment with configuration provider (homemade). With the latest extension version, The Intellisense server crashes very often, making the extension unusable.
When writing some code, the server crash randomly with the error IntelliSense process crash detected: handle_update_intellisense.
It tries to restart, but crash instantly, with this error IntelliSense process crash detected: handle_initialize.

Restarting VSCode make the Intellisense server work again, but then crash quickly after typing some code.
I don't think it can come from the configuration provider, nothing changed in the last 6 months, and it worked without issues until this version.

I attached to the server to retrieve the first crash. It seems the crash comes from an invalid pointer dereference
Exception thrown at 0x0000000140196619 in cpptools-srv.exe: 0xC0000005: Access violation reading location 0x0000000000000030
And the callstack of the crash:

cpptools-srv.exe!conv_line_loc_to_source_pos(char const *,struct a_source_position *) (Unknown Source:0)
cpptools-srv.exe!get_token(void) (Unknown Source:0)
cpptools-srv.exe!parse_source_fragment_into_token_cache(struct a_source_position *,struct a_source_position *) (Unknown Source:0)
cpptools-srv.exe!get_definition_of_class_from_source() (Unknown Source:0)
cpptools-srv.exe!get_definition_of_class(struct a_type *) (Unknown Source:0)
cpptools-srv.exe!f_instantiate_template_class_full(struct a_type *,unsigned int *,unsigned int *,int,int *) (Unknown Source:0)
cpptools-srv.exe!complete_type_is_needed(struct a_type *) (Unknown Source:0)
cpptools-srv.exe!check_field_type() (Unknown Source:0)
cpptools-srv.exe!decl_nonstatic_data_member() (Unknown Source:0)
cpptools-srv.exe!scan_nonstatic_data_member() (Unknown Source:0)
cpptools-srv.exe!class_member_declaration(struct a_class_def_state *,struct a_tmpl_decl_state *,struct an_ms_attribute *,int,int,struct a_template_param *,int *,struct a_type * *,struct a_template_instance *,struct a_template *,struct a_decl_pos_block *) (Unknown Source:0)
cpptools-srv.exe!scan_class_definition(struct a_type *,struct a_decl_parse_state *,int,int,int,int,int,int,struct a_template *,struct a_decl_pos_block *) (Unknown Source:0)
cpptools-srv.exe!get_definition_of_class(struct a_type *) (Unknown Source:0)
cpptools-srv.exe!f_instantiate_template_class_full(struct a_type *,unsigned int *,unsigned int *,int,int *) (Unknown Source:0)
cpptools-srv.exe!complete_type_is_needed(struct a_type *) (Unknown Source:0)
cpptools-srv.exe!check_field_type() (Unknown Source:0)
cpptools-srv.exe!decl_nonstatic_data_member() (Unknown Source:0)
cpptools-srv.exe!scan_nonstatic_data_member() (Unknown Source:0)
cpptools-srv.exe!class_member_declaration(struct a_class_def_state *,struct a_tmpl_decl_state *,struct an_ms_attribute *,int,int,struct a_template_param *,int *,struct a_type * *,struct a_template_instance *,struct a_template *,struct a_decl_pos_block *) (Unknown Source:0)
cpptools-srv.exe!scan_class_definition(struct a_type *,struct a_decl_parse_state *,int,int,int,int,int,int,struct a_template *,struct a_decl_pos_block *) (Unknown Source:0)
cpptools-srv.exe!get_definition_of_class(struct a_type *) (Unknown Source:0)
cpptools-srv.exe!f_instantiate_template_class_full(struct a_type *,unsigned int *,unsigned int *,int,int *) (Unknown Source:0)
cpptools-srv.exe!instantiate_template_class(struct a_type *,int *) (Unknown Source:0)
cpptools-srv.exe!f_is_generalized_identifier_start(__int64,struct a_type *) (Unknown Source:0)
cpptools-srv.exe!prescan_decl_specifiers() (Unknown Source:0)
cpptools-srv.exe!prescan_declaration() (Unknown Source:0)
cpptools-srv.exe!template_declaration() (Unknown Source:0)
cpptools-srv.exe!template_or_specialization_declaration_full(struct a_tmpl_decl_state *,int,struct a_decl_parse_state *) (Unknown Source:0)
cpptools-srv.exe!template_or_specialization_declaration() (Unknown Source:0)
cpptools-srv.exe!template_directive_or_declaration(enum a_token_kind *,int,struct a_source_position *) (Unknown Source:0)
cpptools-srv.exe!check_special_declaration_form() (Unknown Source:0)
cpptools-srv.exe!scan_nonmember_declaration(struct a_decl_parse_state *,struct a_source_range *) (Unknown Source:0)
cpptools-srv.exe!declaration(int,int,int,int,struct a_param_id *,struct a_source_range *,struct a_decl_parse_state *) (Unknown Source:0)
cpptools-srv.exe!namespace_declaration() (Unknown Source:0)
cpptools-srv.exe!check_special_declaration_form() (Unknown Source:0)
cpptools-srv.exe!scan_nonmember_declaration(struct a_decl_parse_state *,struct a_source_range *) (Unknown Source:0)
cpptools-srv.exe!declaration(int,int,int,int,struct a_param_id *,struct a_source_range *,struct a_decl_parse_state *) (Unknown Source:0)
cpptools-srv.exe!namespace_declaration() (Unknown Source:0)
cpptools-srv.exe!check_special_declaration_form() (Unknown Source:0)
cpptools-srv.exe!scan_nonmember_declaration(struct a_decl_parse_state *,struct a_source_range *) (Unknown Source:0)
cpptools-srv.exe!declaration(int,int,int,int,struct a_param_id *,struct a_source_range *,struct a_decl_parse_state *) (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!preparse(int,char const * *,class a_scout_store *,class edge::translation_unit *) (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)

The subsequent crashes seem to be instant, and I can't attach to the process in order to check the callstack.
I also created a dump for the crash link

Here are the options given by the configuration provider for the file:

sending compilation args for D:\Perforce\Stream\ICE\DebugGui\Sources\Menus\LLE\Video\WindowVideo.cpp
  include: D:\Perforce\Stream\ICE\DebugGui\Sources
  include: D:\Perforce\Stream\ICE
  include: D:\Perforce\Stream\SDK
  include: D:\Perforce\Stream\SDK\Jolt
  include: D:\Perforce\Stream\SDK\DearImGui
  include: D:\Perforce\Stream\SDK\DearImGui-Gizmo
  include: D:\Perforce\Stream\SDK\DearImGui-Node-Editor
  include: D:\Perforce\Stream\SDK\DearImGui-Plot
  include: D:\Perforce\Stream\SDK\MaterialDesignIcons\Includes
  include: D:\Perforce\Stream\SDK\DearImGui-Net\Code\Client
  include: D:\Perforce\Stream\ICE\DebugGui\Sources\Menus\LLE
  system include: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.40.33807\include
  system include: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.40.33807\atlmfc\include
  system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
  system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
  system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
  system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
  system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
  define: USE_OPTICK
  define: NETWORK_CLIENT
  define: QDT_DEBUG
  define: NDEBUG
  define: PLATFORM_PC
  define: PLATFORM_WINDOWS
  define: WIN32
  define: _WIN64
  define: _WINDOWS
  define: _CRT_SECURE_NO_WARNINGS
  define: QDT_JOLT
  define: KSOUND_COMPONENT_ALLOW_PRIVATE
  stdver: ms_c++17
  intelliSenseMode: windows-msvc-x64

Configuration and Logs

-------- Diagnostics - 12/9/2024, 3:01:27 PM
Version: 1.23.2
Current Configuration:
{
    "name": "QDT",
    "includePath": [
        "d:/Perforce/Stream/ICE"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.19041.0",
    "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe",
    "cStandard": "c17",
    "intelliSenseMode": "windows-msvc-x64",
    "configurationProvider": "qdt-maestro",
    "browse": {
        "limitSymbolsToIncludedHeaders": true,
        "path": [
            "d:/Perforce/Stream/ICE",
            "${workspaceFolder}"
        ]
    },
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "compilerPathInCppPropertiesJson": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe",
    "configurationProviderInCppPropertiesJson": "qdt-maestro",
    "cppStandard": "c++17",
    "mergeConfigurations": false
}
Modified Settings:
{
    "C_Cpp.errorSquiggles": "enabled",
    "C_Cpp.default.compilerPath": "cl.exe",
    "C_Cpp.default.cppStandard": "c++17",
    "C_Cpp.formatting": "clangFormat",
    "C_Cpp.doxygen.generateOnType": false,
    "C_Cpp.codeAnalysis.clangTidy.codeAction.formatFixes": false,
    "C_Cpp.codeAnalysis.clangTidy.enabled": true,
    "C_Cpp.codeAnalysis.clangTidy.path": "C:\\Program Files\\LLVM\\bin\\clang-tidy.exe",
    "C_Cpp.codeAnalysis.clangTidy.checks.disabled": [
        "clang-diagnostic-pragma-once-outside-header",
        "clang-analyzer-security.insecureAPI.strcpy"
    ],
    "C_Cpp.intelliSenseMemoryLimit": 16384,
    "C_Cpp.loggingLevel": "Debug",
    "C_Cpp.experimentalFeatures": "enabled",
    "C_Cpp.caseSensitiveFileSupport": "enabled"
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": false,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {
        "*.sln": "xml",
        "log": "log",
        "*.idl": "cpp",
        "*.inc": "cpp",
        "*.ipp": "cpp",
        "*.qdh": "cpp",
        "*.rh": "cpp",
        "*.tcc": "cpp",
        "*.txt": "cpp",
        "__bit_reference": "cpp",
        "__config": "cpp",
        "__debug": "cpp",
        "__functional_03": "cpp",
        "__functional_base": "cpp",
        "__functional_base_03": "cpp",
        "__hash_table": "cpp",
        "__locale": "cpp",
        "__mutex_base": "cpp",
        "__refstring": "cpp",
        "__split_buffer": "cpp",
        "__sso_allocator": "cpp",
        "__std_stream": "cpp",
        "__tree": "cpp",
        "__tuple": "cpp",
        "__tuple_03": "cpp",
        "algorithm": "cpp",
        "any": "cpp",
        "array": "cpp",
        "atomic": "cpp",
        "bit": "cpp",
        "bitset": "cpp",
        "cassert": "cpp",
        "cctype": "cpp",
        "cerrno": "cpp",
        "cfenv": "cpp",
        "charconv": "cpp",
        "chrono": "cpp",
        "cinttypes": "cpp",
        "climits": "cpp",
        "clocale": "cpp",
        "cmath": "cpp",
        "codecvt": "cpp",
        "compare": "cpp",
        "complex": "cpp",
        "concepts": "cpp",
        "condition_variable": "cpp",
        "copyable_atomic": "cpp",
        "coroutine": "cpp",
        "csetjmp": "cpp",
        "csignal": "cpp",
        "cstdarg": "cpp",
        "cstddef": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cstring": "cpp",
        "ctgmath": "cpp",
        "ctime": "cpp",
        "cuchar": "cpp",
        "cwchar": "cpp",
        "cwctype": "cpp",
        "deque": "cpp",
        "dynarray": "cpp",
        "exception": "cpp",
        "expected": "cpp",
        "filesystem": "cpp",
        "format": "cpp",
        "forward_list": "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",
        "list": "cpp",
        "locale": "cpp",
        "map": "cpp",
        "memory": "cpp",
        "memory_resource": "cpp",
        "mutex": "cpp",
        "new": "cpp",
        "numeric": "cpp",
        "optional": "cpp",
        "ostream": "cpp",
        "queue": "cpp",
        "random": "cpp",
        "ranges": "cpp",
        "ratio": "cpp",
        "regex": "cpp",
        "rope": "cpp",
        "scoped_allocator": "cpp",
        "set": "cpp",
        "shared_mutex": "cpp",
        "slist": "cpp",
        "span": "cpp",
        "sstream": "cpp",
        "stack": "cpp",
        "stdexcept": "cpp",
        "stdfloat": "cpp",
        "stop_token": "cpp",
        "streambuf": "cpp",
        "string": "cpp",
        "string_view": "cpp",
        "strstream": "cpp",
        "system_error": "cpp",
        "thread": "cpp",
        "tuple": "cpp",
        "type_traits": "cpp",
        "typeindex": "cpp",
        "typeinfo": "cpp",
        "unordered_map": "cpp",
        "unordered_set": "cpp",
        "utility": "cpp",
        "valarray": "cpp",
        "variant": "cpp",
        "vector": "cpp",
        "xcomplex": "cpp",
        "xfacet": "cpp",
        "xfunctional": "cpp",
        "xfunctional2": "cpp",
        "xhash": "cpp",
        "xhash_old": "cpp",
        "xheap": "cpp",
        "xiosbase": "cpp",
        "xiter": "cpp",
        "xlocale": "cpp",
        "xlocbuf": "cpp",
        "xlocinfo": "cpp",
        "xlocmes": "cpp",
        "xlocmon": "cpp",
        "xlocnum": "cpp",
        "xloctime": "cpp",
        "xmemory": "cpp",
        "xmemory0": "cpp",
        "xmemory1": "cpp",
        "xnode": "cpp",
        "xscan": "cpp",
        "xstddef": "cpp",
        "xstring": "cpp",
        "xthread": "cpp",
        "xtr1common": "cpp",
        "xtree": "cpp",
        "xutility": "cpp"
    },
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true,
        "__progen__": true,
        "TOOLS BIN": true,
        "TOOLS SOURCE": true,
        "SDK": true,
        "**/*.lua": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
Custom browse configuration: 
{
    "browsePath": [
        "ICE",
        "Fire",
        "ICE-Test"
    ],
    "standard": "c++17",
    "compilerPath": "cl.exe",
    "compilerArgs": [
        "/W4",
        "/WX"
    ],
    "windowsSdkVersion": "10.0"
}
cpptools version (native): 1.23.2.0
Current database path: C:\Users\ava\AppData\Local\Microsoft\vscode-cpptools\c84b6ecf9a362be124b9c61c25e5626a\.browse.VC.db
No active translation units.

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

Other Extensions

No response

Additional context

@Colengms
Copy link
Contributor

Colengms commented Dec 9, 2024

Hi @BluTree . The crash looks to be related to parsing of specific source code. Would you be able to isolate the source code involved to provide a stand-alone repro we could investigate further?

@Colengms Colengms self-assigned this Dec 9, 2024
@Colengms Colengms added more info needed The issue report is not actionable in its current state Language Service labels Dec 9, 2024
@Colengms Colengms added the bug label Dec 9, 2024
@BluTree
Copy link
Author

BluTree commented Dec 12, 2024

I have been trying to gradually minimize the code in order to have a standalone repro the last days, without success.
The codebase I work on is pretty big, so stripping code line by line takes a really long time.

The crash doesn't seem to be present constantly, sometimes it triggers instantly when opening the header (parsed with the configuration of the source file including it), sometimes not.
From what I tested, this can happen with both the configuration provider registered. This also happens whether the C_Cpp.caseSensitiveFileSupport setting is enabled or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Language Service more info needed The issue report is not actionable in its current state
Projects
Status: No status
Development

No branches or pull requests

2 participants