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

IntelliSense process crash detected, and cpptools appear to have been shutdown #10982

Closed
SimonKagstrom opened this issue May 22, 2023 · 5 comments
Assignees
Labels
Language Service more info needed The issue report is not actionable in its current state

Comments

@SimonKagstrom
Copy link

Environment

  • OS and Version: Mac OSX Ventura 13.3 (x86_64)
  • VS Code Version: 1.78.2 Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
  • C/C++ Extension Version: v1.15.4

Bug Summary and Steps to Reproduce

Bug Summary:

Some time back (not sure when it started), cpptools intellisense has stopped working completely on my machine. Even pretty trivial C projects fail.

In the C/C++ output, I see repeated IntelliSense process crash detected. messages. The cpptools language server appears to have exited when this happens:

* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x000000010c9df700 cpptools`browse_engine::exit()
cpptools`browse_engine::exit:
->  0x10c9df700 <+0>: pushq  %rbp
    0x10c9df701 <+1>: movq   %rsp, %rbp
    0x10c9df704 <+4>: pushq  %r15
    0x10c9df706 <+6>: pushq  %r14
Target 0: (cpptools) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x000000010c9df700 cpptools`browse_engine::exit()
    frame #1: 0x000000010ca3d6ae cpptools`cpptools_context::shutdown() + 302
    frame #2: 0x000000010cae0b64 cpptools`lsp_manager::process_messages(std::__1::function<void ()> const&) + 3108
    frame #3: 0x000000010ca19cee cpptools`cpptools_context::run() + 62
    frame #4: 0x000000010cae68fd cpptools`main + 237
    frame #5: 0x0000000110b0341f dyld`start + 1903
(lldb) f 2

I'm not quite sure how to reproduce this since it happens all the time for me, but probably not for everyone.

Configuration and Logs

-------- Diagnostics - 22/05/2023, 15:14:04
Version: 1.15.4
Current Configuration:
{
    "name": "Mac",
    "includePath": [
        "/Users/ska/projects/calc/**"
    ],
    "defines": [],
    "macFrameworkPath": [
        "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
    ],
    "compilerPath": "/usr/bin/clang",
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "macos-clang-x64",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "compilerPathInCppPropertiesJson": "/usr/bin/clang",
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Mappings:
[ /Users/ska/projects/calc/src/calc.c ]:
    /Users/ska/projects/calc/src/calc.c
Translation Unit Configurations:
[ /Users/ska/projects/calc/src/calc.c ]: not ready
    Process ID: 38212
    Memory Usage: 0 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /usr/local/include
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/include
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
    Frameworks:
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
    Standard Version: c17
    IntelliSense Mode: macos-clang-x64
    Other Flags:
        --clang
        --clang_version=110000
Total Memory Usage: 0 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 16096
Number of files parsed: 2621

Other Extensions

No response

Additional context

No response

@Colengms
Copy link
Contributor

Hi @SimonKagstrom . The message, IntelliSense process crash detected. refers specifically to the cpptools-srv process having terminated unexpectedly.

The C/C++ Extension will create a cpptools-srv process for each source file opened (possibly merging headers included by the same source file into the same process). The IntelliSense process crash is likely related to specific code being parsed. Since it repro's with a pretty trivial project, it could be that some code has been introduced in particular MacOS or XCode system headers. Could you provide a complete example that repros the crash? And/Or, if you can attach a debugger to that instance of cpptools-srv before the crash occurs and collect a crash stack, that could also help us a lot. https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv

The stack you provided for the cpptools process appears to be a graceful exit, after having received a shutdown message from VS Code.

@Colengms Colengms self-assigned this May 22, 2023
@Colengms Colengms added Language Service more info needed The issue report is not actionable in its current state labels May 22, 2023
@SimonKagstrom
Copy link
Author

As for a minimal example, basically nothing at all works for me. Even this,


int main(void)
{
    return 0;
}

gives me the "IntelliSense process crash detected." message. Attached is a bt-all from cpptools. cpptools-srv terminates very quickly, so I haven't been able to catch it with lldb.

cpptools-bt.txt

@Colengms
Copy link
Contributor

Hi @SimonKagstrom . We're not currently tracking an issue with basic functionality on macOS for the majority of users. There would seem to be something about your system or environment that might help us diagnose the issue. Is there anything unusual about your system, perhaps related to the file system or OS configuration?

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

Could you try completely deleting the extension install directory for the C/C++ Extension, and freshly reinstalling it? The directory to remove would be something like: /Users/<name>/.vscode/extensions/ms-vscode.cpptools-1.15.4-darwin

You might also try installing the latest prerelease version, 1.16.0. Or, if you were to try prior versions and discover one that works, that might help us isolate some difference that could be causing an issue.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented May 24, 2023

Does it work if you set C_Cpp.intelliSenseCacheSize to 0? If so, another reported that same issue on Mac at #10789 .

@SimonKagstrom
Copy link
Author

@sean-mcmanus It does!

Thanks a lot, then I'll close this one as a duplicate of #10789.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Language Service more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

3 participants