Skip to content

v24.x: "Fatal process out of memory: Zone" crash in V8 turboshaft WASM compilation (WasmLoweringReducer) #63421

Closed as not planned

Description

@chrischjh

Version

v24.13.1, v24.14.1, v24.15.0 confirmed affected. v22.x LTS works fine.

Platform

macOS arm64 (Darwin 25.3.0, Apple Silicon M1) and Linux x64. Not architecture-specific.

Subsystem

V8 turboshaft WASM compiler — specifically WasmLoweringReducer during tree-sitter grammar compilation.

Severity

100% reproducible. Crashes the entire Node.js process with no JS-level error handling possible.

What steps will reproduce the bug?

  1. Install Node.js v24.x
  2. Install a package that uses tree-sitter WASM grammars (e.g. npm install -g @colbymchenry/codegraph)
  3. Run against a medium-sized project (500+ source files):
cd /path/to/any-project
codegraph init   # or codegraph index if already initialized

The crash occurs consistently at 12-14% parsing progress, when V8's turboshaft pipeline compiles the tree-sitter WASM grammars for Swift/TypeScript/Python/etc.

How often does it reproduce? Is there a required condition?

100% of runs. No special conditions — any project with enough diverse file types to trigger multiple tree-sitter WASM grammar compilations will hit it.

The number of files seems to matter: small projects (< ~50 files) may succeed because fewer grammars are loaded. Medium-to-large projects (500+ files, 5+ languages) crash every time at parse phase.

What is the expected behavior? Why is that wrong?

The Node.js process should complete normally. Instead it crashes with a native-level OOM in V8's Zone allocator, which is unrecoverable from JS land.

What do you see instead?

#
# Fatal process out of memory: Zone
#
----- Native stack trace -----

 1: node::NodePlatform::GetStackTracePrinter()::$_0::__invoke()
 2: v8::base::FatalOOM(v8::base::OOMType, char const*)
 3: v8::internal::V8::FatalProcessOutOfMemory(...)
 4: v8::internal::Zone::Expand(unsigned long)
 5: v8::internal::compiler::turboshaft::SnapshotTable::MergePredecessors<...WasmLoweringReducer...>::Bind(...)
 6: v8::internal::compiler::turboshaft::VariableReducer<...WasmLoweringReducer...>::Bind(Block*)
 7: v8::internal::compiler::turboshaft::GraphVisitor<...WasmLoweringReducer...>::VisitBlock<false>(Block const*)
 8: v8::internal::compiler::turboshaft::GraphVisitor<...>::VisitAllBlocks<false>()
 9: v8::internal::compiler::turboshaft::CopyingPhaseImpl<WasmLoweringReducer, MachineOptimizationReducer>::Run(...)
10: v8::internal::compiler::turboshaft::Pipeline::Run<WasmLoweringPhase>()
11: v8::internal::compiler::Pipeline::GenerateWasmCode(...)
12: v8::internal::compiler::turboshaft::ExecuteTurboshaftWasmCompilation(...)
13: v8::internal::wasm::WasmCompilationUnit::ExecuteCompilation(...)
14: v8::internal::wasm::ExecuteCompilationUnits(...)
15: v8::internal::wasm::BackgroundCompileJob::Run(JobDelegate*)
16: v8::platform::DefaultJobWorker::Run()
17: node::PlatformWorkerThread(void*)
18: _pthread_start

Abort trap: 6

Additional information

  • Not a JS heap OOM: --max-old-space-size has no effect — this is V8's internal Zone memory, not the managed heap.
  • Already tracked downstream: # Fatal process out of memory: Zone colbymchenry/codegraph#140 (multiple users confirmed, codegraph added a hard-exit guard for Node 25.x but v24.x is also affected and not yet guarded).
  • Node 22 LTS unaffected: v22.22.0 works correctly with the same workload and same WASM grammars.
  • Likely regression: The Zone allocator in turboshaft's WASM pipeline appears to have a size calculation or growth bug triggered by the size/number of tree-sitter WASM modules.

Stack traces from three separate runs (v24.13.1, v24.15.0, different memory limits) are identical — the crash point is deterministic.

Activity

  1. 3zrv commented on May 19, 2026

    @3zrv
    Contributor

    Have you tried running with --liftoff-only? The trace says the crash happens in code that --liftoff-only prevents from ever running, on frame 12 ExecuteTurboshaftWasmCompilation is the entry point to the optimizing tier. Everything above it (the actual crashing code) only runs because something below it decided this function deserved tier-up
    @chrischjh

  2. chrischjh commented on May 21, 2026

    @chrischjh
    Author

    Confirmed: --liftoff-only avoids the crash on v24.15.0 (macOS arm64).

    So the regression is specifically in turboshaft's WASM compilation path (WasmLoweringReducer → Zone::Expand), not in Liftoff.

    Since this works on v22 LTS (same WASM workload, same grammars) but crashes deterministically on v24.x, it could be a V8 turboshaft regression introduced between v22 and v24. The Zone allocator in turboshaft's WASM pipeline appears to miscalculate the buffer size needed for the CFG snapshot table when handling multiple large WASM modules.

  3. 3zrv commented on May 22, 2026

    @3zrv
    Contributor

    If that timeline is right, the v22 -> v24 "regression" isn't just a small bug seeded into already stable code. the entire optimizing WASM backend was swapped from turbofan to turboshaft between those releases. That might explain what you've observed: v22 uses Turbofan's WASM pipeline (handles these grammars fine), v24 uses Turboshaft's (WasmLoweringReducer + SnapshotTable merge OOMs), and --liftoff-only dodges both by never tiering up.

    I'd say close it here and try with the team on V8

    @chrischjh

  4. added
    v8 engine
    wasm
    on May 30, 2026
  5. github-actions commented on Aug 28, 2026

    @github-actions
    Contributor

    This issue has been marked as stale due to 90 days of inactivity.
    It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

  6. added
    stale
    on Aug 28, 2026
  7. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
    If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.

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

    stalev8 enginewasm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions