How can we reproduce the crash?
Bun crashes when running a simple project on a CPU without AVX2 support using any bun version > v1.3.8. Steps below reproduce the issue from a fresh project.
Steps to reproduce
- Use a machine/VM with a non-AVX2 CPU (e.g., older Intel/AMD CPU or a VM with AVX2 disabled).
- Install any bun version after v1.3.8.
- Create a new blank project using
bun init and choose blank.
- Run
bun index.ts
Expected behavior
bun runs the script and prints "hello" (or runs the program) without crashing.
Actual behavior
Bun crashes immediately when running the script.
Bun v1.3.14 (0d9b296) Linux x64 (baseline)
Linux Kernel v6.0.0 | glibc v2.39
Args: "bun" "index.ts"
Features: jsc no_avx2 no_avx tsconfig
Builtins: "bun:main"
Elapsed: 16425ms | User: 13835ms | Sys: 2456ms
RSS: 7.96GB | Peak: 4.02GB | Commit: 7.96GB | Faults: 0 | Machine: 30.00GB
CPU lacks AVX support. Please consider upgrading to a newer CPU.
panic(main thread): Segmentation fault at address 0x39E2EC00000
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.3.14/Ba10d9b296gCggggigD4664tE+ypRgwgnuC6n1/uCmj67uCg02u8Dok4k6D+/3xpF+y0xpFm73rmF0973jEq/ykgDmsyppDg1qguCq5/zhD+6gguCuohysC00hhsC8u5gsCy8wKA285Bgggg4uB
Illegal instruction (core dumped)
Relevant log output
Bun v1.3.14 (0d9b296a) Linux x64 (baseline)
Linux Kernel v6.0.0 | glibc v2.39
Args: "bun" "index.ts"
Features: jsc no_avx2 no_avx tsconfig
Builtins: "bun:main"
Elapsed: 16425ms | User: 13835ms | Sys: 2456ms
RSS: 7.96GB | Peak: 4.02GB | Commit: 7.96GB | Faults: 0 | Machine: 30.00GB
CPU lacks AVX support. Please consider upgrading to a newer CPU.
panic(main thread): Segmentation fault at address 0x39E2EC00000
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.3.14/Ba10d9b296gCggggigD4664tE+ypRgwgnuC6n1/uCmj67uCg02u8Dok4k6D+/3xpF+y0xpFm73rmF0973jEq/ykgDmsyppDg1qguCq5/zhD+6gguCuohysC00hhsC8u5gsCy8wKA285Bgggg4uB
Illegal instruction (core dumped)
Stack Trace (bun.report)
Bun v1.3.14 (0d9b296) on linux x86_64_baseline [AutoCommand]
Segmentation fault at address 0x39E2EC00000
Features: tsconfig, jsc, no_avx2, no_avx
How can we reproduce the crash?
Bun crashes when running a simple project on a CPU without AVX2 support using any bun version > v1.3.8. Steps below reproduce the issue from a fresh project.
Steps to reproduce
bun initand choose blank.bun index.tsExpected behavior
bun runs the script and prints "hello" (or runs the program) without crashing.
Actual behavior
Bun crashes immediately when running the script.
Bun v1.3.14 (0d9b296) Linux x64 (baseline)
Linux Kernel v6.0.0 | glibc v2.39
Args: "bun" "index.ts"
Features: jsc no_avx2 no_avx tsconfig
Builtins: "bun:main"
Elapsed: 16425ms | User: 13835ms | Sys: 2456ms
RSS: 7.96GB | Peak: 4.02GB | Commit: 7.96GB | Faults: 0 | Machine: 30.00GB
CPU lacks AVX support. Please consider upgrading to a newer CPU.
panic(main thread): Segmentation fault at address 0x39E2EC00000
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.3.14/Ba10d9b296gCggggigD4664tE+ypRgwgnuC6n1/uCmj67uCg02u8Dok4k6D+/3xpF+y0xpFm73rmF0973jEq/ykgDmsyppDg1qguCq5/zhD+6gguCuohysC00hhsC8u5gsCy8wKA285Bgggg4uB
Illegal instruction (core dumped)
Relevant log output
Stack Trace (bun.report)
Bun v1.3.14 (
0d9b296) on linux x86_64_baseline [AutoCommand]Segmentation fault at address 0x39E2EC00000
encoding.zig:215:runtime.webcore.encoding.toBunStringComptimestring.zig:204:string.string.String.cloneUTF8ModuleLoader.zig:1150:jsc.ModuleLoader.getHardcodedModuleModuleLoader.zig:1175:jsc.ModuleLoader.fetchBuiltinModuleModuleLoader.zig:861:jsc.ModuleLoader.Bun__fetchBuiltinModuleModuleLoader.cpp:977:JSC::JSValue Bun::fetchESMSourceCode<true>ModuleLoader.cpp:1206:Bun::fetchESMSourceCodeAsyncZigGlobalObject.cpp:3543:Zig::GlobalObject::moduleLoaderFetchJSModuleLoader.cpp:531:JSC::JSModuleLoader::fetchJSModuleLoader.cpp:374:JSC::JSModuleLoader::loadModuleCompletion.cpp:198:JSC::loadAndEvaluateModulebindings.cpp:3601:JSC__JSModuleLoader__loadAndEvaluateModuleJSModuleLoader.zig:39:jsc.JSModuleLoader.JSModuleLoader.loadAndEvaluateModuleVirtualMachine.zig:2339:jsc.VirtualMachine.reloadEntryPointVirtualMachine.zig:2457:jsc.VirtualMachine.loadEntryPointbun.js.zig:401:bun.js.Run.startjsc.zig:234:jsc.jsc.OpaqueWrap.callbackbindings.cpp:4899:JSC__VM__holdAPILockVM.zig:35:jsc.VM.VM.holdAPILockbun.js.zig:302:bun.js.Run.bootrun_command.zig:1562:cli.run_command.RunCommand._bootAndHandleErrorrun_command.zig:1642:cli.run_command.RunCommand.maybeOpenWithBunJSrun_command.zig:1691:cli.run_command.RunCommand.execcli.zig:829:cli.cli.Command.startcli.zig:20:cli.cli.Cli.startmain.zig:66:main.mainstart.zig:618:start.callMainstart.zig:587:start.callMainWithArgsstart.zig:602:mainFeatures: tsconfig, jsc, no_avx2, no_avx