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

fix(Bun.file) throw OOM if read is too big #15253

Closed cirospaciari closed 1 day ago

cirospaciari commented 2 days ago

What does this PR do?

Fix: https://github.com/oven-sh/bun/issues/15242

How did you verify your code works?

Manually tested, CI dont like 4GB+ files.

robobun commented 2 days ago

:x: @cirospaciari, your commit 263888be26df9d65bd00c5965e29e2a2fea5849c has 13 failures in #6539:

  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/deno/crypto/webcrypto.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64-baseline
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64
  • test/cli/install/bun-run.test.ts - timeout on 🐧 2023 aarch64
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 aarch64
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 x64-baseline
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 x64
  • test/cli/run/run-crash-handler.test.ts - timeout on 🐧 2023 aarch64
  • test/cli/run/run-crash-handler.test.ts - timeout on 🐧 2023 x64-baseline
  • test/cli/run/run-crash-handler.test.ts - timeout on 🐧 2023 x64
  • test/js/node/child_process/child_process.test.ts - timeout on 🐧 2023 aarch64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/node/child_process/child_process.test.ts - timeout on 🐧 2023 x64-baseline
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/bun/http/serve.test.ts - 1 failing on 🍎 14 x64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 aarch64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64-baseline
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 12 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 11 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 22.04 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 11 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 12 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 20.04 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 22.04 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 2023 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 2023 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 11 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 12 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 20.04 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 22.04 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 2023 x64
  • test/js/third_party/body-parser/express-bun-build-compile.test.ts - 1 failing on 🐧 2023 aarch64
  • test/js/third_party/body-parser/express-bun-build-compile.test.ts - 1 failing on 🐧 2023 x64-baseline
  • test/js/third_party/body-parser/express-bun-build-compile.test.ts - 1 failing on 🐧 2023 x64
  • test/bundler/esbuild/importstar.test.ts - 1 failing on 🐧 11 aarch64
  • test/bundler/cli.test.ts - 1 failing on 🐧 2023 aarch64
  • test/bundler/cli.test.ts - 1 failing on 🐧 2023 x64-baseline
  • test/bundler/cli.test.ts - 1 failing on 🐧 2023 x64
  • test/js/node/test/parallel/http2-pipe.test.js - code 1 on 🍎 13 aarch64