Host: preserve output buffers after zero-byte syscalls#924
Closed
brandonpayton wants to merge 1 commit into
Closed
Host: preserve output buffers after zero-byte syscalls#924brandonpayton wants to merge 1 commit into
brandonpayton wants to merge 1 commit into
Conversation
This was referenced Jul 13, 2026
Member
Author
|
Closing this focused source PR because its zero-byte syscall copy-back contract is now carried by #934 at exact green head |
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.
This pulls one host-runtime fix out of #769, rebuilt directly on current main from source commit 5e1da94.
What #907 already landed
#907 landed the current ABI-39 host and kernel baseline, including the newer channel-completion lifecycle, diagnostic routing, and the overlapping mmap and munmap work. It did not include this output copy-length correction.
What remains here
A successful read, recv, or getdents-style syscall can return zero bytes. The host used to copy the whole zero-filled scratch buffer back anyway, overwriting bytes the guest still owned. This change copies no variable output for a zero result, while still copying fixed prefix metadata such as the message type used by msgrcv.
The focused tests cover:
The code is shared by Node and browser workers. The direct regression test exercises that shared path, and a Chromium guest lifecycle test passed against the rebuilt browser host.
What was deliberately removed
This does not replay the stale #769 ancestry or any of its mmap, SQLite, libc, VFS, credential, lock-table, or package changes. The test harness was adapted to the current #907 channel-publication flow instead of restoring the old assumptions.
ABI and package impact
This fixes the existing ABI-39 marshalling behavior without changing syscall numbers, descriptors, channel layout, pointer interpretation, or generated ABI data. Existing binaries remain valid, so there is no ABI version bump. The ABI snapshot check is clean. No package recipe, revision, or artifact output changes.
Validation run
Validation not run
The full non-slow Playwright suite, Firefox, WebKit, manual ./run.sh browser verification, libc-test, POSIX, and Sortix suites were not run. This PR changes host scratch-buffer copy-back only; it does not change libc, the kernel syscall implementation, VFS state, or package artifacts. No performance claim is made and no performance benchmark was run.