Summary
home test test/js/node/async_hooks aborts with SIGSEGV → abort (exit 134). Distinct from #78 (which is a BoringSSL TLS cert UAF) — this crash is inside mimalloc's thread-local heap lookup.
Repro
cd /tmp/bun-pinned
home-release-safe test test/js/node/async_hooks # → exit 134Faulting backtrace (macOS crash report)
libsystem_c.dylib abort
home-release-safe debug.handleSegfault (SIGSEGV handler)
home-release-safe _mi_heap_theap_peek(mi_heap_s const*)
home-release-safe _mi_heap_theap_get_or_init(mi_heap_s const*)
home-release-safe _mi_heap_theap_peek(mi_heap_s const*)
home-release-safe _mi_heap_theap_get_or_init(mi_heap_s const*)
home-release-safe _mi_heap_theap(mi_heap_s const*)
...Analysis
- The crash is in mimalloc's per-thread heap resolution (
_mi_heap_theap*), which segfaults on a corrupted/invalidmi_heap_t*— the signature of a cross-thread free or a thread-teardown race (freeing/allocating on a thread whose mimalloc heap was already destroyed, or a stale heap pointer). - async_hooks exercises workers / threads / async contexts; the visible failing test is
async context passes through > Bun.build plugin(the bundler running in an async/worker context). - Accumulation-dependent, culprit ≠ victim: no single
async_hooks/*.test.*file crashes when run alone; only the full-directory run aborts.
Notes
- Confirmed with
home-release-safe(ReleaseSafe), so not a debug artifact. - Like #78, root-causing needs an ASan build; guard-page mimalloc won't help a cross-thread/UAF (it faults at the victim access, not the corrupting write).