Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[bug] codebase extract aborts on Node 24 with 'Fatal process out of memory: Zone' when parsing Swift

Closed
#860 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
cli, testing-qa

Research direction

Start with the extraction flow in ast/index.ts and parser-registry.ts, then run the listed Node 24 reproduction and src/tests/ast-extract-swift.test.ts. Check the interaction between Swift grammar parsing and Node 24's Wasm tier-up, keeping the query path in queries.ts separate because the issue reports it is not causal. Done means Swift extraction no longer aborts the process on Node 24 and the focused test completes.

Written by the indexing model from the issue text.

Description

bug

Description

teamai codebase --extract                     (also import / CI extract-mr)
└─ extractStructuralGraphAsFacts              ast/index.ts
   └─ ensureAstReady → Language.load(swift)   ast/parser-registry.ts   ok
   └─ parser.parse(<.swift file>)                                      ok
      └─ V8 background Wasm tier-up of the grammar (Turboshaft)
         └─ Fatal process out of memory: Zone   ✗ aborts the process
  • On Node 24, parsing any .swift file with a keyword in it (struct, class, func, import) aborts the CLI a moment later: SIGTRAP, exit 133, with RSS peaking at about 2.6 GB within a second. JS cannot catch it, so the heuristic fallback never runs.
  • Node 22 is fine (peak 480 MB). CI misses it because the matrix is Node 20 and 22.
  • This is a V8 bug in the optimizing Wasm tier (nodejs/node#63421, open, no fix). The Swift grammar from #842 triggers it on the first parse. The same tier also inflates the other grammars: parsing this repository's src/ on Node 24, the TypeScript grammar peaks at 1.4 GB, against 0.2 GB on Node 22.
  • The Swift query in queries.ts is not the cause: the crash reproduces without compiling any query.

Reproduction

  1. nvm use 24 && npm ci && npm run build
  2. Create a one-file Swift repo:
    mkdir -p /tmp/sw/Sources/App && cd /tmp/sw && git init -q
    printf 'import Foundation\nstruct Hello { func greet() -> String { "hi" } }\n' > Sources/App/App.swift
    git add . && git -c user.email=a@b -c user.name=t commit -qm init
    
  3. node <teamai-cli>/dist/index.js codebase --extract → prints complete, then aborts with exit 133.

In tests: npx vitest run --maxWorkers=1 src/__tests__/ast-extract-swift.test.ts on Node 24 fails with Error: Channel closed after the first test.

Environment

  • OS: macOS 26.5.2 (arm64)
  • Node.js: v24.21.0 (V8 13.6.233.17) affected; v22.23.3 (V8 12.4) not affected
  • teamai: main at a8ab8e00
  • Provider: n/a (local extract)
  • AI tool(s): n/a

Logs

Node 24, teamai codebase --extract on the repo above
  [AST: ast: 4 symbols, 1 imports (0 resolved), 0 calls (0 resolved), 1 edges]
[extract] sw complete
  ...
#
# Fatal process out of memory: Zone
#
----- Native stack trace -----
 4: v8::internal::Zone::Expand(unsigned long)
 9: v8::internal::compiler::turboshaft::CopyingPhaseImpl<WasmLoweringReducer, MachineOptimizationReducer>::Run(...)
11: v8::internal::compiler::Pipeline::GenerateWasmCode(...)
15: v8::internal::wasm::(anonymous namespace)::BackgroundCompileJob::Run(v8::JobDelegate*)
exit=133
Dominant language
TypeScript
Stars
5k
Forks
376
Avg merge
13h 21m
Merged PRs (30d)
288

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Tencent/teamai-cli

All issues in Tencent/teamai-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.