yagehu added the bug label to Issue #10577.
yagehu opened issue #10577:
Test Case
Rust code with
wasiv0.11 (for the preview1 API).use wasi::{LOOKUPFLAGS_SYMLINK_FOLLOW, OFLAGS_TRUNC}; fn main() { let base_fd = 3; unsafe { wasi::path_open( base_fd, LOOKUPFLAGS_SYMLINK_FOLLOW, "a", OFLAGS_TRUNC, 0, 0, 0, ) .unwrap(); } }Steps to Reproduce
On Windows, set up a directory:
mkdir dircargo build --target wasm32-wasip1Run the compiled Wasm binary with Wasmtime:
wasmtime --dir . target\wasm32-wasip1\debug\repro.wasmExpected Results
The
path_opencall should succeed or fail.Actual Results
Wasmtime panics with a stacktrace.
Versions and Environment
Wasmtime version or commit: v31.0.0
Operating system: Windows 11
Architecture: amd64
yagehu edited issue #10577:
Test Case
Rust code with
wasiv0.11 (for the preview1 API).use wasi::{LOOKUPFLAGS_SYMLINK_FOLLOW, OFLAGS_TRUNC}; fn main() { let base_fd = 3; unsafe { let _result = wasi::path_open( base_fd, LOOKUPFLAGS_SYMLINK_FOLLOW, "a", OFLAGS_TRUNC, 0, 0, 0, ); } }Steps to Reproduce
On Windows, set up a directory:
mkdir dircargo build --target wasm32-wasip1Run the compiled Wasm binary with Wasmtime:
wasmtime --dir . target\wasm32-wasip1\debug\repro.wasmExpected Results
The
path_opencall should succeed or fail.Actual Results
Wasmtime panics with a stacktrace.
Versions and Environment
Wasmtime version or commit: v31.0.0
Operating system: Windows 11
Architecture: amd64
yagehu edited issue #10577:
Test Case
Rust code with
wasiv0.11 (for the preview1 API).use wasi::{LOOKUPFLAGS_SYMLINK_FOLLOW, OFLAGS_TRUNC}; fn main() { let base_fd = 3; unsafe { let _result = wasi::path_open( base_fd, LOOKUPFLAGS_SYMLINK_FOLLOW, "dir", OFLAGS_TRUNC, 0, 0, 0, ); } }Steps to Reproduce
On Windows, set up a directory:
mkdir dircargo build --target wasm32-wasip1Run the compiled Wasm binary with Wasmtime:
wasmtime --dir . target\wasm32-wasip1\debug\repro.wasmExpected Results
The
path_opencall should succeed or fail.Actual Results
Wasmtime panics with a stacktrace.
Versions and Environment
Wasmtime version or commit: v31.0.0
Operating system: Windows 11
Architecture: amd64
alexcrichton commented on issue #10577:
Thanks for the report! I can reproduce this in wine which I suspect is similar enough to Windows in this regard. Can you confirm though @yagehu and post the full panic message you're seeing?
What I see is:
thread 'main' panicked at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cap-primitives-3.4.3/src/windows/fs/open_unchecked.rs:213:30: called `Result::unwrap()` on an `Err` value: Os { code: 87, kind: InvalidInput, message: "Invalid parameter." } note: run with `RUST_BACKTRACE=1` environment variable to display a backtracecc @sunfishcode it looks like this is panicking?
yagehu commented on issue #10577:
This is the message I get on Windows:
thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cap-primitives-3.4.1\src\windows\fs\open_unchecked.rs:213:30: called `Result::unwrap()` on an `Err` value: Os { code: 87, kind: InvalidInput, message: "The parameter is incorrect." }It does seem like cap-primitives need to check if it's a directory before
set_len(0).
sunfishcode closed issue #10577:
Test Case
Rust code with
wasiv0.11 (for the preview1 API).use wasi::{LOOKUPFLAGS_SYMLINK_FOLLOW, OFLAGS_TRUNC}; fn main() { let base_fd = 3; unsafe { let _result = wasi::path_open( base_fd, LOOKUPFLAGS_SYMLINK_FOLLOW, "dir", OFLAGS_TRUNC, 0, 0, 0, ); } }Steps to Reproduce
On Windows, set up a directory:
mkdir dircargo build --target wasm32-wasip1Run the compiled Wasm binary with Wasmtime:
wasmtime --dir . target\wasm32-wasip1\debug\repro.wasmExpected Results
The
path_opencall should succeed or fail.Actual Results
Wasmtime panics with a stacktrace.
Versions and Environment
Wasmtime version or commit: v31.0.0
Operating system: Windows 11
Architecture: amd64
Last updated: Dec 06 2025 at 06:05 UTC