Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault and EBADF: Bad file descriptor during Playwright tests with WebServer on Bun v1.1.37 (Linux) #15424

Open
antoalv19 opened this issue Nov 26, 2024 · 1 comment
Labels
crash An issue that could cause a crash linux An issue that occurs on Linux

Comments

@antoalv19
Copy link

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:

•	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]

Segmentation fault at address 0x0000BEF8

Features: process_dlopen, Bun.stdin, http_server, jsc, spawn, tsconfig, tsconfig_paths, tsconfig_paths

@antoalv19 antoalv19 added the crash An issue that could cause a crash label Nov 26, 2024
@github-actions github-actions bot added the linux An issue that occurs on Linux label Nov 26, 2024
Copy link
Contributor

Thank you for reporting this crash.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash An issue that could cause a crash linux An issue that occurs on Linux
Projects
None yet
Development

No branches or pull requests

1 participant