Repository navigation
fix(io): fail file writes on zero progress - #1446
Merged
Merged
Conversation
This was referenced Oct 10, 2026
Lorenzobattistela
force-pushed
the
fix/file-write-progress
branch
from
October 14, 2026 13:11
eb09792 to
a93a9e3
Compare
Lorenzobattistela
approved these changes
Oct 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1445.
File.writeandFile.write_bytesloop until every byte is written, moving on by the count the host returns. If the host returns 0 with bytes left, the loop never ends. Both the C loop (effs/file_write.c) and the JS loop (effs/file_write.js) now fail withEIO(5) when that happens. The handle still comes back outside theResult. Empty writes, short writes that make progress and existing errors (ENOSPC,EFBIG, ...) behave as before.Test:
tests/io/file_write_zero.bendopens/dev/nullthrough a test effect whose nonempty writes all return 0, and checks thatFile.writeandFile.write_bytesgive 5 and that an empty write still succeeds. On main it hangs in C, bun and the interpreter.Gates on main d0cb504: repo 54/54, test 1625/1625.