Skip to content

[engine-start-failed] clangd could not be started: granting C:/Program Files: out of memory #86

Closed

Description

@yizhinailong

Version

extension 0.0.20, server 0.0.20

Editor

Visual Studio Code 1.145.2

Operating system

Windows (x64)

Build system

No response

What happened

mcppls reported [engine-start-failed]: clangd could not be started: granting C:/Program Files: out of memory

mcppls saved a diagnostic bundle on this machine: ~/AppData/Local/mcppls/bundles/auto-engine-start-failed-20261110T035920Z.zip
Please attach that file to this issue.

What you expected

No response

Diagnostic bundle

  • I attached the diagnostic bundle

Diagnostic report (only if there is no bundle)

Steps to reproduce

No response

Activity

  1. added
    bug
    on Nov 10, 2026
  2. yizhinailong commented on Nov 10, 2026

    @yizhinailong
    Author
  3. yizhinailong commented on Nov 10, 2026

    @yizhinailong
    Author
  4. yizhinailong commented on Nov 12, 2026

    @yizhinailong
    Author
  5. yizhinailong commented on Nov 12, 2026

    @yizhinailong
    Author

    auto-engine-start-failed-20261112T065515Z.zip
    clangd exits with 0xC000001D while building AST for a module unit that uses a type from an included (guarded) header

    Environment

    • mcppls 0.22.0 (extension sunrisepeak.mcpp-language-server 0.22.0)
      payload built 2026-11-11T04:17:41Z, commit 9e31bf6 (dirty)
    • clangd 23.1.0-mcppls.10, openkal kit mcppls-kit-openkal-0.24.4
    • VS Code 1.146.0, Windows 11 Pro 10.0.26200
    • project: mcpp, target x86_64-w64-mingw32, compiler clang 23.1.3, MSVC STL 14.44.35207

    Summary
    clangd dies with exit code 0xC000001D (STATUS_ILLEGAL_INSTRUCTION) in Building AST...
    for one module interface unit of the project. mcppls restarts it 5 times in 5 minutes,
    reports engine-crash-loop and writes a bundle. The same file compiles fine with
    clang++ 23.1.3 through the normal mcpp build, so this is clangd-side only.

    Steps to reproduce

    1. Open the project. mcppls opens the last-used files, including src/ui/monitor_view.cppm.
    2. clangd builds the preamble (257088 bytes), indexes the c++23 std library, then exits
      ~1-2 s later with 0xC000001D.

    Deterministic standalone reproducer (no LSP client needed):

    okrun.exe clangd.okb
    --check=src/ui/monitor_view.cppm
    --compile-commands-dir=/cdb
    --experimental-modules-support --log=info

    Every run ends in Building AST... followed by exit 0xC000001D.
    main.cpp (a non-module TU that includes ftxui and imports the same modules) is fine.

    Reduced trigger
    The file is a module interface unit:

    module;
    #include <ftxui/dom/node.hpp> // any ftxui header, user include with an include guard
    export module systop:monitor_view;
    import std;
    export namespace monitor {
    auto f(ftxui::Box&) -> int; // any use of an ftxui type in the purview
    }

    Findings from the reduction (same command, same module cache):

    • module + guarded ftxui headers + no purview use of their types: OK
    • using namespace ftxui; alone: OK
    • any purview use of any ftxui type (Component, Closure, Event, Box, Color, Element...): crash
    • same position with std::string / a type from an imported module: OK
    • a synthetic include-guarded header with a single empty struct, used in the purview: crash
    • the same synthetic header without the #ifndef guard, or #pragma once removed: OK
      (pragma once also crashes)
    • a non-module TU including the same headers: OK

    When the module hints are not available (e.g. a fresh CDB where
    module-hints/...pcm is missing), clangd falls back to parsing the headers into a
    22976824-byte preamble and does not crash, with module file ... not found.
    So the crash is on the module path, not in plain header parsing.

    Expected
    No crash; diagnostics/AST for the module.

    Actual
    clangd exits 0xC000001D; mcppls sets main.cpp aside and eventually reports
    engine-crash-loop.

    Attached
    auto-engine-crash-loop-20261112T063025Z.zip (extension diagnostics bundle).
    The project is public if a checkout helps; the file above is enough to reproduce.

  6. self-assigned this
    on Nov 12, 2026
  7. Sunrisepeak commented on Nov 13, 2026

    @Sunrisepeak
    Owner

    @yizhinailong 更新到 0.23.0 再测试一下

  8. speak-agent commented on Nov 13, 2026

    @speak-agent
    Contributor

    v0.23.0 fixes the crash behind this report:

    • The crash. On Windows 11 24H2 (builds 26100 and later) clangd ended with 0xC000001D on any module unit that includes a header in its global module fragment, imports a module and uses the header's type. The engine (23.1.0-mcppls.12) no longer does. CI on build 26100 runs such units with the released package without a single engine exit.
    • The out of memory. This was not memory. The crash loop used up the sandbox's fixed table of granted directories. A file that ends clangd now costs only that file (mcppls's own engine answers for it, across edits and sessions). Automatic restarts keep a reserve of engine starts. When starts do run out, the message says so and offers Restart Server.
    • Reports. The exit is recorded as what it was (e.g. an illegal instruction (0xC000001D), not -1), with the file being built and a command to reproduce it.

    Still open: the root cause (one file having two identities under the runner on 24H2) is fixed in openkal-windows 0.22.0, which a later platform update brings to mcppls. Until then the start table is still not recycled; that is harmless without the crash loop.

    If you can, please try 0.23.0 on your 24H2 machine and let us know whether it works for you. I'll keep this open until then or until the platform update lands.

  9. yizhinailong commented on Nov 14, 2026

    @yizhinailong
    Author

    @Sunrisepeak 已经可以正常提示了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions