Skip to content

Relaunch wrapper hides a signal-killed indexer: OOM on vscode exits 1 with no message #21

Open

Description

@inth3shadows

Summary

When the WASM relaunch child is killed by a signal, codegraph exits 1 and prints nothing. On a large repo, an out-of-memory kill looks like an ordinary failure with no message.

dist/extraction/wasm-runtime-flags.js, relaunchWithWasmRuntimeFlagsIfNeeded:

const result = spawnSync(process.execPath, argv, { stdio: 'inherit', ... });
if (result.error) { return; }
process.exit(result.status ?? (result.signal ? 1 : 0));

result.signal (SIGKILL here) is dropped: no message, and an exit code of 1 instead of 128 + signal number.

Repro

  • Builds: f72c9d2 and v1.6.2-em.35 (a076624), CODEGRAPH_KERNEL=0, Node 22.23.2, Linux (WSL2).
  • Repo: microsoft/vscode at ca43fc94a6cc0a20cb4deefc90e63693d15063e8 (full checkout, not just src).
  • Run under a memory limit below about 6 GB. Observed under a systemd scope with memory.max = 6 GiB; systemd-run --user --scope -p MemoryMax=6G codegraph init -y should reproduce it (not run as such).

Output:

Scanning files...
Parsing code...
Resolving refs...

then exit status 1, nothing on stderr (both builds; 3:21–3:43 wall).

What actually happened

node --trace-exit shows the parent exiting from the relaunch wrapper, and the child never reaches a JS exit:

WARNING: Exited the environment with code 1
    at exit (node:internal/process/per_thread:245:13)
    at relaunchWithWasmRuntimeFlagsIfNeeded (dist/extraction/wasm-runtime-flags.js:41:13)
    at dist/bin/codegraph.js:100:63

The kernel log shows the child killed by the cgroup OOM killer during ref resolution:

Memory cgroup out of memory: Killed process 577546 (node) total-vm:20043724kB, anon-rss:5807024kB

(cgroup memory.max = 6 GiB.)

Expected

  • Report the signal, e.g. codegraph: indexer killed by SIGKILL (out of memory?), and exit 128 + signal number (137 for SIGKILL), as a shell would.
  • Optionally: note peak memory. Ref resolution on vscode needs more than 5.8 GB RSS with the WASM path.

Notes

  • Not related to the TS grammar: f72c9d2 and em.35 behave the same.
  • Found by codegraph-qa's build-vs-build graph diff on its corpus v2 regression split (effect, vscode).

Activity

  1. inth3shadows commented on Nov 12, 2026

    @inth3shadows
    OwnerAuthor

    Filed upstream as colbymchenry#3277 (2026-11-11), with a deterministic repro on f72c9d2: honojs/hono under a 400 MB cgroup cap with OOMPolicy=continue exits 1 silently, while CODEGRAPH_NO_RELAUNCH=1 exits 137.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions