Recurring SIGILL/segfault in JSC GC (CodeBlockSet::clearCurrentlyExecutingAndRemoveDeadCodeBlocks) — bun 1.3.14
Summary
Claude Code crashes recurrently with a null-pointer segfault inside JavaScriptCore's garbage collector (bundled bun 1.3.14). The crash happens both mid-session and on claude --resume. Bun's crash handler catches the SIGSEGV, prints the bun.report URL, then finalizes with ud2, so the OS records it as SIGILL.
Decoded crash (from bun.report)
Crash reason: Segmentation fault at address 0x00000000
Runtime: Bun v1.3.14 on linux x86_64_baseline [StandaloneExecutable]
#0 JSC::CodeBlockSet::clearCurrentlyExecutingAndRemoveDeadCodeBlocks() CodeBlockSet.cpp:56
#1 JSC::Heap::runEndPhase() Heap.cpp:1763
#2 JSC::Heap::runCurrentPhase() Heap.cpp:1441
#3 JSC::Heap::collectInMutatorThread() Heap.cpp:2073
#4 JSC::Heap::stopIfNecessarySlow() Heap.cpp:2054
The fault is in the concurrent GC path. Some cores show the same finalizer trap on the HeapHelper (GC collector) thread instead of the main thread.
Environment
- Claude Code: 2.1.168
- Bundled bun: 1.3.14 (x86_64_baseline, StandaloneExecutable)
- OS: Ubuntu 24.04, kernel 6.8.0-124-generic
- CPU: AMD Ryzen 5 5600X (AVX2/FMA present — not a baseline/ISA issue)
- Install:
~/.local/lib/node_modules/@anthropic-ai/claude-code
Frequency
Recurring across many releases (2.1.101 → 2.1.168) over ~7 weeks — dozens of coredumps, every one SIGILL at the same finalizer address (0x2b05212, the ud2 after bun resets fatal signal handlers). Deterministic crash site; timing-dependent trigger (GC race), more likely on long/large sessions.
Workaround
export BUN_JSC_useConcurrentGC=0 (disables the concurrent collector that faults).
Ask
Looks like an upstream JSC GC bug in bun 1.3.14 (CodeBlockSet::clearCurrentlyExecutingAndRemoveDeadCodeBlocks during Heap::runEndPhase). Could a future Claude Code bundle a bun with this fixed, or set the concurrent-GC workaround by default on Linux?
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗