Skip to content

Upstream defects register (clangd, mcpp) #24

Open

Description

@Sunrisepeak

Register of upstream defects mcppls depends on. This body is the index; each comment below is one problem.

Bundled: clangd 23.1.0 (clangd/clangd release). Code workarounds: src/engine/clangd/workarounds.cpp (WA-CLANGD-<n>, listed by mcppls report); deliberate limits: .agents/docs/design.md §7.

Rules: a new problem gets a comment and a row here; adding or removing a workaround updates its comment; link upstream issues/fixes when they exist; walk this list before bumping the bundled clangd.

clangd / LLVM

ID Problem Upstream mcppls
UP-01 Module name ending in . hangs the preprocessor (crashes on Windows) unfiled; fixed on main? (deferred) WA-CLANGD-001; disk check (0.0.5)
UP-02 Unresolved import can deadlock the unit's build unfiled WA-CLANGD-002; disk check (0.0.5)
UP-03 Modules a file needs are built one at a time unfiled (perf) WA-CLANGD-003
UP-04 Finding a module's unit scans the whole database unfiled (perf) WA-CLANGD-004
UP-05 MSVC STL aligned allocation rejected (align_val_t ambiguous) fixed in 23.1.1 (llvm-project#218152) WA-CLANGD-005
UP-06 Stops answering one file while answering others unfiled quarantine
UP-07 Stuck with no CPU after rapid module edits unfiled StuckWatch restart
UP-08 Background index does not build module imports (definitions indexed apart from their declarations) unfiled (gap); cf. clangd/clangd#2569 WA-CLANGD-008: implementation units built in the foreground; search by name (0.0.6)
UP-09 No textDocument/semanticTokens/range unfiled (gap) capability gated
UP-10 import std; then an unprovided export import never finishes unfiled known limit
UP-11 Module scanning fails on link-phase driver errors unfiled fixed in mcppls 0.0.5 (-c)
UP-12 Windows: Build AST crash on a module unit with unresolved imports unfiled; needs stack avoided by -c; crash file set aside (0.0.5)
UP-13 Windows: Build AST crash on some units even with correct commands unfiled; needs stack (Windows release prints none) contained (0.0.5); crash records carry clangd's SHA-256 (0.0.8)
UP-14 Imports added in an unsaved buffer are not built until save unfiled WA-CLANGD-007; disk check (0.0.5)
UP-15 Missing ; after import is reported on the next line unfiled WA-CLANGD-006 (0.0.5)
UP-16 C++26 contracts and reflection are not implemented gap (upstream work in progress) documented; VS Code colors contract keywords
UP-17 A function defined in an open unit is missing from the index (prepare_build) unfiled; not reduced yet definition found by name (0.0.6)
UP-18 A module lock left by a killed clangd is never released (Windows waits forever) unfiled locks cleared at start and on a wait (0.0.7)
UP-19 One BMI directory per command, never removed unfiled (gap) two newest kept, mcppls cache --prune (0.0.7)
UP-20 Crash loop on a fan-out save of mcpp.manifest.types unfiled; needs a stack backed off, bundle written (0.0.7); crash records carry LLVM's stack dump and clangd's SHA-256 (0.0.8, K-3)
UP-21 A unit closed while its build runs can keep a worker spinning unfiled K-8 restart (0.0.8); K-7
UP-22 clang-tidy: misc-const-correctness says a filter/drop_while/chunk_by/split view can be const (issue #37) unfiled; reduced case ready WA-CLANGD-010 drops it (0.0.9)
UP-23 --experimental-modules-support rescans module dependencies on every completion (~3x slower on heavy headers, issue #37) unfiled (perf) WA-CLANGD-009: off for projects without modules (0.0.9)
UP-25 Every completion on a file that imports modules costs ~1 s, even unchanged (the module context is re-loaded per request; a file without imports in the same project: 60 ms) unfiled (perf) WA-CLANGD-012: the file's budget extends past the flat one when the engine's answers keep landing just past it (0.0.11, PR #41)
UP-26 Preamble trace filename metadata can outlive borrowed storage and corrupt trace JSON unfiled; pinned 23.1.0 source-backed proposed maintained patch0051 owns metadata; delayed-context/native canaries pending
UP-27 Default OverlayCDB invokes a null command mangler during module scanning unfiled; 23.1.0 source/API control confirmed maintained engine0058 pending; no product workaround
UP-28 Header-import PCH visibility guard reparses heavy textual prefixes llvm-project#181770; mitigation#189284 conservative handling retained; verified import-free prefix candidate0066 pending
UP-29 GNU std producer flags enable Clang implicit builtin maps during scanning unfiled; pinned23.1.0/GNU16.1 source evidence scoped same-install standard-producer adapter candidate0067 pending
UP-30 One prerequisite module that does not compile leaves its importers with no module at all unfiled WA-CLANGD-014 (importers to mcppls's engine); mcppls-clangd 0.0.13 0028 (partial-prerequisite-modules) retires it
UP-31 Completion in a module importer waits without bound for its first preamble and new imports unfiled mcppls-clangd 0.0.13 0027 (bounded-module-wait): 600 ms / 250 ms, answers marked incomplete
UP-32 Why a module is rebuilt, and what a file's prerequisites cost, is not logged at the default level unfiled (observability) mcppls-clangd 0.0.13 0026 (module-rebuild-reasons); mcppls 0.0.13 startup line

mcpp

ID Problem Upstream mcppls
UP-M1 mcpp: macOS deployment target ignored when cross-compiling fixed (mcpp#685, 2026.9.24.1) done in 0.0.5
UP-M2 mcpp: emit build-database fails whole on one member's failure fixed (mcpp#699, 2026.9.26.2) partial answer used; download offer for a missing member (0.0.6)
UP-M3 mcpp: build programs cannot tell a plan/emit pass filed: mcpp#699 none
UP-M4 mcpp: a rule's inputs are translation units; generated output points at an empty directory filed: mcpp#724 inputs left out; project's target/ read; missing reported (0.0.6)
UP-M5 mcpp 2026.9.27.1: workspace = true in a path-dependency member fails filed: mcpp#725 CI pins 2026.9.26.1
UP-M6 mcpp: emit build-database takes about a minute on a large workspace unfiled (perf) deadline follows the producer; reruns only on structure changes (0.0.7)
UP-M7 mcpp: a module source two packages include is reported as provided twice; the member is left out unfiled partial answer used; stand-ins together (0.0.8, P-1)

xmake

ID Problem Upstream mcppls
UP-X1 GCC module mapper files are keyed by the source's relative path only: another build of the same path (a second build directory, another checkout) overwrites them and breaks the next incremental build unfiled; reproduced on 3.1.1 and 3.1.2 0.0.16 triggered it (#69); fixed in 0.0.17: XMAKE_TMPDIR for the private run (fixture xmake-shared-tmp)
UP-X2 xmake project -k compile_commands trusts a module scan cache only a build updates; a missing dependfile then fails every describe until a build unfiled; reproduced on 3.1.1 and 3.1.2 0.0.16 fell back to inference (#68); fixed in 0.0.17: private state as a disposable cache, redone once on this error (fixtures xmake-target-then-mode, xmake-stale-state)

mcpplibs

ID Problem Upstream mcppls
UP-L1 tinyhttps 0.3 fails a request whose answer has a header line over 8 KB; GitHub's release-download redirect now has a 9.2 KB one unfiled packaging falls back to curl (#70, 0.0.17); the server is not affected

PRoot (Termux)

ID Problem Upstream mcppls
UP-P1 termux/proot: execveat with a directory descriptor fails with ENOSYS to be filed openkal-linux 0.15.1 falls back to execve (0.0.7)
UP-P2 seccomp mode returns with rewritten argument registers (termux, proot-me) to be filed argument registers declared in/out (0.0.7)
UP-24 clangd leaves a copy-on-read BMI behind whenever it dies before releasing it; the only GC waits 3 days and reads atime (unreliable on Windows, and it removes published BMIs too) 23.1.0 (bundled) unfiled (recorded here)

openkal

ID Problem Upstream mcppls
UP-O1 openkal-macos 0.12.0 terminates a closed-pipe writer with SIGPIPE unfiled WA-PLATFORM-001: per-input-pipe protection; native fix validation pending

VS Code / languageclient

ID Problem Upstream mcppls
UP-V1 vscode-languageclient 10.1.1 loses startup ownership when the server exits during initialize; unhandled start/stop rejections unfiled; standalone reproducer TODO WA-VSCODE-003; queued fresh-client recovery; native macOS SIGPIPE cause remains unverified (0.0.12, PR #46)
UP-V2 vscode-jsonrpc 9.0.2 throws from a discarded async request executor after a failed stream write unfiled; deterministic Linux reproduction WA-VSCODE-004; failed protocol writes close their connection; native Intel macOS revalidation pending (0.0.12, PR #46)

Activity

  1. pinned this issue on Sep 25, 2026
  2. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-01 · Module name ending in . hangs clangd token collection

    • Symptom: in an import/module directive, a name ending in . with nothing but whitespace or a comment after it on that line (every import a.b passes through import a.) sends the preprocessor into a loop (P1857 directive lexing). Linux/macOS: never finishes. Windows: exits 0x80000003. Also without --experimental-modules-support.

    • Affected: clangd 23.1.0. 22.1.8 and main 510126255 are fine.

    • Upstream: unfiled. Likely fixed on main by 6dcfc17b1b (#187846), not in 23.1.2; not bisected.

    • mcppls: WA-CLANGD-001 — the text sent to clangd gets a ; after the dot on the same line (positions unchanged).

    • Remove when: the bundled and the oldest supported clangd finish import a. at once (canary: conformance/fixtures/workaround-canaries).

    • Evidence: .agents/docs/2026-09-25-import-hang-status-highlight.md §1; fixtures typing-import, typing-import-spin.

    • Hole (2026-09-26, measured): WA-CLANGD-001 rewrites only the text sent over LSP. With files.autoSave, the file on disk holds import hello.; clangd resolves prerequisite modules from the file on disk (UP-14), and the file's Worker:<file> thread then spins at 100 % CPU (buffer only: 2 ticks / 20 s; on disk: ~2000). Fixing the buffer does not stop it; only a clangd restart does. Every request for that file waits behind it, so clangd-backed completion (keywords) and hover disappear, and repeated autosaves drive restarts into the cap. Fix plan F16.

    • Decision (2026-09-26): mcppls first ships the disk-side mitigation (fix plan F16: isolate the file before clangd reads the half-typed name; restart only as a fallback). Upstream work is deferred — handled later; bundling a self-built 23.1.x with the fix cherry-picked is the fallback if no backport comes.

    • Shipped (mcppls 0.0.5): the disk side is covered: a file whose text on disk has such a name is set aside before clangd builds it, a build begun on it just before is let finish for 1.5 s or clangd is restarted without it, and the file goes back once the disk is fixed (fixture typing-autosave; hello project: 0 CPU for every clangd thread over 20 s with import hello. on disk).

    • TODO (deferred): bisect (6dcfc17b1b?), file, ask for a 23.1.x backport.

    • Root-cause correction (2026-10-07): ordinary clang parsing terminates for
      the same malformed input. A raw clangd --check debugger stack stops in
      TokenCollector::consume during ParsedAST construction. Controlled temporary
      instrumentation identifies logical tok::eod newline: it has no spelled C++
      token, so token mapping reaches a nonprogress failure path. The earlier
      preprocessor-loop diagnosis and proposed main commit were hypotheses, not
      established root causes. Instrumentation was removed before the repair.

    • Maintained-engine repair: patch 0015 skips logical end-of-directive tokens
      in collection. Local Linux raw clangd lit passes; six LSP variants reply,
      recover after didChange, close/reopen and shut down. Two exact before-fix
      controls time out. See engine PR Bump actions/cache from 4 to 6 #2 and tests/evidence/module-directive-recovery.json.
      The syntax unit regression is added but not yet executed locally.

    • Remaining: final packaged-byte and native Windows proof, cancellation
      and missing-provider hangs. WA-CLANGD-001 remains enabled; no unsupported
      engine loses its mitigation. The fix is not upstream-submitted yet.

  3. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-02 · Unresolved import can deadlock the unit's build

    • Symptom: building a module unit whose import resolves to nothing can deadlock clangd.
    • Affected: clangd 23.1.
    • Upstream: unfiled.
    • mcppls: WA-CLANGD-002 — such imports get an empty stand-in unit.
    • Remove when: clangd reports a diagnostic for such a unit instead of stalling.
    • Evidence: robustness design C2, experiments S12/S17; fixture module-faults.
    • Through the disk (2026-09-26): clangd reads a file's imports from disk (UP-14), so an autosave of import hello.e (a module that does not exist yet), below a working import, stalls every request for the file — the stand-in the plan withheld while the name was typed never came. mcppls 0.0.5: the plan gives a file being edited a stand-in for every module its text on disk imports, the scanner counts an import whose ; is not typed yet (as clang does), and a file whose disk imports the database clangd has read cannot resolve yet is set aside until it can (fixture typing-autosave).
  4. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-03 · Modules a file needs are built one at a time

    • Symptom: clangd builds the modules a file needs serially; cold start is slow.
    • Affected: clangd 23.1.
    • Upstream: unfiled (performance).
    • mcppls: WA-CLANGD-003 — mcppls prepares the modules in parallel first (prime units).
    • Remove when: clangd builds independent modules concurrently.
    • Evidence: cold-start plan 4.4; fixture timing.
  5. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-04 · Finding a module's unit scans the whole database

    • Symptom: to find the unit providing a module, clangd scans every file in the database, in every worker (ProjectModules.cpp, CompileCommandsProjectModules).
    • Affected: clangd 23.1.
    • Upstream: unfiled (performance).
    • mcppls: WA-CLANGD-004 — the database names each unit (-fmodule-file=<name>=<path>, -fmodule-output=); clangd scans only that file to confirm.
    • Remove when: clangd looks a module's unit up without a whole-database scan.
    • Evidence: usable plan W7; fixture timing.
  6. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-05 · MSVC STL aligned allocation rejected (align_val_t ambiguous)

    • Symptom: clangd rejects MSVC STL's aligned allocation; align_val_t is ambiguous inside its std module.
    • Affected: clangd 23.1.0.
    • Upstream: fixed — llvm-project#218152, in 23.1.1. clangd/clangd has published no release after 23.1.0.
    • mcppls: WA-CLANGD-005 — units using MSVC STL get -fno-aligned-allocation.
    • Remove when: the bundled clangd is 23.1.1 or later.
    • Evidence: .agents/docs/design.md §7; fixtures cmake-msvc-std, mcpp-msvc.
    • TODO: bump the bundled clangd once clangd/clangd releases ≥ 23.1.1.
  7. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-06 · Stops answering one file while answering others

    • Symptom: requests for one file go unanswered while others are answered.
    • Affected: clangd 23.1 (experiments S2, S12).
    • Upstream: unfiled.
    • mcppls: Quarantine (src/engine/clangd/guard.cppm) — the file is set aside and answered by mcppls's own engine, handed back when it changes or its term ends.
  8. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-07 · Stuck with no CPU after rapid module edits

    • Symptom: after a module's source changes twice within a second, clangd leaves a request unanswered, answers nothing else and uses no CPU.
    • Affected: clangd 23.1.
    • Upstream: unfiled.
    • mcppls: StuckWatch restarts it (docs/50-troubleshooting.md). Not detected on Windows, where clangd's CPU time is unreadable; files are set aside one by one instead.
  9. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-08 · Background index does not build module imports

    • Symptom: a function defined in an implementation unit nobody opened resolves to its declaration only. Measured 2026-09-27: every module unit's background indexing logs Failed to compile …, index may be incomplete (16 of 16 units of a small partitioned module; math.cpp indexed with 0 symbols), and a definition whose signature uses a type from a module is indexed as a different symbol from its declaration (workspace/symbol returns both). In mcpp's own prepare module, go-to-definition on phase0_manifest_and_workspace(PrepareState&) stayed on its declaration for as long as it was measured (420 s). Opening the defining unit fixes it (the foreground builds its modules), and the symbols stay after it is closed.
    • Affected: clangd 23.1.0 (BackgroundIndex::index() in clang-tools-extra/clangd/index/Background.cpp builds the compiler instance with no ModulesBuilder).
    • Upstream: unfiled; the same gap is behind the symptoms of [C++20 modules] Important features still missing for the module support of clangd clangd/clangd#2569 (references and rename inside modules).
    • mcppls: 0.0.5 built up to four of the module's other units, chosen by file name, and asked again. 0.0.6: WA-CLANGD-008 builds implementation units through clangd's foreground (the units of an opened file's module and its imports first, a unit changed on disk again, the rest when idle; mcppls.index.primeImplementationUnits), the search picks the units that define the name, and a definition clangd still cannot link is found by name (plan .agents/docs/2026-09-27-qt-demo-navigation-discovery-plan.md §2.3, N-7, N-8; fixture mcpp-partition-definition, which 0.0.5 fails).
    • Not covered: Find References, Call Hierarchy and Rename across files that were never open.
    • Remove when: clangd's background index builds the modules a unit imports before indexing it.
  10. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-09 · No textDocument/semanticTokens/range

    • Symptom: clangd has no range request for semantic tokens; advertising it made clients get "method not found".
    • Affected: clangd 23.1.
    • Upstream: unfiled (feature gap).
    • mcppls: advertises range only when every engine can answer it (src/orchestrator/tokens.cppm).
  11. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-10 · import std; then an unprovided export import never finishes

    • Symptom: a file where import std; precedes an export import of something nothing provides never finishes, when the command names std's unit (-fmodule-file=std=…). Minimal: export module m; import std; export import :p;.
    • Affected: clangd 23.1 and main 510126255.
    • Upstream: unfiled; to be filed with UP-01.
    • mcppls: known limit, no workaround (.agents/docs/design.md §7): only stray files outside the database get such a command; the first-diagnostics guard sets them aside after 120 s.
    • Evidence: import-hang plan §13 item 4.
  12. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-11 · Module scanning fails on link-phase driver errors

    • Symptom: the P1689 scan (ModuleDependencyScanner::scan → getP1689ModuleDependencyFile) runs the command as written and fails on Compilation->containsError(), while AST building (createInvocation) inserts -fsyntax-only. A driver error that only exists for a link (e.g. LTO requires -fuse-ld=lld for windows-msvc with -flto and no -c) fails every scan: no BMI is built, yet ASTs look fine.
    • Affected: clangd 23.1.0, any host (the check is per target).
    • Upstream: unfiled — suggest scanning only up to the compile phase, as the AST path does.
    • mcppls: the trigger was mcppls's own bug (Windows/MSVC: generated clangd compile commands with -flto but no -c break module scanning #23: engine commands lacked -c). Fixed in 0.0.5: every engine command carries -c (fixture compdb-lto-msvc); a scan that still fails on a command is told as an environment issue with the driver's words (fixture compdb-rejected-command).
    • Evidence: Windows/MSVC: generated clangd compile commands with -flto but no -c break module scanning #23; clang/lib/Driver/Driver.cpp (err_drv_lto_without_lld), clang/lib/Tooling/DependencyScanningTool.cpp:121; reproduced locally and in GalTranslPP CI (run 36178100611).
  13. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-12 · Windows: Build AST crash on a module unit with unresolved imports

    • Symptom: on Windows, Build AST of a module unit whose imports cannot resolve (no BMIs) crashes, 0x80000003. Example: GalTranslPP GPPDefines.ixx (only export imports and declarations).

    • Affected: clangd 23.1.0 (clangd/clangd Windows release). Same input does not crash on Linux.

    • Upstream: unfiled — needs a stack and a minimal repro.

    • mcppls: triggered by UP-11; with -c the BMIs build and the crash is gone (--check: crash as written, exit 0 with -c). Fix plan F1, plus precise quarantine from clangd's crash context (F3).

    • Evidence: GalTranslPP CI run 36178100611, experiments E3a/E3b/E3c.

    • Notes: clangd prints only Signalled during AST worker action: Build AST, Filename: and Exception Code: 0x80000003; no stack, no minidump, no event-log entry. Same code as UP-01 on Windows. UTF-8 BOM is not the common factor.

    • TODO: stack via the SDK's cdb.exe in that CI; compare clangd 22.1.8; reduce; file.

    • Native source-qualified maintained proof (2026-10-08): Windows workflow37722679744 at engine source9e0e535191 passes the qualified nonempty original GalTranslPP case, retaining six missing BMI hints, original stdc++23/O3/g/flto flags and missing-c shape. Matching clangdSHA86468960e2a4f237f9012b3db2383ce9dd0b5d5e156dad74a3bff3f1a84539ad has PDBGUID{A440DF1E-E48C-4BB9-AC86-A1A1D219585E}/age1; debugger symbol lookup of clangdMain succeeds. Replay exits0, readers stop and actual documentSymbol result includes NameType/kind10. Engine draftPR2 tracks tests/evidence/windows-up12-fixed-fork.json and qualification documentation. This proof covers that source only; final joint patches must replay the corpus again. UP13/UP20 and final native release remain unqualified.

  14. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-13 · Windows: Build AST crash on some units even with correct commands

    • Symptom: on Windows, Build AST of NormalJsonTranslator.Core.cpp (global module fragment including pybind11/toml11/proxy, then module X; and several imports) crashes, 0x80000003, even with -c, working BMIs and cross-module hover.
    • Affected: clangd 23.1.0 (clangd/clangd Windows release). Not on Linux.
    • Upstream: unfiled — needs a stack and a minimal repro.
    • mcppls: containment only, shipped in 0.0.5: the file clangd names in its crash context is the one set aside (fixture clangd-crash-context), clangd waits for the build tool's model instead of crashing on a provisional one, and a provisional model's crashes are forgotten when it is replaced.
    • Evidence: GalTranslPP CI run 36178100611, experiment E3d; run 36164741493.
    • 0.0.8 (2026-09-30): still reproduces on GalTranslPP#1 (run 36738002085): four crashes while the provisional model serves (NormalJsonTranslator.{Batch,Core,File}.cpp, .ixx, Build AST, 0x80000003) — the files' own builds, not preparation, which 0.0.8 no longer does on a provisional model (R-4) — and five more after a partial model from mcpp (UP-M7) replaced it. mcppls 0.0.8 records each crash's exit code and the clangd binary's SHA-256 in lastExit and the incident (K-3): here dbd52c13d21ef9d284f4f0627efe76c81adf2fe0998f230127f554a54fc9dde7 (clangd 23.1.0, clangd/clangd Windows release). The Windows release prints Exception Code: and no stack frames, so there is still no stack to report.
    • TODO: as UP-12; a symbolized Windows build of clangd 23.1.0 is what a stack needs.
  15. Sunrisepeak commented on Sep 25, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-M1 · mcpp: macOS deployment target ignored when cross-compiling

  16. 25 remaining items

  17. Sunrisepeak commented on Oct 7, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-V1 · vscode-languageclient loses initialization ownership when its server exits during startup

    Affected: vscode-languageclient 10.1.1 (the extension lockfile); reproduced with VS Code 1.132.0 on Linux. Product CI run 37658653689 on Intel macOS also reports duplicate clangd.applyFix, disposed pending responses and Unexpected SIGPIPE during the crash-loop test, but this entry does not claim that SIGPIPE has the same root cause.

    Symptom and evidence: SIGKILL the replacement server while client initialization is pending. With the original extension and the new real-payload regression, the suite produces 1 passing / 2 failing tests and captures four unhandled rejections: two pending responses disposed, two stop attempts on a Starting client. The guarded lifecycle produces 2 passing tests and zero captured unhandled rejections, and verifies command registration plus a cache request after recovery. Detailed proof, intermediate failures and limits: .agents/docs/2026-10-08-client-crash-recovery.md in draft PR #46.

    Source: vscode-languageclient/lib/common/client.js 10.1.1: start() owns a separate internal _onStart promise; handleConnectionClosed() disposes the connection and resets it before the original initialization continuation necessarily settles; doInitialize() calls void stop() on failure, which rejects for a dead Starting client. Same-client automatic restart can additionally overlap feature cleanup/initialization. The macOS duplicate-command explanation is source-supported inference, not the exact stack reproduced on Linux.

    Upstream status: unfiled. A standalone library reproducer and upstream review remain TODO; no upstream fix is known or claimed by this entry.

    mcppls: WA-VSCODE-003 in editors/vscode/src/workarounds.ts and extension.ts. Wait for original startup settlement in the close handler before library cleanup/reset; absorb a failed shutdown only after that client's transport closes. The extension queues fresh-client recovery, preserves the three-crash budget, and skips conflict-detection prompts during automatic recovery.

    Remove when: an updated upstream library passes the initialization SIGKILL test with the guards removed: no orphaned start promise, no unhandled shutdown rejection, working command registration and requests after recovery. test/suite/zCrashLoop.test.ts is the behavioral regression; run the unguarded negative control when evaluating a dependency upgrade.

    TODO: standalone reproducer, upstream filing, inspect any upstream lifecycle fix before removing WA-VSCODE-003, rerun the native Intel macOS VSIX scenario and separately establish the SIGPIPE cause.

  18. Sunrisepeak commented on Oct 7, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-V2 · vscode-jsonrpc leaves a failed request write's async executor rejection unowned

    Affected: vscode-jsonrpc 9.0.2, used by vscode-languageclient 10.1.1 in the extension lockfile. Reproduced on Linux with the actual dependency and a destroyed Node stream. Product CI run 37686772481 reports two unhandled ERR_STREAM_DESTROYED rejections in the Intel macOS VSIX crash-loop suite after the UP-V1 lifecycle guard was present.

    Symptom and evidence: A correctly caught sendRequest() still emits an independent unhandled rejection when its stream write fails. The caller receives MessageWriteError (-32099), while the process separately receives ERR_STREAM_DESTROYED. Source: vscode-jsonrpc/lib/common/connection.js, sendRequest() lines 1124–1151: an async Promise executor awaits the write, rejects the caller in its catch, then throws the same error into the executor's discarded promise. The CI stack starts in Node _write, then WritableStreamWrapper.write, StreamMessageWriter.doWrite; the crash-loop after-all assertion catches two orphaned rejections. This source defect is directly reproduced; the CI stack alone does not identify each original request.

    Upstream status: unfiled. A standalone upstream issue and dependency upgrade evaluation remain TODO.

    mcppls: WA-VSCODE-004, a writer scoped to each LanguageClient transport. A failed write invalidates that protocol stream and raises connection closure; normal connection disposal rejects outstanding requests. The wrapper owns the failed write promise rather than allowing the library's discarded executor to throw. There is no process-wide rejection handler in production. Live responses and server request errors remain unchanged. A deterministic Linux regression receives the normal disposed-request error (-32097), observes no orphaned rejection, and checks a live response plus a real server error.

    Remove when: a dependency upgrade passes the failed-stdio-write regression without the writer wrapper: the request rejects once, no independent unhandled rejection, normal responses and server errors still work. editors/vscode/test/unit/transportWriter.test.ts and the real-payload test/suite/zCrashLoop.test.ts cover those behaviors. Native Intel macOS revalidation remains required; Linux controlled evidence is not a native verdict.

    TODO: standalone upstream filing, rerun the native Intel macOS VSIX crash-loop suite, inspect the upstream sendRequest implementation before retiring WA-VSCODE-004.

  19. Sunrisepeak commented on Oct 8, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-26 — asynchronous preamble trace metadata outlives its filename

    Symptom: BuildPreamble trace args.File contains freed-looking bytes and can make the trace JSON invalid UTF-8. This is observed diagnostic corruption; it is not evidence of a semantic compiler crash.

    Affected: the pinned LLVM/clangd 23.1.0 baseline borrows FileName at Preamble.cpp's BuildPreamble and CreatePreamblePatch spans. json::Value(StringRef) retains borrowed storage, while JSONSpan can remain alive through a retained request Context after the lexical span and filename owner end. Other upstream versions are untested.

    Upstream status: unfiled; deterministic old/fixed Linux regression is complete; native/full-recipe qualification remains pending.

    What mcppls does: maintained-engine patch 0051 owns the filename string at those two trace callsites. No server/extension workaround or semantic assertion suppression. Patch 0048's matched Qt probe retained an invalid trace at byte 182878; its structured semantic report remains valid. The original corrupt trace is retained byte for byte. The actual preamble callback canary retains Context beyond buildPreamble, overwrites the caller filename with same-length ASCII x, and proves that old production emits x while fixed production preserves the exact original path.

    Removal condition: upstream owns the metadata for its complete event lifetime and the delayed-context canary passes on the bundled base.

    Evidence / TODO: engine draft PR #2; owned trace patch and proof; the same test object fails against old production and three focused fixed tests pass22ms. Final raw Qt trace passes strict UTF8/JSON and seven actual filename values, with all four semantic requests passing. Private changed-object links do not qualify native clean recipes. TODO: native canaries and upstream minimal report. This row remains open pending those checks.

  20. Sunrisepeak commented on Oct 8, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-27 · clangd23.1: a default OverlayCDB command mangler is called unconditionally during module scanning

    • Symptom: the public OverlayCDB(&Base) constructor defaults its CommandMangler to null. OverlayCDB::getProjectModules nevertheless installs a nonempty callback that unconditionally calls that null mangler. A real required-module scan through this default overlay segfaults at address0; ordinary getCompileCommand already guards the same optional mangler.
    • Affected: confirmed source in the unmodified pinned llvmorg-23.1.0 source archive; Linux x64 actual private integration control with real CDB and external module provider. This is an API default/null boundary, not a crash claim about the normal ClangdMain path, which supplies a mangler.
    • Upstream: unfiled. The original source callback in GlobalCompilationDatabase.cpp lines858–861 has no guard; the documented constructor default is null. Newer versions are not verified.
    • mcppls: no product workaround or WA ID added. A separate maintained-engine patch0058 will guard the optional call while preserving nonempty command configuration and request-generation behavior. Registration precedes implementation/export.
    • Evidence: actual default-overlay control fails with SIGSEGV; GDB shows #0 null PC, Bump actions/upload-artifact from 4 to 7 #1 getCompileCommandForFile, Bump actions/cache from 4 to 6 #2 ModuleDependencyScanner::scan, Bump actions/setup-node from 4 to 7 #3 CompoundProjectModules::getRequiredModules. Raw private evidence /tmp/mcppls-provider57-build/external-gdb.log; pinned original source extracted readonly as /tmp/mcppls-pinned-GlobalCompilationDatabase.cpp. A production-style explicit noop callback passes but cannot replace the default/null regression.
    • TODO/drop: prove the actual default overlay scans and imports a real compiled module, and explicit command overrides/manglers still win; same-object negative/positive control; native CI; file upstream and drop when the optional-mangler guard and equivalent canary land. No speculative editor exposure, source-wide ABI or release qualification claim.
  21. Sunrisepeak commented on Oct 8, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-28 · Header-import preambles lose module visibility; avoiding every module preamble reparses heavy textual headers

    • Symptom: A header that imports a C++ module can produce missing module visibility through a PCH. Disabling the preamble for every importing translation unit preserves that safety boundary but repeatedly reparses large textual prefixes during completion.
    • Affected scope: LLVM's experimental C++ modules path; upstream llvm-project#181770. The maintained pinned 23.1.0 joint tree retains conservative preamble skipping when module dependencies are attached. This is distinct from UP-23's repeated dependency scanning.
    • Upstream: [clangd] import from #include not working llvm/llvm-project#181770 ; [clangd] Introduce --skip-preamble-build command line option llvm/llvm-project#189284 (merged mitigation). Earlier proposal [clangd] [C++ Modules] Skip PCH when TU imports modules llvm/llvm-project#187432 was not merged. The separate ModuleCache lifetime fix in llvm-project#203952 is already present in the pinned source and is not claimed as an unfixed defect here.
    • mcppls: No new product workaround. Maintained candidate0066 allows only a verified import-free textual prefix, preserving full original TU commands and module read leases. Header imports, unknown scans, compiler module maps and explicit PCH inputs keep conservative handling. Exact filesystem replay correction0065 supports provenance verification.
    • Evidence: Correct-path Qt JSON completion with0061/0062 spends about847ms in semantic completion. Private0066 initial original-command JSON qualified/member controls returned required semantics and all8 inserted results compiled with the actual GCC command; observed warm requests43–51ms and edited123–131ms. These small concurrent exploratory controls do not qualify latency distributions or the release improvement gate.
    • Removal/drop: Drop candidate0066 if canonical scan, exact content/filesystem provenance or emitted PCH import audit cannot establish the prefix is import-free. Reassess against an upstream implementation that safely preserves module visibility through preambles; never relax compiler validation to meet timing.
    • TODO: Final focused controls, actual compiler insertion proof, independent3×30 quiet distributions and matched correct-path baseline, native whole-recipe validation. Header-import crash/visibility cases remain separate canaries.
  22. Sunrisepeak commented on Oct 8, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-29 · GNU standard-module producer flags enable Clang implicit builtin maps during scanning

    • Symptom: The original GNU libstdc++16.1 bits/std.cc provider is compiled by canonical GCC g++ with -std=c++23 -fmodules, includes and sysroot, without a module mapper. The maintained clangd path interprets -fmodules as enabling Clang implicit module maps; its builtin _Builtin_inttypes enters resource inttypes.h with unknown intmax_t/uintmax_t in this actual project. Actual std-qualified completion remains unqualified.
    • Affected scope: Pinned clangd23.1.0/GNU16.1 standard-module provider commands in the original Qt CDB. Ordinary GNU source and explicit Clang module-map configurations are separate cases. This is a missing command-dialect adaptation, not proof that every GNU standard-library version is supported by Clang.
    • Upstream: unfiled; current source/canonical-command evidence available. No upstream fixed-version claim.
    • mcppls: No product workaround added. Existing maintained0061 translates only canonical GCC commands carrying a nonempty GNU module-mapper marker, preserving -fmodules and explicit Clang options. That guard deliberately leaves this real standard-library producer unchanged. Candidate0067 will investigate same-install canonical GNU std/std.compat source provenance and bounded actual named-module role; unknown/failed/outside-install/non-C++/header-unit recognition must decline. No global all-GCC flag removal.
    • Evidence: Original /home/speak/test/mcpp/qt-demo/compile_commands.json provider uses same GCC installation include/c++/16.1.0/bits/std.cc, source global module fragment and export module std. Actual scanner records the builtin inttypes failure. Previous broad private translation experiment is only causality evidence, not a qualified fix. Product/compiler-generated commands are preserved as inputs.
    • Removal/drop: Drop scoped adapter if role/provenance cannot be established or explicit Clang configuration is changed. Remove when upstream command handling distinguishes GNU named-module producer intent and all original-command semantic/compiler controls pass.
    • TODO: Source/command negatives, exact original scan and worker command validation, real std-qualified Sema/typed candidates and actual GCC insertion compilation, full context distributions and native joint recipe. Candidate0067 is private and unqualified.
  23. Sunrisepeak commented on Oct 11, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-30 · One prerequisite module that does not compile leaves its importers with no module at all

  24. Sunrisepeak commented on Oct 11, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-31 · Completion in a module importer waits without bound for its first preamble and for newly imported modules

  25. Sunrisepeak commented on Oct 11, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-32 · Why a module is rebuilt, and what a file's prerequisites cost, is not logged at the default level

    • Symptom: a warm start that rebuilds modules it should reuse, or a slow first preamble with nothing rebuilt, can only be explained from a verbose log, and only by inference.
    • Affected scope: every investigation of module build performance.
    • Upstream: unfiled (observability).
    • mcppls: mcppls-clangd 0.0.13 patch 0026 logs at info, before each build, why the BMI it had is not reused (none for this command and prerequisites, with how many were built with others, or the input that changed, from a reporting read of the stale BMI), one line per file with its prerequisites' cost (reused, built, failed, reuse checks, builds), and why a preamble is not compatible. Declared as module-rebuild-reasons; mcppls 0.0.13 counts the reasons in its startup line and report.
    • Evidence: 0.0.12 follow-ups: completion waits for missing modules, build.mcpp autosave drops the targets' flags, Windows warm starts rebuild modules, the mcpp version is lost #52 item 3; ci/module_resilience_canary.py.
    • Removal/drop: drop when upstream logs the same at its default level.
  26. Sunrisepeak commented on Oct 23, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-X1 · xmake: a GCC module mapper file is shared by every build of the same relative source path

    • Symptom: with GCC, xmake writes each unit's -fmodule-mapper file to $(tmpdir)/.xmake<uid>/<yymmdd>/<hash>/<file>.mapper.txt, and the hash comes from the source's relative path alone: module/data.cppm gets the same directory in two unrelated projects (3c73bc68… on two machines). The file's content is not a function of that path: it names the project (root <dir>) and each imported module's BMI under the build directory and mode. Another build of the same relative path overwrites it, and an incremental build that does not rebuild the module interfaces reads the overwritten file: error: failed to read compiled module: No such file or directory, with a BMI path of the other build. Running xmake again rebuilds the interfaces, rewrites the file and succeeds.
    • Reproduced (xmake 3.1.1 and 3.1.2, GCC 16.1, Linux; a module library with partitions, an implementation unit, import std):
      1. The project described with a second build directory (xmake f --builddir=<other>, then xmake project -k compile_commands), then an incremental build in its own build directory: fails, naming a BMI under <other> that was never built. This is what mcppls's private run did (Xmake fails to build after mcppls cleans its cache #69).
      2. Two copies of one project at different paths (two git worktrees, say) built in turn the same day; the second copy deleted; an incremental build of the first: fails, naming the deleted copy's BMI. Several of the first copy's mapper files still name the second's BMIs after its own successful build.
      • Not affected: debug and release of one project built in turn.
    • Not established: whether a build can compile against another copy's BMI without an error while that copy still exists.
    • Upstream: unfiled.
    • mcppls: 0.0.16 triggers it (Xmake fails to build after mcppls cleans its cache #69). Planned for 0.0.17: the private xmake run gets XMAKE_TMPDIR=<its own directory>/tmp, so it no longer writes the mapper files the user's builds read. A user's own two-checkout case is not mcppls's to change.
    • Remove when: xmake keys the mapper file by project and build directory (or writes it on every compile that uses it).
    • Evidence: Xmake fails to build after mcppls cleans its cache #69's diagnostic bundle and screenshot (the BMI hash 8cd20c490f207114 it names is the one the local reproduction produces).
  27. Sunrisepeak commented on Oct 23, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-X2 · xmake: xmake project -k compile_commands relies on a module scan cache that only a build updates

    • Symptom: the C++ modules scanner keeps, per target, the sum of its module sources in .xmake/<plat>/<arch>/cache/cxxmodules; when the sum is unchanged it skips the scan and reads each unit's dependfile from <builddir>/.deps. xmake project -k compile_commands reads that cache but does not save it when a target is added; only a build does. In a project described but not built since a target was added, once a dependfile is gone every xmake project -k compile_commands fails: error: target(json): dependfile for '…/bits/std.compat.cc' not found at 'build/.deps/…/std.compat.cc.d'. xmake f -c does not recover it; a build does.
    • Reproduced (pure xmake, default layout, 3.1.1 and 3.1.2): xmake f; xmake project -k compile_commands; add a target that depends on the module library; xmake project -k compile_commands (succeeds, cache still without the new target); rm -rf build; xmake project -k compile_commands fails, also after xmake f -c; xmake succeeds and repairs it. With a build between adding the target and removing build/, nothing fails. 3.1.1 also fails on xmake f -m release after the target is added (3.1.2 does not).
    • Who meets it: tools that describe a project without building it (language servers, static-analysis jobs). A building user only when describing before the first build after removing build/.
    • Not established: what removed the dependfiles in Can't locate third-party includes after reopening the xmake project #68's private directory (a mode switch on xmake 3.1.1 would; the reporter's version is not in the bundle).
    • Upstream: unfiled.
    • mcppls: 0.0.16 keeps one private xmake state across sessions and configures it again in place; once it is in this state every session fails and falls back to inferring the project, without the packages' include paths (Can't locate third-party includes after reopening the xmake project #68). Planned for 0.0.17: the private state is a cache keyed by the xmake version and the configuration, discarded and made again once on this error, and cleared with the workspace cache.
    • Remove when: xmake project scans again when a dependfile is missing, or saves the cache it changed.
    • Evidence: Can't locate third-party includes after reopening the xmake project #68's and Xmake fails to build after mcppls cleans its cache #69's diagnostic bundles (every owner session fails, every guest session in a fresh private directory succeeds).
  28. Sunrisepeak commented on Oct 23, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-L1 · tinyhttps 0.3: a response header line over 8 KB fails the request

    • Symptom: tinyhttps (mcpplibs, used by mcppls's packaging only: modules/pack, mcppls-devtools payload) caps one header line at max_line_length = 8192 (src/http.cppm, 0.3.1 and 0.3.5) and fails the whole request past it: Incomplete headers: line exceeds 8192 bytes without a CRLF. Since about 2026-10-23, GitHub's 302 answer to a release download (github.com/<owner>/<repo>/releases/download/<tag>/<file>) carries a 9243-byte content-security-policy line, so every GitHub release asset fails to download.
    • Affected: the 0.0.17 Release run 40022574908: every payload job failed to fetch the engine archive. PR CI did not see it, its payload cache already held the archives. The server makes no HTTPS downloads and is not affected.
    • Upstream: unfiled (mcpplibs/tinyhttps): a longer line limit, or one the caller can set.
    • mcppls: fix(pack): fetch a GitHub release asset with curl when tinyhttps cannot read GitHub's long header line #70 (0.0.17): on this one error pack::fetch downloads the file with curl and verifies it against the lock as before (sha256, size).
    • Remove when: the pinned tinyhttps reads header lines of GitHub's length.
  29. Sunrisepeak commented on Nov 26, 2026

    @Sunrisepeak
    OwnerAuthor

    UP-42 — module builds fail on MS-style inline assembly when the target's MC is not registered (clangd / LLVM)

    Problem clang parses MS-style __asm { } with the target's MC and assembly parser. clangd registers only the target infos, so clang reports err_msasm_unable_to_create_target ("MS-style inline assembly is not available: target MC unavailable") and goes on with an empty statement. The editor path filters it (Diagnostics.cpp isExcluded); a module build cannot: PCHGenerator writes no module interface when the engine's error flag is set (set before any consumer sees the diagnostic; an error cannot be remapped to a lesser severity). A module including <Windows.h> for a 32-bit Windows target (winnt.h's Int64ShllMod32 family) did not build, nor did its importers.
    Upstream unfiled; stock clangd's in-process module builder has the same gate ("Failed to compile ..." on the same input), so probably an upstream defect
    mcppls engine patch 0049 (mcppls-clangd 0.0.24, 23.1.0-mcppls.13): link X86Desc + X86AsmParser and register them in clangdMain, not on arm64 (the arm64 ok image that linked them ended by SIGBUS in its first thread; cause not found, openkal-musl/okrun suspected) — mcpp-language-server #100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions