Stream: git-wasmtime

Topic: wasmtime / issue #7830 POSIX `readv()`/`preadv()`/`writev...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2024 at 20:46):

brettcannon added the bug label to Issue #7830.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2024 at 20:46):

brettcannon opened issue #7830:

Test Case

TODO: upload Wasm file here

Steps to Reproduce

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.txt

Failuse logs:
failure-readv.txt

view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2024 at 20:47):

brettcannon edited issue #7830:

Test Case

TODO: upload Wasm file here

Steps to Reproduce

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.txt

Failuse logs:
failure-readv.txt

view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2024 at 20:52):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2024 at 20:58):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2024 at 21:55):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 26 2024 at 23:39):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 28 2024 at 02:22):

alexcrichton commented on issue #7830:

Correct yeah, that's not expected to change.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 29 2024 at 20:10):

brettcannon edited issue #7830:

Test Case

TODO: upload Wasm file here

Steps to Reproduce

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.txt

Failuse logs:
failure-readv.txt

view this post on Zulip Wasmtime GitHub notifications bot (Jan 29 2024 at 20:11):

brettcannon closed issue #7830:

Test Case

TODO: upload Wasm file here

Steps to Reproduce

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.txt

Failuse logs:
failure-readv.txt

view this post on Zulip Wasmtime GitHub notifications bot (Jan 29 2024 at 20:11):

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: Oct 23 2024 at 20:03 UTC