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
{{ message }}
Repository navigation
Segfault after ~24h idle on Windows 11 with sleep/wake cycles #28175
The crash likely relates to how Bun handles OS suspend/resume. Network connections, timers, or memory-mapped regions may become invalid after wake and aren't being recovered gracefully. The high page fault count and commit charge suggest memory pressure may compound the issue.
It is still present in v1.3.11. Each time the issue gets closed (often by a dedupe bot), but the underlying crash on Windows sleep/wake has never been addressed. This should be kept open until there's an actual fix.
A second crash instance with a different fault address and bun.report link was filed in #28176 (now closed as duplicate of this issue) — the crash data there may still be useful for diagnosis.
Another crash on the same machine. This one occurred after ~3 hours of active use (not idle/sleep-wake like the original report), suggesting the root cause isn't limited to suspend/resume.
Same high-address segfault pattern as the original two crashes (0x5CA6C010000, 0x44924010000). All three share KERNEL32.DLL/ntdll.dll in the stack. This is now the third instance on this machine across different session durations.
Are PRs #28230 (Windows bmalloc/GC crash fix) and #28026 (MimallocArena heap tag fix) related to this? Both touch Windows memory management paths that could explain the segfault pattern reported here. Happy to test a canary build if either lands.
The crash is in mi_realloc_aligned's internal _mi_memcpy during HTTP response body buffer growth. The segfault address (0x50AD8A10000) follows the same high-address pattern as the other reports in this issue.
After tracing the code path, this appears to be the MimallocArena heap tag collision described in #28026. Arena heaps created with mi_heap_new() use tag 0 (same as the backing heap), so abandoned pages from dead threads get adopted by the wrong heap and their live blocks get freed, corrupting the free-list.
Would the fixes in #28026 and #28230 address this? Happy to test a canary build if either lands.
@dylan-conway — Following up on @JoshSalway's root cause analysis above. The decoded stack trace points to mi_realloc_aligned crashing due to MimallocArena heap tag collision: arena heaps from mi_heap_new() use tag 0 (same as backing heap), so abandoned pages from dead threads get adopted by the wrong heap, corrupting the free-list.
PR #28026 appears to address exactly this. There are 6+ duplicate issues across 2+ years (#18352, #23180, #23399, #24804, #20710, #26984) — all closed without fix. This affects long-lived processes on Windows (Claude Code, CI tools, daemons) and is deterministically reproducible after ~24h.
Checking in again — it's been two weeks since the root cause analysis. The decoded stack trace makes this pretty actionable (MimallocArena heap tag collision in mi_realloc_aligned). Is anyone looking at this? Happy to test a fix build whenever one's available.
@dylan-conway — following up again. It's now been 9+ weeks since @JoshSalway decoded the root cause (MimallocArena heap tag collision in mi_realloc_aligned) and two fix PRs were filed (#28026, #28230). This affects Claude Code users on Windows specifically — there are 6+ duplicate reports in the anthropics/claude-code repo with the same crash signature. Is there a timeline for this getting reviewed? Happy to test a canary build.
Activity
github-actions commentedon Mar 17, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
ElliotDrel commentedon Mar 18, 2026
This bug has been reported and closed repeatedly without a fix since at least Bun v1.2.5:
It is still present in v1.3.11. Each time the issue gets closed (often by a dedupe bot), but the underlying crash on Windows sleep/wake has never been addressed. This should be kept open until there's an actual fix.
A second crash instance with a different fault address and bun.report link was filed in #28176 (now closed as duplicate of this issue) — the crash data there may still be useful for diagnosis.
ElliotDrel commentedon Mar 31, 2026
Another crash on the same machine. This one occurred after ~3 hours of active use (not idle/sleep-wake like the original report), suggesting the root cause isn't limited to suspend/resume.
Crash report: https://bun.report/1.3.11/e_1759ce80mgggEuhogCgor9wCmgr9wCm8p9wCs3m9wCw5ox3Bi80hNir0wkBo5iomB006qTmhy4b8u54bo3++0B8m5iwBixt+2Bqjo62B69l62Bu26zd4p/pYCYKERNEL32.DLLut0LCSntdll.dll4oijBA2m1Bhgg8/d
Same high-address segfault pattern as the original two crashes (0x5CA6C010000, 0x44924010000). All three share KERNEL32.DLL/ntdll.dll in the stack. This is now the third instance on this machine across different session durations.
ElliotDrel commentedon Apr 6, 2026
Are PRs #28230 (Windows bmalloc/GC crash fix) and #28026 (MimallocArena heap tag fix) related to this? Both touch Windows memory management paths that could explain the segfault pattern reported here. Happy to test a canary build if either lands.
JoshSalway commentedon Apr 10, 2026
Additional crash data from v1.3.11 (Windows 11 Pro x64)
Hit the same crash pattern after ~25 hours of continuous use as a Claude Code standalone executable.
Runtime stats at crash:
Encoded crash data:
Decoded stack trace:
The crash is in
mi_realloc_aligned's internal_mi_memcpyduring HTTP response body buffer growth. The segfault address (0x50AD8A10000) follows the same high-address pattern as the other reports in this issue.After tracing the code path, this appears to be the MimallocArena heap tag collision described in #28026. Arena heaps created with
mi_heap_new()use tag 0 (same as the backing heap), so abandoned pages from dead threads get adopted by the wrong heap and their live blocks get freed, corrupting the free-list.Would the fixes in #28026 and #28230 address this? Happy to test a canary build if either lands.
ElliotDrel commentedon Apr 18, 2026
@dylan-conway — Following up on @JoshSalway's root cause analysis above. The decoded stack trace points to
mi_realloc_alignedcrashing due to MimallocArena heap tag collision: arena heaps frommi_heap_new()use tag 0 (same as backing heap), so abandoned pages from dead threads get adopted by the wrong heap, corrupting the free-list.PR #28026 appears to address exactly this. There are 6+ duplicate issues across 2+ years (#18352, #23180, #23399, #24804, #20710, #26984) — all closed without fix. This affects long-lived processes on Windows (Claude Code, CI tools, daemons) and is deterministically reproducible after ~24h.
ElliotDrel commentedon May 2, 2026
Checking in again — it's been two weeks since the root cause analysis. The decoded stack trace makes this pretty actionable (MimallocArena heap tag collision in
mi_realloc_aligned). Is anyone looking at this? Happy to test a fix build whenever one's available.ElliotDrel commentedon May 18, 2026
@dylan-conway — following up again. It's now been 9+ weeks since @JoshSalway decoded the root cause (MimallocArena heap tag collision in mi_realloc_aligned) and two fix PRs were filed (#28026, #28230). This affects Claude Code users on Windows specifically — there are 6+ duplicate reports in the anthropics/claude-code repo with the same crash signature. Is there a timeline for this getting reviewed? Happy to test a canary build.
Windows: wait for close completions when closing a worker's uv loop