-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't workingdogfoodFound during dogfoodingFound during dogfooding
Description
Found during dogfooding v3.1.2
Severity: Low
Command: node scripts/benchmark.js
Reproduction
node scripts/benchmark.js
# Run sequence: WASM full build → 3x no-op → 1-file rebuild #1 → #2 → SEGFAULT on #3Expected behavior
WASM engine should survive repeated incremental builds in the same process without crashing.
Actual behavior
After 6+ WASM builds in the same Node.js process (1 full + 3 no-op + 2 one-file), the 3rd one-file rebuild segfaults (exit code 139). The incremental benchmark script (incremental-benchmark.js) runs the same pattern but survives — suggesting memory pressure or accumulated state in tree-sitter WASM is the trigger.
Root cause
Likely tree-sitter WASM memory accumulation across repeated parser invocations in the same process. The build benchmark runs more operations before reaching the 1-file phase (full build + queries + no-op) compared to the incremental benchmark, which may push WASM memory past the threshold.
Environment
- Platform: Windows 11 Pro, win32-x64, Node v22.18.0
- tree-sitter-wasms: as of v3.1.2
Suggested fix
- Investigate if tree-sitter WASM parsers are properly disposed between builds
- Consider calling
parser.delete()on WASM parsers after each build cycle - Or run WASM benchmarks in a child process to isolate memory
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdogfoodFound during dogfoodingFound during dogfooding