SIGBUS/SIGSEGV at native teardown during vite build on Linux x64 — starts with rolldown 1.2.8
What happened
Since upgrading to [email protected] (via [email protected], which ranges rolldown ~1.2.4), our vite build for a SvelteKit app crashes nondeterministically at ~10–20% per build on Linux x64 (GitHub Actions runners + Vercel build containers, node 24.x):
Bus error (core dumped)(SIGBUS, exit 135), orSegmentation fault (core dumped)(SIGSEGV, exit 139)
Both signals kill the vite build node process itself — not a child process.
Where it crashes
Always at native teardown boundaries, never mid-transform:
- Right after the client bundle finishes (
✓ built in …+[PLUGIN_TIMINGS]output), i.e. while the client bundler's worker threads tear down and the SSR bundler spins up, or - At the very end of the process — after the SvelteKit adapter +
@vercel/nfttracing fully completed, during process exit.
Why we bisected to 1.2.8
[email protected]was published to npm 2026-09-09 ~09:47 UTC; our first crash was 13:42 UTC the same day, ~30 min after the dep bump landed (11 native crashes since; zero SIGBUS/SIGSEGV in the prior ~6 weeks across all our projects, ~100+ builds).- Pinning
rolldownback to1.2.6under the same vite version stops it (in progress; will confirm). - Everything else native on the build path (swc, lightningcss, tailwindcss/oxide, esbuild, node, bun, @vercel/nft) was unchanged.
Suspect mechanism (inference, not proven)
In the 1.2.6→1.2.8 delta, mimalloc-safe 0.1.64→0.1.66 vendors mimalloc v3.3.2 → v3.5.1 and adds a patch that runs _mi_thread_done for the process-init thread (napi-rs/mimalloc-safe#97, fixing the v3.5.0 first-thread-teardown bug). Crashes at thread/process teardown boundaries + nondeterminism fit an allocator teardown race; this area had similar symptoms in #9785 / #10268 (worker_threads SIGSEGV). oxc_* 0.147→0.149 is also in the delta, but a parser bug would be deterministic per input.
Environment
[email protected]+[email protected],@sveltejs/adapter-vercel(SvelteKit),workflow/sveltekitplugin- node
24.20.0, bun1.4.2(install only; builds run under node/vite) - Linux x86_64 (glibc) — GH
warp-32x-x64runners and Vercel build containers - Core dumps may be captured as
coreon the runner; happy to share a backtrace if useful, though reproducing under gdb is hard at ~10%.
What would help
- Confirm whether 1.2.8's mimalloc bump or the
_mi_thread_donepatch is a plausible crash-at-exit vector on Linux (vs. an oxc change). - If a canary/next build without the mimalloc bump exists, we can run a batch of builds against it.
Workaround for others hitting this: pin rolldown to 1.2.6 under vite (npm/bun overrides).
Source: rolldown/rolldown