You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
POSIX readv()/preadv()/writev()/pwritev() do not use all buffers under preview 2 (as found by Python)Â #7830
changed the title [-]POSIX `readv()`/`preadv()`/`writev()`/`pwritev()` misreporting number of bytes read under preview 2 (as found by Python)[/-][+]POSIX `readv()`/`preadv()`/`writev()`/`pwritev()` misreporting number of bytes read/written under preview 2 (as found by Python)[/+]on Jan 26, 2024
The preview2 based preview1 implementation which is now used by default indeed only looks at the first buffer. See also #7757. wasi-preview1-component-adapter also only looks at the first buffer as far as I can see.
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.
changed the title [-]POSIX `readv()`/`preadv()`/`writev()`/`pwritev()` misreporting number of bytes read/written under preview 2 (as found by Python)[/-][+]POSIX `readv()`/`preadv()`/`writev()`/`pwritev()` do not use all buffers under preview 2 (as found by Python)[/+]on Jan 29, 2024
Activity
[-]POSIX `readv()`/`preadv()`/`writev()`/`pwritev()` misreporting number of bytes read under preview 2 (as found by Python)[/-][+]POSIX `readv()`/`preadv()`/`writev()`/`pwritev()` misreporting number of bytes read/written under preview 2 (as found by Python)[/+]brettcannon commentedon Jan 26, 2024
If I'm looking this up right,
wasmtime/crates/wasi/src/preview2/preview1.rs
Line 1309 in 5c0027b
wasmtime/crates/wasi-preview1-component-adapter/src/lib.rs
Line 989 in 5c0027b
bjorn3 commentedon Jan 26, 2024
The preview2 based preview1 implementation which is now used by default indeed only looks at the first buffer. See also #7757. wasi-preview1-component-adapter also only looks at the first buffer as far as I can see.
alexcrichton commentedon Jan 26, 2024
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 commentedon Jan 26, 2024
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 commentedon Jan 28, 2024
Correct yeah, that's not expected to change.
[-]POSIX `readv()`/`preadv()`/`writev()`/`pwritev()` misreporting number of bytes read/written under preview 2 (as found by Python)[/-][+]POSIX `readv()`/`preadv()`/`writev()`/`pwritev()` do not use all buffers under preview 2 (as found by Python)[/+]brettcannon commentedon Jan 29, 2024
I've tweaked the title and closing this as it's working as intended. I'll patch CPython to consider these functions as unavailable.
pythonGH-115978: Disable `*readv()` and `*writev()` on WASI
GH-115978: Disable `*readv()` and `*writev()` on WASI (GH-116228)
pythonGH-115978: Disable `*readv()` and `*writev()` on WASI (pythonGHâĶ
pythonGH-115978: Disable `*readv()` and `*writev()` on WASI (pythonGHâĶ
[3.12] GH-115978: Disable `*readv()` and `*writev()` on WASI (GH-116228âĶ
2 remaining items
pythonGH-115978: Disable `*readv()` and `*writev()` on WASI (pythonGHâĶ
pythonGH-115978: Disable `*readv()` and `*writev()` on WASI (pythonGHâĶ
python311 py311-html-docs: updated to 3.11.9
python312 py312-html-docs: updated to 3.12.3
python312 py312-html-docs: updated to 3.12.3
pythonGH-115978: Disable `*readv()` and `*writev()` on WASI (pythonGHâĶ
python311 py311-html-docs: updated to 3.11.9
python312 py312-html-docs: updated to 3.12.3
python312 py312-html-docs: updated to 3.12.3
python311 py311-html-docs: updated to 3.11.9
python312 py312-html-docs: updated to 3.12.3
python312 py312-html-docs: updated to 3.12.3
python311 py311-html-docs: updated to 3.11.9
python312 py312-html-docs: updated to 3.12.3
python312 py312-html-docs: updated to 3.12.3