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
I get this segfault every time I run bun, whether I'm in a project or not. I'm using a work PC, so I'd assume it's some group policy/security features blocking things that are required to make it function.
This specific crash was caused by using opencode, which uses Bun in the background for its executable.
Relevant log output
Stack Trace (bun.report)
Bun v1.2.19 (aad3abe) on windows x86_64_baseline [_]
Interestingly, I upgraded from v1.2.17 to v1.2.21 globally, had to use the powershell -c 'irm bun.sh/install.ps1|iex' command because bun would crash with bun upgrade and it somehow fixed the errors I was seeing. The version used by opencode was running v1.2.19, which still had this, but appears to work now?
Looked back at it, apparently there was a background process running blocking the upgrade with bun upgrade. It prompted me to use the powershell command to upgrade, which worked perfectly fine. Normally, I would upgrade, it would segfault, but still upgrade successfully, which makes this make a lot more sense.
did bun like fail to process.exit properly?
It's still weird to me that I had different behavior in opencode after upgrading my global install, since even after upgrading, it uses v1.2.19
This crash is inside ctiuser.dll (Carbon Black App Control) hooking CreateProcessW — the same uv_spawn crash family tracked in #10056. Bun's Vectored Exception Handler now lets first-chance access violations raised outside bun.exe's own image reach SEH instead of reporting them as a Bun segfault.
Verified the mechanism on main (df84f8d, which includes 79ee451):
$ bun -e "require('bun:ffi').dlopen('kernel32.dll',{IsBadReadPtr:{args:['usize','usize'],returns:'i32'}}).symbols.IsBadReadPtr(0xE8,8); console.log('ok')"
ok
If this still reproduces on a build newer than 79ee451 with Carbon Black active, please reopen with the new crash report.
Activity
linear commentedon Sep 2, 2025
ENG-20279 Segfault on Windows
github-actions commentedon Sep 2, 2025
@CrispyBacon1999, thank you for reporting this crash. The latest version of Bun is v1.2.21, but this crash was reported on Bun v1.2.19.
Are you able to reproduce this crash on the latest version of Bun?
For Bun's internal tracking, this issue is BUN-V4B.
RiskyMH commentedon Sep 2, 2025
did bun like fail to process.exit properly?
CrispyBacon1999 commentedon Sep 2, 2025
Interestingly, I upgraded from v1.2.17 to v1.2.21 globally, had to use the
powershell -c 'irm bun.sh/install.ps1|iex'command because bun would crash withbun upgradeand it somehow fixed the errors I was seeing. The version used by opencode was running v1.2.19, which still had this, but appears to work now?CrispyBacon1999 commentedon Sep 2, 2025
Ok, that might have been a false negative, I started using opencode and it immediately crashed after running any commands.
Bun v1.2.19 (
aad3abe) on windows x86_64_baseline [_]panic: integer overflow
ref_count.zig:144:derefWithContextIO.zig:129:closeStmt.zig:123:childDonePipeline.zig:190:nextYield.zig:120:runJSGlobalObject.zig:477:hasExceptionJSCJSValue.h:753:JSC::ensureStillAliveHerellint_entryFeatures: workers_spawned, Bun.stderr, Bun.stdin, Bun.stdout, fetch, http_server, jsc, shell, spawn, standalone_executable, standalone_executable
RiskyMH commentedon Sep 2, 2025
this is concerning, do you have some more context?
CrispyBacon1999 commentedon Sep 2, 2025
Looked back at it, apparently there was a background process running blocking the upgrade with
bun upgrade. It prompted me to use the powershell command to upgrade, which worked perfectly fine. Normally, I would upgrade, it would segfault, but still upgrade successfully, which makes this make a lot more sense.It's still weird to me that I had different behavior in opencode after upgrading my global install, since even after upgrading, it uses v1.2.19
robobun commentedon Jul 24, 2026
Fixed by #35083.
This crash is inside
ctiuser.dll(Carbon Black App Control) hookingCreateProcessW— the sameuv_spawncrash family tracked in #10056. Bun's Vectored Exception Handler now lets first-chance access violations raised outsidebun.exe's own image reach SEH instead of reporting them as a Bun segfault.Verified the mechanism on main (df84f8d, which includes 79ee451):
If this still reproduces on a build newer than 79ee451 with Carbon Black active, please reopen with the new crash report.