PANE

Bun developers face stale bytes after file truncation

10 posts in the last 60 days, all from GitHub.

“What version of Bun is running? 1.4.3+c6da4a4d3 What platform is your computer? Linux 7.2.6+deb14 amd64 x86 64 unknown What steps can reproduce the bug? Create repro.ts: Run: Expected output size: Actual output on the affected system: The actual output is exactly: A byte level…”
GitHub
“What version of Bun is running? 1.4.3 (also 1.4.0, 1.3.13), macOS arm64 What steps can reproduce the bug? What is the expected behavior? "loXYm ipsum" , which is what Node prints. Node treats an undefined offset as 0 and a non number length as buffer.byteLength offset , then…”
GitHub
“What version of Bun is running? 1.4.2 (744846f84), x64 What platform is your computer? Windows 11 Pro 10.0.28000 x64 What steps can reproduce the bug? Save this as repro.test.ts (dependency free — uses bun:test and node:child process only) and run bun test repro.test.ts : What…”
GitHub

Users report Bun's `fs.promises.writeFile` function silently succeeding when final truncation fails, leaving behind stale trailing bytes in files. This issue occurs on both Windows and macOS, impacting the reliability of file writing operations.

devtoolsprogrammingfile-managementosbug
FIT
0%
SIGNAL
57%
SOURCES11
FRESHEST POST2D AGO
TRACKED SINCE35D AGO

SOURCES (11)

“What version of Bun is running? 1.4.3+c6da4a4d3 What platform is your computer? Linux 7.2.9 (WSL2, x86 64) What steps can reproduce the bug? The figure in the title is a median difference. The min max ranges of the two runtimes overlap on this shared host…”

GITHUB2d ago

“What version of Bun is running? 1.4.3+c6da4a4d3 What platform is your computer? Linux 7.2.6+deb14 amd64 x86 64 unknown What steps can reproduce the bug? Create repro.ts: Run: Expected output size: Actual output on the affected system: The actual output is exactly: A byte level check: Observed: The prefix is duplicated once. The same program is correct when stdout is a regular file: Observed: The problem is specific to the pipe/nonblocking stdout path. What is the expected behavior? A partial std”

GITHUB2d ago

“What version of Bun is running? 1.4.3 (also 1.4.0, 1.3.13), macOS arm64 What steps can reproduce the bug? What is the expected behavior? "loXYm ipsum" , which is what Node prints. Node treats an undefined offset as 0 and a non number length as buffer.byteLength offset , then writes at position . What do you see instead? "XYrem ipsum" . The write goes to the descriptor's current offset, and position is ignored. This affects both fs.write and fs.writeSync whenever offset is undefined or length is”

GITHUB2d ago

“What version of Bun is running? 1.4.2 (744846f84), x64 What platform is your computer? Windows 11 Pro 10.0.28000 x64 What steps can reproduce the bug? Save this as repro.test.ts (dependency free — uses bun:test and node:child process only) and run bun test repro.test.ts : What is the expected behavior? Both tests pass. The child process writes resp2\n to stdout about 5 ms after req2 is written to its stdin, so in both tests the promise p should reject with boom resp2 . What do you see instead? T”

GITHUB3d ago

“What version of Bun is running? 1.4.2 ( oven/bun:1 ) What platform is your computer? Linux x86 64, inside a gVisor (runsc release 20260928.0) sandbox What steps can reproduce the bug? fs.rm(path, { recursive: true, force: true }) on a path that doesn't exist, written with a trailing slash, on a filesystem where unlink() of that path returns ENOTDIR instead of ENOENT : Under gVisor, unlink("/src/.output/") returns ENOTDIR for a missing path (gVisor bug, reported at google/gvisor 15303), while lst”

GITHUB14d ago

“What version of Bun is running? 1.4.3 canary.1+37da174d5 What platform is your computer? Darwin 27.0.0 arm64 arm What steps can reproduce the bug? lastModified returns Bun's internal lazy stat marker jsc::INIT TIMESTAMP ( (1u64 << 52) 1 , or 4503599627370495 ) instead of a timestamp. Two code paths reach it: 1. Bun.file(path) where the stat fails (the file does not exist). 2. Any in memory Blob . Save as repro.js and run bun repro.js : What is the expected behavior? For a Bun.file() whose stat f”

GITHUB21d ago

“What version of Bun is running? 1.4.2+744846f84 (also main at 367d939d9a) What platform is your computer? Linux x64 (the code path is the same on every platform) What steps can reproduce the bug? A node:http server answers a request. The client then sends an Upgrade request (or a CONNECT) on the same keep alive connection. The 'upgrade' listener writes the 101 to the socket. Run the script with node and with bun . What is the expected behavior? Node v26.3.0 sends the 101 at once: What do you see”

GITHUBSep 18

“What version of Bun is running? 1.4.3+047f2e8e6 What platform is your computer? Darwin 27.0.0 arm64 arm What steps can reproduce the bug? Use the attached README.md , run repro.py , preload.cjs , and trace.c . The runner checks a normal write and an injected truncation failure against each supplied macOS arm64 Claude Code binary. 1. Write a 534 byte JSON string with await fs.writeFile(path, longer) . 2. Overwrite it with a 533 byte JSON string using await fs.writeFile(path, shorter) . 3. Make th”

GITHUBSep 13

“What version of Bun is running? 1.4.2+744846f84 What platform is your computer? Microsoft Windows NT 10.0.26200.0 x64 What steps can reproduce the bug? A Windows drive root is the one path fs.promises.realpath gets wrong: it comes back drive relative ( C: ) instead of C:\ . What is the expected behavior? All of them return "C:\\" , and the result is still a usable root. Node v26.8.1: C:\ is a fixed point of this operation, and Node pins that behavior rather than leaving it to chance: fs.realpath”

GITHUBSep 13

“What version of Bun is running? 1.4.2+744846f84 What platform is your computer? Microsoft Windows NT 10.0.26200.0 x64 What steps can reproduce the bug? Try to use aes 256 ocb in crypto.createCipheriv : What is the expected behavior? Working aes 256 ocb encryption. What do you see instead?”

GITHUBSep 13

“What version of Bun is running? 1.3.14+0d9b296af What platform is your computer? Microsoft Windows NT 10.0.26200.0 x64 What steps can reproduce the bug? Try to use aes 256 ocb in crypto.createCipheriv . What is the expected behavior? Working aes 256 ocb encryption. What do you see instead? error: Unknown cipher: aes 256 ocb Additional information AES OCB Added in node Node.js 24.7.0 : https://nodejs.org/fr/blog/release/v24.7.0”

GITHUBJun 19

SOLUTION LANDSCAPE

Brought to you byTop Sectors

A Player feature.See how many ways this pain can be solved, who's already building, and where the gaps are.