brettcannon added the bug label to Issue #7830.
brettcannon opened issue #7830:
Test Case
TODO: upload Wasm file here
Steps to Reproduce
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L520-L525
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L307-L311
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L487-L490
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L364-L369
Expected Results
To be told 10 bytes were read/written.
Actual Results
5 bytes, which matches the first buffer, not the total bytes written across all buffers.
Versions and Environment
Wasmtime version or commit: 17.0.0
Operating system: Linux/WSL
Architecture: x64
Extra Info
Success logs when testing
readv()
:
success-readv.txtFailuse logs:
failure-readv.txt
brettcannon edited issue #7830:
Test Case
TODO: upload Wasm file here
Steps to Reproduce
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L520-L525
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L307-L311
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L487-L490
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L364-L369
Expected Results
To be told 10 bytes were read/written.
Actual Results
5 bytes, which matches the first buffer, not the total bytes written across all buffers.
Versions and Environment
Wasmtime version or commit: 17.0.0
Operating system: Linux/WSL
Architecture: x64
Extra Info
Success logs when testing
readv()
:
success-readv.txtFailuse logs:
failure-readv.txt
brettcannon commented on issue #7830:
If I'm looking this up right, https://github.com/bytecodealliance/wasmtime/blob/5c0027be59553f085589ce7b11cb596a3704aff2/crates/wasi/src/preview2/preview1.rs#L1309 seems to ignore all but the first buffer. https://github.com/bytecodealliance/wasmtime/blob/5c0027be59553f085589ce7b11cb596a3704aff2/crates/wasi-preview1-component-adapter/src/lib.rs#L989 examines all of them.
bjorn3 commented on issue #7830:
The preview2 based preview1 implementation which is now used by default indeed only looks at the first buffer. See also https://github.com/bytecodealliance/wasmtime/issues/7757. wasi-preview1-component-adapter also only looks at the first buffer as far as I can see.
alexcrichton commented on issue #7830:
Yes I can confirm that this is expected right now. It's expected that this is still posix-conformant in that posix doesn't guarantee everything is written. Vectored reads/writes aren't present in preview2 so they're polyfilled from preview1 by looking at the first buffer.
brettcannon commented on issue #7830:
Yes I can confirm that this is expected right now.
As in this isn't expected to change? I think I can mark those POSIX functions as unsupported in https://github.com/python/cpython/blob/main/Tools/wasm/config.site-wasm32-wasi so the tests pass if you plan to keep the current semantics.
alexcrichton commented on issue #7830:
Correct yeah, that's not expected to change.
brettcannon edited issue #7830:
Test Case
TODO: upload Wasm file here
Steps to Reproduce
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L520-L525
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L307-L311
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L487-L490
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L364-L369
Expected Results
To be told 10 bytes were read/written.
Actual Results
5 bytes, which matches the first buffer, not the total bytes written across all buffers.
Versions and Environment
Wasmtime version or commit: 17.0.0
Operating system: Linux/WSL
Architecture: x64
Extra Info
Success logs when testing
readv()
:
success-readv.txtFailuse logs:
failure-readv.txt
brettcannon closed issue #7830:
Test Case
TODO: upload Wasm file here
Steps to Reproduce
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L520-L525
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L307-L311
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L487-L490
- https://github.com/python/cpython/blob/07236f5b39a2e534cf190cd4f7c73300d209520b/Lib/test/test_posix.py#L364-L369
Expected Results
To be told 10 bytes were read/written.
Actual Results
5 bytes, which matches the first buffer, not the total bytes written across all buffers.
Versions and Environment
Wasmtime version or commit: 17.0.0
Operating system: Linux/WSL
Architecture: x64
Extra Info
Success logs when testing
readv()
:
success-readv.txtFailuse logs:
failure-readv.txt
brettcannon commented on issue #7830:
I've tweaked the title and closing this as it's working as intended. I'll patch CPython to consider these functions as unavailable.
Last updated: Dec 23 2024 at 13:07 UTC