oven-sh / bun

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

Bun crashes when reading very large file via Bun global #15242

Closed Daw588 closed 1 day ago

Daw588 commented 3 days ago

How can we reproduce the crash?

Get a very large file like 5GB video file and try to load it into the memory via Bun global:

await Bun.file("./very-large-file").arrayBuffer();

Note: This doesn't happen with NodeJS API readFile, as an error "out of memory" is thrown.

Relevant log output

panic(main thread): Internal assertion failure

Stack Trace (bun.report)

Bun v1.1.34 (5e5e7c6) on windows x86_64 [RunCommand]

panic: Internal assertion failure

Features: jsc, tsconfig

Sentry Issue: BUN-8KG

Jarred-Sumner commented 3 days ago

ah its supposed to throw an error