oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.04k stars 2.66k forks source link

[crash] fs readdir crash #12742

Closed vinhjaxt closed 1 day ago

vinhjaxt commented 1 month ago

How can we reproduce the crash?

// bun --hot main.ts
import fs from 'node:fs/promises'

const folder = 'does-exists-folder' // yes the folder exists, can list by ls -al does-exists-folder
await fs.readdir(folder, { recursive: true })

Relevant log output

[preindex] processFile: ENOENT: No such file or directory
   errno: -2
 syscall: "stat"

============================================================
Bun v1.1.20 (ae194892) Linux x64 (baseline)
Linux Kernel v6.1.0 | glibc v2.39
CPU: sse42 popcnt avx avx2
Args: "bun" "--hot" "/preindex.ts"
Features: jsc fetch(6) shell(2) spawn 
Builtins: "bun:main" "node:fs/promises" 
Elapsed: 14385ms | User: 76ms | Sys: 45ms
RSS: 1.07GB | Peak: 94.53MB | Commit: 1.07GB | Faults: 3

panic(main thread): Segmentation fault at address 0x38
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.1.20/Ba1ae19489AigigG2q06mE+xpRsmml/C6g609C0k6piE4pm48Cwh998C6wsl3Cgt4j3Cy8wKA2AwD

Stack Trace (bun.report)

Bun v1.1.20 (ae19489) on linux x86_64_baseline [AutoCommand]

Segmentation fault at address 0x00000038

ippsav commented 1 month ago

I'm a bit confused when it comes to the logs, you're running bun --hot main.ts but the log mentions you're passing --hot /preindex.ts as args to bun ? am i missing something ?