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
git checkout archive
git checkout main --force # force might be needed on MacOS due to case-insensitive FS
git checkout 8c27dbd160a4fb1fe38673299ffd3e470c4088fe
Then cd into ./ui and run bunx --bun astro build
Relevant log output
============================================================
Bun v1.3.11 (af24e281) macOS Silicon
macOS v26.4
CPU: fp aes crc32 atomics
Args: "node""/Users/illright/work/ibood-archive/node_modules/.bin/astro""build"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(2) jsc spawn(3) transpiler_cache(2) tsconfig(2) process_dlopen(3)
Builtins: "bun:main""node:assert""node:async_hooks""node:buffer""node:child_process""node:crypto""node:dns""node:events""node:fs""node:fs/promises""node:http""node:https""node:module""node:net""node:os""node:path""node:path/posix""node:perf_hooks""node:process""node:querystring""node:readline""node:stream""node:tls""node:tty""node:url""node:util""node:zlib""node:worker_threads""ws""node:v8""node:http2"
Elapsed: 50261ms | User: 47835ms | Sys: 6124ms
RSS: 4.91GB | Peak: 4.91GB | Commit: 2.47GB | Faults: 5895 | Machine: 17.18GB
panic(main thread): Segmentation fault at address 0x16A93BFF0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,please file a GitHub issue using the link below: https://bun.report/1.3.11/Mn1af24e28ijEugogC____________________A2Cg//uyqD
Stack Trace (bun.report)
Bun v1.3.11 (af24e28) on macos aarch64 [AutoCommand]
Actually, I'm not sure if it's the YAML parser this time — I opened this issue to bring attention to an earlier comment of mine that slipped through the cracks, but this actually looks like a different segfault
Reproduced at 8c27dbd160a4fb1fe38673299ffd3e470c4088fe — but this turns out to be an upstream bug in the es-git native module, not in Bun. Node.js v24.3.0 crashes identically.
What's actually happening
The crash is a stack overflow during process teardown, inside es-git's napi finalizer — not in Bun.YAML.parse. (That lines up with the fault address 0x16A93BFF0, which is the darwin-arm64 main-thread stack guard page, and with the crash happening after "Complete!".)
Your ui/src/content.config.ts does this for every file in every commit on the archive branch:
With ~180 commits × ~5,000 files that creates ~830k Blob objects. When the process exits and the runtime calls es-git's napi finalizer once, the Rust drop implementation for these objects recurses ~260,000 frames deep and overflows the 8 MB main-thread stack.
Bun.YAML.parse is fine
Stress-tested the real product YAML standalone — 800k parses, RSS flat at ~150 MB, no crash.
Minimal reproduction — no Astro, no YAML, no Bun APIs
Bun/Node call the napi finalizer once; everything above that is the .node library shipped by es-git@0.4.0 recursing into itself via napi-rs SharedReference drop closures.
Workaround
Break out of the synchronous tree().walk() periodically so GC can run finalizers before hundreds of thousands pile up — e.g. collect entry ids inside the walk and read blob contents in an async loop with an occasional await 0, or run Bun.gc(true) / global.gc() between commits. Alternatively read file contents via a path that doesn't create a SharedReference per blob.
Upstream
This should be filed against https://github.com/toss/es-git (and/or napi-rs — the recursive FnOnce drop chain is a napi-rs SharedReference pattern). Closing here since there's nothing to change on the Bun side.
Indeed, I added some commits temporarily to move away from Bun's YAML implementation, it is still available in commit 8c27dbd160a4fb1fe38673299ffd3e470c4088fe (updated the repro instructions)
Activity
illright commentedon Apr 6, 2026
Actually, I'm not sure if it's the YAML parser this time — I opened this issue to bring attention to an earlier comment of mine that slipped through the cracks, but this actually looks like a different segfault
github-actions commentedon Apr 6, 2026
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
robobun commentedon Apr 6, 2026
Reproduced at
8c27dbd160a4fb1fe38673299ffd3e470c4088fe— but this turns out to be an upstream bug in thees-gitnative module, not in Bun. Node.js v24.3.0 crashes identically.What's actually happening
The crash is a stack overflow during process teardown, inside
es-git's napi finalizer — not inBun.YAML.parse. (That lines up with the fault address0x16A93BFF0, which is the darwin-arm64 main-thread stack guard page, and with the crash happening after "Complete!".)Your
ui/src/content.config.tsdoes this for every file in every commit on thearchivebranch:With ~180 commits × ~5,000 files that creates ~830k
Blobobjects. When the process exits and the runtime callses-git's napi finalizer once, the Rust drop implementation for these objects recurses ~260,000 frames deep and overflows the 8 MB main-thread stack.Bun.YAML.parseis fineStress-tested the real product YAML standalone — 800k parses, RSS flat at ~150 MB, no crash.
Minimal reproduction — no Astro, no YAML, no Bun APIs
gdb backtrace (same shape in both runtimes)
Bun — 256k recursive frames inside
es-git.linux-x64-gnu.nodeNode.js v24.3.0 — identical
Bun/Node call the napi finalizer once; everything above that is the
.nodelibrary shipped byes-git@0.4.0recursing into itself via napi-rsSharedReferencedrop closures.Workaround
Break out of the synchronous
tree().walk()periodically so GC can run finalizers before hundreds of thousands pile up — e.g. collect entry ids inside the walk and read blob contents in an async loop with an occasionalawait 0, or runBun.gc(true)/global.gc()between commits. Alternatively read file contents via a path that doesn't create aSharedReferenceper blob.Upstream
This should be filed against https://github.com/toss/es-git (and/or napi-rs — the recursive
FnOncedrop chain is a napi-rsSharedReferencepattern). Closing here since there's nothing to change on the Bun side.illright commentedon Apr 6, 2026
Indeed, I added some commits temporarily to move away from Bun's YAML implementation, it is still available in commit
8c27dbd160a4fb1fe38673299ffd3e470c4088fe(updated the repro instructions)Jarred-Sumner commentedon Apr 11, 2026
@robobun try with 8c27dbd160a4fb1fe38673299ffd3e470c4088fe