Skip to content

Segfault on Windows #22344

Closed
Closed

Description

@CrispyBacon1999

How can we reproduce the crash?

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 [_]

Segmentation fault at address 0xFE23E0B010

Features: tsconfig, tsconfig_paths, Bun.stderr, Bun.stdin, Bun.stdout, jsc, shell, spawn, standalone_executable, standalone_executable

also

Bun v1.2.19 (aad3abe) on windows x86_64_baseline [_]

panic: integer overflow

Features: workers_spawned, Bun.stderr, Bun.stdin, Bun.stdout, fetch, http_server, jsc, shell, spawn, standalone_executable, standalone_executable

Activity

  1. linear commented on Sep 2, 2025

    @linear
  2. github-actions commented on Sep 2, 2025

    @github-actions
    Contributor

    @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?

    bun upgrade

    For Bun's internal tracking, this issue is BUN-V4B.

  3. RiskyMH commented on Sep 2, 2025

    @RiskyMH
    Contributor

    uv__process_proc_exit

    did bun like fail to process.exit properly?

  4. CrispyBacon1999 commented on Sep 2, 2025

    @CrispyBacon1999
    Author

    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?

  5. CrispyBacon1999 commented on Sep 2, 2025

    @CrispyBacon1999
    Author

    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

    Features: workers_spawned, Bun.stderr, Bun.stdin, Bun.stdout, fetch, http_server, jsc, shell, spawn, standalone_executable, standalone_executable

  6. RiskyMH commented on Sep 2, 2025

    @RiskyMH
    Contributor

    bun would crash with bun upgrade

    this is concerning, do you have some more context?

  7. CrispyBacon1999 commented on Sep 2, 2025

    @CrispyBacon1999
    Author

    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

  8. robobun commented on Jul 24, 2026

    @robobun
    Collaborator

    Fixed by #35083.

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashAn issue that could cause a crashnode:child_processwindowsAn issue that is known to occur on Windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions