[bug] codebase extract aborts on Node 24 with 'Fatal process out of memory: Zone' when parsing Swift
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
- Tech stack
- node.js, swift, typescript
- 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
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
.swiftfile 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.tsis not the cause: the crash reproduces without compiling any query.
Reproduction
nvm use 24 && npm ci && npm run build- 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 node <teamai-cli>/dist/index.js codebase --extract→ printscomplete, 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:
mainat 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Tencent/teamai-cli
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Tencent/teamai-cli#893 ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 65/100
Tencent/teamai-cli#894 · 1 comment ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 3/5 1-2 days Newbie friendliness 74/100
Tencent/teamai-cli#892 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Tencent/teamai-cli#884 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Tencent/teamai-cli#883 ·
Maintainers usually reply within 1 day
All issues in Tencent/teamai-cli
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
supabase/agent-skills#611 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
polka-codes/test#345 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
GoogleChromeLabs/project-sesame#217 ·
Maintainers usually reply within 12 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
solana-foundation/solana-com#2202 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100