I’m experiencing a critical issue when running a web server with Bun v1.1.37 on a Linux x64 environment. The process consistently crashes with the following error:
[WebServer] panic(main thread): Segmentation fault at address 0xBEF8
[WebServer] oh no: Bun has crashed. This indicates a bug in Bun, not your code.
[WebServer]
[WebServer] error: script "dev" was terminated by signal SIGILL (Illegal instruction)
[WebServer] Illegal instruction (core dumped)
Additionally, before the crash, I observed intermittent occurrences of:
• Bun version: 1.1.37 (commit 8ca0eb83)
• OS: Linux Kernel 6.5.0
• glibc: 2.35
• CPU: Supports sse42, popcnt, avx, avx2
• Command used: bun run dev (executing Vite from node_modules/.bin/vite)
Observations:
1. The crash happens consistently during GitHub Actions CI runs.
2. The segmentation fault and EBADF errors seem related to the WebServer handling in Bun.
3. System resource usage peaks shortly before the crash (RSS: 0.88GB), and the script is terminated with SIGILL (Illegal instruction).
Steps to Reproduce:
1. Set up a Bun-powered project with Playwright for testing and Vite as the web server.
2. Execute bun run dev in a CI environment (Linux Kernel 6.5.0, glibc 2.35).
3. Run Playwright tests targeting the web server.
4. Observe the segmentation fault after a few tests or web server interactions.
Relevant log output
Stack Trace (bun.report)
Bun v1.1.37 (8ca0eb8) on linux x86_64_baseline [RunAsNodeCommand]
How can we reproduce the crash?
Hello Bun team,
I’m experiencing a critical issue when running a web server with Bun v1.1.37 on a Linux x64 environment. The process consistently crashes with the following error:
[WebServer] panic(main thread): Segmentation fault at address 0xBEF8 [WebServer] oh no: Bun has crashed. This indicates a bug in Bun, not your code. [WebServer] [WebServer] error: script "dev" was terminated by signal SIGILL (Illegal instruction) [WebServer] Illegal instruction (core dumped)
Additionally, before the crash, I observed intermittent occurrences of:
[WebServer] EBADF: Bad file descriptor [WebServer] errno: -9 [WebServer] syscall: "read"
Reproduction Environment:
Observations:
Steps to Reproduce:
Relevant log output
Stack Trace (bun.report)
Bun v1.1.37 (
8ca0eb8
) on linux x86_64_baseline [RunAsNodeCommand]Segmentation fault at address 0x0000BEF8
path_watcher.zig:656
:src.bun.js.node.path_watcher.PathWatcher.deinit
path_watcher.zig:906
:src.bun.js.node.node_fs_watcher.FSWatcher.close
node_fs_watcher.zig:498
:src.bun.js.node.node_fs_watcher.FSWatcher.FSWatchTaskPosix.run
event_loop.zig:1045
:src.bun.js.event_loop.EventLoop.tickQueueWithCount__anon_142089
event_loop.zig:1273
:src.bun.js.event_loop.EventLoop.tick
javascript.zig:1733
:src.bun.js.javascript.OpaqueWrap__anon_57425__struct_97108.callback
bindings.cpp:4946
:JSC__VM__holdAPILock
shimmer.zig:201
:src.bun_js.Run.boot
Features: process_dlopen, Bun.stdin, http_server, jsc, spawn, tsconfig, tsconfig_paths, tsconfig_paths