You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: V8 fatal 'jit_page_->allocations_' crash in sandbox tests on Windows Node 24 CI #708
main @ 94d8429 (release: v0.6.1), GitHub Actions windows-latest, Node 24, ci / verify (windows-latest, 24, 1) in Publish release run 36078611503.
Minimal reproduction
Not reproducible on demand. test/sandbox.test.ts aborted the Node process mid-file:
# Fatal error in , line 0
# Check failed: jit_page_->allocations_.erase(addr) == 1.
2: V8_Fatal
3: v8::internal::ThreadIsolation::UnregisterJitAllocationForTesting
Expected: the sandbox tests pass (they did on Windows Node 22 and 26 and on every Linux/macOS job in the same run). Actual: V8 hard-crashes the test process, which fails the release's CI gate before publish.
Relevant output
A V8 internal assertion in JIT page bookkeeping, not a URLCode assertion. It appears to be a Node 24 / V8 bug on Windows, triggered by the sandbox's QuickJS/WASM worker churn. Unverified: whether it recurs, and whether an upstream Node issue already exists. The failed job was re-run to complete v0.6.1.
Options: find/track the upstream Node issue; retry the sandbox test file once on this specific fatal signature in CI; or pin the Windows Node 24 leg to a patched Node release once one exists. Do not weaken the sandbox tests themselves.
Related observation, different signature, recorded so it is not lost: during the extension architecture refactor, one npm run verify run in packages/auth crashed a worker with a V8 fatal error (Check failed: !is_null() in Builtin_CallAsyncModuleFulfilled, Node 26.8.2, macOS) in test/auth-core.test.ts, right after the 'configuration revision chains' test, apparently while the auth store's worker thread was being terminated. It did not reproduce in 12 isolated runs of that file or in 5 later full runs. Unverified whether this shares a cause with the Windows sandbox crash here.
Recurred once more (second sighting): same V8_Fatal … Builtin_CallAsyncModuleFulfilled on Node 26.8.2 macOS, this time in packages/auth/test/recovery-drill.test.ts during a full npm run verify, again with no assertion failure; that file then passed 5 consecutive isolated runs and the next full verify passed. Still unverified whether it shares a cause with the Windows crash above.
macOS signature (!is_null() in Builtin_CallAsyncModuleFulfilled): this matches a known family of crashes where a worker is terminated during async module evaluation (top-level await):
In current V8 main, AsyncModuleExecutionFulfilled (src/objects/source-text-module.cc) still has ToHandleChecked() calls (≈1083/1133/1151), and that is exactly CHECK(!is_null()).
URLCode code with the matching race (verified that the pattern exists; not verified that it causes the crash)
Config worker:packages/core/src/config-worker.ts:8 posts its result from inside a top-level await, and config.ts:18 also uses top-level await. loadDocument (config.ts:401–415) then terminate()s as soon as the message arrives, which is while the module's async evaluation, ending in CallAsyncModuleFulfilled, may still be settling. This happens on every config load, in tests and in production.
Sandbox pool:function-worker.ts:12 compiles QuickJS WASM under a top-level await. In functions.ts, terminates happen on deadline (:191), init failure/timeout (:129), respawn (:167–177) and close() (:213). close() can terminate a respawn still inside getQuickJS(). test/sandbox.test.ts:93–117 drives 8 deadline terminates while respawns compile the same WASM module concurrently. This plausibly fits the Windows JIT-page race (speculative).
Auth store worker: a (regex-based) scan found no top-level await in its import graph, so the "while the auth store worker was terminated" attribution is probably another thread. Candidates are the config worker and packages/auth/scripts/recovery-drill.mjs:79 (top-level await; closes two stores before it settles).
Options, ranked
Stop terminating workers during module evaluation. This is a robustness fix, not a test change. On success, let the config worker finish and exit and await 'exit' (or remove its top-level await), keeping terminate() for deadline and error paths. Make FunctionPool.close() await in-flight spawns. Guest-deadline terminates stay.
Gather evidence: capture the thread and native stack per sighting; stress-loop loadDocument and pool start/close on Node 26.8.2 macOS and deadline churn on Windows Node 24; file a minimal nodejs/node report if one reproduces.
Pin Node versions: not possible yet (no upstream fix).
CI retry on these exact signatures: a last resort and a policy decision; it would hide a crash that production paths can also hit.
Recurred after #761's worker-teardown fix: identical signature (Check failed: jit_page_->allocations_.erase(addr) == 1, V8_Fatal → ThreadIsolation::UnregisterJitAllocationForTesting) in test/sandbox.test.ts on verify (windows-latest, 24, 2), release PR #799 (v0.6.4, head 6d61f0a3), run https://github.com/jimhoyd-com/urlcode/actions/runs/36268481263/job/108477798650. Every sandbox test in the file had passed (the last was 'runtime-constructed imports cannot read another route module outside the declared graph') before V8 aborted the process; the other 28 checks passed. So #761 did not remove the Windows Node 24 trigger; still no upstream fix found. Failed job re-run to unblock the release. Reopening so the remaining options (a minimal nodejs/node report, or the owner's call on a signature-scoped CI retry) are not lost.
Confirmed recurrence during the full-matrix validation of PR #819 at 9e110600 (the change only touches packages/auth/test/headless-auth-profile-recipe.test.ts). Windows Node 24 core shard 3 failed in test/sandbox.test.ts with the same fatal signature:
The immediately preceding reported test was runtime-constructed imports cannot read another route module outside the declared graph. This confirms recurrence, not a deterministic reproducer or an upstream cause. The original release run 36332281231 passed its core jobs and failed only Windows auth path handling; that auth fix remains separate. No sandbox code or checks have been changed or disabled.
Reopened: #827 closed this automatically, but the crash is not fixed. #827 added reproducers (scripts/repro/) and a manual workflow (.github/workflows/v8-jit-repro.yml, dispatch only). The next step is to run it on Windows and file the upstream nodejs/node report with the observed frequency:
First reproducer run: not reproduced.Run 36358219504 ran on windows-latest with Node 22, 24 and 26, 10 runs of each reproducer:
Reproducer
Node 22
Node 24
Node 26
wasm-churn (standalone, no URLCode)
0/10
0/10
0/10
pool-churn (real SandboxPool)
0/10
0/10
0/10
test/sandbox.test.ts
0/10
0/10
0/10
The cells count runs showing a V8 fatal error or the #708 signature, out of 10; there were also 0 failures and 0 timeouts. So 90 isolated runs on Node 24 did not crash, while CI has hit it about once per few full-suite runs.
Reading: the crash likely needs what a full npm test shard adds: many test files in one process run with --test-isolation=process and concurrency, load on the runner, and worker teardown at process exit after many other suites. Isolated churn alone isn't enough. The nodejs/node report stays unfiled, because it has no reproducer yet.
Possible next step: re-run with -f sandbox-test-args='--test-shard=3/3 test/*.test.ts' -f runs=20, which is the real failing shard. The workflow already accepts it.
The bug: V8 13.6 in Node 24.x double-frees a wasm-to-JS import wrapper when Runtime_TierUpWasmToJSWrapper races wasm code GC while worker threads that hold wasm instances are terminated. It aborts with exactly Check failed: jit_page_->allocations_.erase(addr) == 1 in ThreadIsolation::…UnregisterAllocation.
Upstream's reproduction: about 5% of processes on Linux with v24.21.0. It does not reproduce on v22.23.0 or v26.10.0.
It matches our evidence. All three sightings ran Node 24.21.0 on Windows, in test/sandbox.test.ts, after every subtest had passed (runs 36078611503, 36268481263 attempt 1, and 36333594243).
The sandbox pool runs quickjs-emscripten, which makes hot JS import calls, in workers it terminates and respawns.
There were none on Node 22/26, and none in the last 60 ci.yml runs (162 Windows 24 shard jobs). That puts the rate at about 1–2% of sandbox-shard jobs.
It also explains why run 36358219504 (90 isolated runs) didn't reproduce it: its churn workloads don't tier up import wrappers.
Workaround:--no-wasm-code-gc, as measured upstream: 0 CHECKs in 20 jobs, against 11 CHECKs and 5 SIGSEGVs in 40 without it. --no-memory-protection-keys does not help.
Next steps:
Dispatch v8-jit-repro with and without --no-wasm-code-gc.
Add the flag to test:shard until a 24.x release carries #66376. Sandbox isolation is unchanged: the flag only delays reclaiming unused wasm machine code.
Document the flag for Node 24 production deployments that use sandbox: true. The abort takes down the whole process, and guest deadlines, which trigger worker termination, can be reached from request input.
Repro result for the run without--no-wasm-code-gc (run 36585963695, windows-latest, Node 24, sandbox-test reproducer, which runs the whole node --test suite once per run):
9 full runs completed before the job hit its 3-hour limit and was cancelled; each run took 705–742 s.
None aborted: every run reported fatal=false signature=false, and none was a timeout.
Every run exited 1, but only for three pack-dependent tests: urlcode docs search works against the published npm tarball, every relative link in llms.txt resolves inside the published npm tarball, and packing with ignored scripts preserves built output…. The reproducer runs them without a packed tarball, so these failures are environmental and have nothing to do with the V8 abort.
So in this run the V8 wasm code-GC abort did not reproduce in 9 attempts. That fits an intermittent upstream bug (nodejs/node#66366); it doesn't show the bug is gone. The control run with the flag (36585969151) is still in progress. The test:shard workaround from #922 stays until the upstream backport (nodejs/node#66376) ships in a Node 24 release.
Control run with--no-wasm-code-gc (run 36585969151, windows-latest, Node 24, same sandbox-test reproducer):
9 full runs completed before the 3-hour job limit cancelled it; every one reported fatal=false signature=false timedOut=false.
Every run exited 1 on the same three pack-dependent tests as the run without the flag. Those fail because the reproducer has no packed tarball, so they are environmental.
Conclusion: neither arm reproduced the abort (0 of 9 without the flag, 0 of 9 with it). These runs can't show that the flag prevents the crash; they show only that the abort is rare on today's runner image with this suite. The evidence for the workaround is still the upstream diagnosis (nodejs/node#66366, where wasm code GC frees JIT pages a worker still references) and the fix in nodejs/node#66376.
Keeping this open with the test:shard workaround (#922) until a Node 24 release carries the backport. Then we'll drop --no-wasm-code-gc and close this. No further repro runs are planned; the 3-hour runs cost CI time without discriminating between the two arms.
Activity
jimhoyd commentedon Sep 25, 2026
Related observation, different signature, recorded so it is not lost: during the extension architecture refactor, one
npm run verifyrun in packages/auth crashed a worker with a V8 fatal error (Check failed: !is_null()inBuiltin_CallAsyncModuleFulfilled, Node 26.8.2, macOS) in test/auth-core.test.ts, right after the 'configuration revision chains' test, apparently while the auth store's worker thread was being terminated. It did not reproduce in 12 isolated runs of that file or in 5 later full runs. Unverified whether this shares a cause with the Windows sandbox crash here.jimhoyd commentedon Sep 25, 2026
Recurred once more (second sighting): same
V8_Fatal … Builtin_CallAsyncModuleFulfilledon Node 26.8.2 macOS, this time in packages/auth/test/recovery-drill.test.ts during a fullnpm run verify, again with no assertion failure; that file then passed 5 consecutive isolated runs and the next full verify passed. Still unverified whether it shares a cause with the Windows crash above.jimhoyd commentedon Sep 25, 2026
Investigation notes (no code changed). Where something is not verified, it says so.
Upstream
jit_page_->allocations_.erase(addr) == 1/ThreadIsolation): no upstream report or fix found; searches return only this issue. The nearest is Intermittent fatal CHECK in compiler/heap-refs on v24.x — request to backport V8 14.6's JSHeapBroker thread-safety fixes nodejs/node#66126 (open; V8 14.6 thread-safety backports for v24.x), which has a different signature. There is no Node 24.x release to pin to.!is_null()inBuiltin_CallAsyncModuleFulfilled): this matches a known family of crashes where a worker is terminated during async module evaluation (top-level await):process.exit()from a Worker that has TLA nodejs/node#43182, fixed by V8 "[module] Fix aborts in terminated async module evaluation" (2022, Node 18).main,AsyncModuleExecutionFulfilled(src/objects/source-text-module.cc) still hasToHandleChecked()calls (≈1083/1133/1151), and that is exactlyCHECK(!is_null()).URLCode code with the matching race (verified that the pattern exists; not verified that it causes the crash)
packages/core/src/config-worker.ts:8posts its result from inside a top-level await, andconfig.ts:18also uses top-level await.loadDocument(config.ts:401–415) thenterminate()s as soon as the message arrives, which is while the module's async evaluation, ending inCallAsyncModuleFulfilled, may still be settling. This happens on every config load, in tests and in production.function-worker.ts:12compiles QuickJS WASM under a top-level await. Infunctions.ts, terminates happen on deadline (:191), init failure/timeout (:129), respawn (:167–177) andclose()(:213).close()can terminate a respawn still insidegetQuickJS().test/sandbox.test.ts:93–117drives 8 deadline terminates while respawns compile the same WASM module concurrently. This plausibly fits the Windows JIT-page race (speculative).packages/auth/scripts/recovery-drill.mjs:79(top-level await; closes two stores before it settles).Options, ranked
'exit'(or remove its top-level await), keepingterminate()for deadline and error paths. MakeFunctionPool.close()await in-flight spawns. Guest-deadline terminates stay.loadDocumentand pool start/close on Node 26.8.2 macOS and deadline churn on Windows Node 24; file a minimal nodejs/node report if one reproduces.Generated by Claude Code
fix(core): don't terminate config or sandbox workers during module ev…
Contribution provenance, full schema descriptions, worker teardown, h…
jimhoyd commentedon Sep 26, 2026
Recurred after #761's worker-teardown fix: identical signature (
Check failed: jit_page_->allocations_.erase(addr) == 1,V8_Fatal→ThreadIsolation::UnregisterJitAllocationForTesting) intest/sandbox.test.tsonverify (windows-latest, 24, 2), release PR #799 (v0.6.4, head6d61f0a3), run https://github.com/jimhoyd-com/urlcode/actions/runs/36268481263/job/108477798650. Every sandbox test in the file had passed (the last was 'runtime-constructed imports cannot read another route module outside the declared graph') before V8 aborted the process; the other 28 checks passed. So #761 did not remove the Windows Node 24 trigger; still no upstream fix found. Failed job re-run to unblock the release. Reopening so the remaining options (a minimal nodejs/node report, or the owner's call on a signature-scoped CI retry) are not lost.Generated by Claude Code
jimhoyd commentedon Sep 27, 2026
Confirmed recurrence during the full-matrix validation of PR #819 at
9e110600(the change only touchespackages/auth/test/headless-auth-profile-recipe.test.ts). Windows Node 24 core shard 3 failed intest/sandbox.test.tswith the same fatal signature:Job: https://github.com/jimhoyd-com/urlcode/actions/runs/36333594243/job/108660125858
The immediately preceding reported test was
runtime-constructed imports cannot read another route module outside the declared graph. This confirms recurrence, not a deterministic reproducer or an upstream cause. The original release run 36332281231 passed its core jobs and failed only Windows auth path handling; that auth fix remains separate. No sandbox code or checks have been changed or disabled.jimhoyd commentedon Sep 27, 2026
Decision (owner, 2026-09-27): reproduce and report upstream. There will be no crash-masking retry in CI, so the crash stays visible.
Generated by Claude Code
Declarative JSON error format, extension field references, Windows ex…
jimhoyd commentedon Sep 27, 2026
Reopened: #827 closed this automatically, but the crash is not fixed. #827 added reproducers (
scripts/repro/) and a manual workflow (.github/workflows/v8-jit-repro.yml, dispatch only). The next step is to run it on Windows and file the upstream nodejs/node report with the observed frequency:Generated by Claude Code
jimhoyd commentedon Sep 27, 2026
First reproducer run: not reproduced. Run 36358219504 ran on
windows-latestwith Node 22, 24 and 26, 10 runs of each reproducer:wasm-churn(standalone, no URLCode)pool-churn(real SandboxPool)test/sandbox.test.tsThe cells count runs showing a V8 fatal error or the #708 signature, out of 10; there were also 0 failures and 0 timeouts. So 90 isolated runs on Node 24 did not crash, while CI has hit it about once per few full-suite runs.
Reading: the crash likely needs what a full
npm testshard adds: many test files in one process run with--test-isolation=processand concurrency, load on the runner, and worker teardown at process exit after many other suites. Isolated churn alone isn't enough. The nodejs/node report stays unfiled, because it has no reproducer yet.Possible next step: re-run with
-f sandbox-test-args='--test-shard=3/3 test/*.test.ts' -f runs=20, which is the real failing shard. The workflow already accepts it.Generated by Claude Code
jimhoyd commentedon Sep 29, 2026
Upstream cause found: nodejs/node#66366 (nodejs/node#66366).
Runtime_TierUpWasmToJSWrapperraces wasm code GC while worker threads that hold wasm instances are terminated. It aborts with exactlyCheck failed: jit_page_->allocations_.erase(addr) == 1inThreadIsolation::…UnregisterAllocation.It matches our evidence. All three sightings ran Node 24.21.0 on Windows, in
test/sandbox.test.ts, after every subtest had passed (runs 36078611503, 36268481263 attempt 1, and 36333594243).Workaround:
--no-wasm-code-gc, as measured upstream: 0 CHECKs in 20 jobs, against 11 CHECKs and 5 SIGSEGVs in 40 without it.--no-memory-protection-keysdoes not help.Next steps:
--no-wasm-code-gc.test:sharduntil a 24.x release carries #66376. Sandbox isolation is unchanged: the flag only delays reclaiming unused wasm machine code.sandbox: true. The abort takes down the whole process, and guest deadlines, which trigger worker termination, can be reached from request input.fix(ci): run test shards with --no-wasm-code-gc; document the Node 24…
jimhoyd commentedon Sep 29, 2026
Repro result for the run without
--no-wasm-code-gc(run 36585963695, windows-latest, Node 24,sandbox-testreproducer, which runs the wholenode --testsuite once per run):fatal=false signature=false, and none was a timeout.urlcode docs search works against the published npm tarball,every relative link in llms.txt resolves inside the published npm tarball, andpacking with ignored scripts preserves built output…. The reproducer runs them without a packed tarball, so these failures are environmental and have nothing to do with the V8 abort.So in this run the V8 wasm code-GC abort did not reproduce in 9 attempts. That fits an intermittent upstream bug (nodejs/node#66366); it doesn't show the bug is gone. The control run with the flag (36585969151) is still in progress. The
test:shardworkaround from #922 stays until the upstream backport (nodejs/node#66376) ships in a Node 24 release.jimhoyd commentedon Sep 29, 2026
Control run with
--no-wasm-code-gc(run 36585969151, windows-latest, Node 24, samesandbox-testreproducer):fatal=false signature=false timedOut=false.Conclusion: neither arm reproduced the abort (0 of 9 without the flag, 0 of 9 with it). These runs can't show that the flag prevents the crash; they show only that the abort is rare on today's runner image with this suite. The evidence for the workaround is still the upstream diagnosis (nodejs/node#66366, where wasm code GC frees JIT pages a worker still references) and the fix in nodejs/node#66376.
Keeping this open with the
test:shardworkaround (#922) until a Node 24 release carries the backport. Then we'll drop--no-wasm-code-gcand close this. No further repro runs are planned; the 3-hour runs cost CI time without discriminating between the two arms.