Skip to content

Work around the Node 24 V8 wasm abort in sandbox workers (#708) - #922

Merged
jimhoyd merged 1 commit into
mainfrom
claude/no-wasm-code-gc
Sep 29, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/no-wasm-code-gc

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Addresses #708. The cause is upstream: nodejs/node#66366. Node 24.x (V8 13.6) double-frees a wasm-to-JS import wrapper when worker threads holding wasm instances are terminated while wasm code GC runs, and aborts with Check failed: jit_page_->allocations_.erase(addr) == 1. The fix is the V8 backport in nodejs/node#66376, which is not yet released. All three of our sightings were Node 24.21.0 on Windows, in test/sandbox.test.ts; the sandbox pool terminates and respawns quickjs-emscripten workers.

Test runner: test:shard now runs node --no-wasm-code-gc …. Upstream measured this workaround at 0 CHECKs in 20 jobs, against 11 CHECKs and 5 SIGSEGVs in 40 without it. Sandbox limits are unchanged: the flag only delays reclaiming unused wasm machine code. V8 flags are process-wide, so worker threads get it too.

Docs: FUNCTION-SECURITY.md → "Verification and remaining risk" tells Node 24 operators serving sandbox: true to start with node --no-wasm-code-gc, or to run Node 22/26, until a 24.x release carries the fix. This matters because the abort takes down the whole process, and guest deadlines can be reached from request input.

Evidence:

  • test/sandbox.test.ts passes with the flag (Node 26, 13/13), and npm run check passes.
  • The CI matrix confirms the flag on Node 22 and 24.
  • Measurement dispatches of v8-jit-repro.yml with and without the flag are running (36585963695, 36585969151). At a base rate of about 1–2%, 30 runs each is weak evidence either way.

Remove the flag once setup-node's 24 resolves to a release containing nodejs/node#66376.

🤖 Generated with Claude Code

… V8 wasm abort for sandbox: true (#708)

Node 24.21.0's V8 double-frees a wasm-to-JS import wrapper when terminated
worker threads race wasm code GC (nodejs/node#66366), aborting the process. The
sandbox pool terminates QuickJS workers on guest deadlines. --no-wasm-code-gc is
the upstream-measured workaround until nodejs/node#66376 ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 29, 2026 14:54
@jimhoyd
jimhoyd merged commit 1c70733 into main Sep 29, 2026
24 checks passed
@jimhoyd
jimhoyd deleted the claude/no-wasm-code-gc branch September 29, 2026 15:00
jimhoyd added a commit that referenced this pull request Sep 29, 2026
…budget

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jimhoyd added a commit that referenced this pull request Sep 30, 2026
- Delete packages/ui/src/*.generated.ts: orphaned since the ui extension
  was deleted (#895) and accidentally re-added by #922; nothing imports it.
- package-files.ts: drop the `limits` parameters of hashPackageFiles and
  compareFiles (only the tarball reader removed in #1048 shared them) and
  unexport packageFileLimits, hashPackageFiles and compareFiles.
- Unexport 29 values used only inside their own non-public module.
- Fix stale comments naming the removed benchmark command and core's
  removed tarball reader.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant