Repository navigation
Fix std path, descriptor wait, and WASI clock boundaries - #801
Merged
Merged
Conversation
Signed-off-by: LunaStev <[email protected]>
Open
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.
Summary
Fix four standard-library boundary cases: reject negative POSIX descriptors before single-descriptor readiness waits, exclude parent-directory components from path extensions, validate path copy destinations before writing, and preserve the full unsigned WASI timestamp range when constructing
TimeSpec.Motivation
Negative descriptors could turn an infinite readiness wait into an indefinite block. Parent components such as
dir/..were treated as having an extension, invalid path destinations could be written through, and valid WASI timestamps abovei64::MAXwere rejected before splitting seconds and nanoseconds.Closes #710
Closes #752
Closes #753
Closes #755
Target and compatibility impact
-EBADFfor negative descriptors on Linux, macOS, and FreeBSD. Genericnet_pollkeeps its disabled-entry behavior; Windows socket-handle behavior is unchanged.-1for null destinations, nonpositive capacities, or insufficient space, without writing. Join capacity checks avoid overflowing a sum of lengths..and..components have no extension; existing hidden-file and trailing-dot behavior is retained.u64nanosecond values while retaining host errors and preserving the output on failure. No API signatures or compiler/std compatibility revisions change.Validation
After rebasing onto canonical master with #800 merged:
LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo test --locked --jobs 2 --test std_io_regressionspassed, including path/readiness fixtures at O0/O2. Local socket tests require execution outside the network sandbox.LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 WAVE_RUN_WASM_RUNTIME_TESTS=1 cargo test --locked --jobs 2 --test release_stabilization webassembly_runtime_is_freestanding_and_wasi_retries_preserve_errorspassed, including WASI timestamps at 0,i64::MAX,i64::MAX + 1, andu64::MAXat O0/O2.cargo fmt --all -- --check,bash tools/check_std_policy.sh, and the PR diff whitespace check passed.Earlier validation of these same changes passed workspace Clippy with
-D warnings, 289 corpus cases, all 26 std examples, and 20 O0/O2 cross-compilation checks for paths and TCP code on macOS amd64/arm64, Windows amd64/arm64, and FreeBSD amd64. Native non-Linux execution remains CI validation.Checklist
Signed-off-byline.std/.