wasi-testsuite icon indicating copy to clipboard operation
wasi-testsuite copied to clipboard

Tests failing on Wasmtime

Open electrum opened this issue 1 year ago • 7 comments

The "Daily runtime validation" workflow shows 9 failures on Wasmtime, which matches the behavior I see when running the tests locally. Is this a problem with the testsuite or with Wasmtime?

electrum avatar Sep 29 '24 05:09 electrum

I think one of the failures was fixed in #110. There are 8 remaining failures, all in the Rust tests; the two tests marked with [*] pass if I pass -S preview2=n to the wasmtime invocation.

truncation_rights.rs:59: dir_fdstat.fs_rights_base has 0x80000 flag, unexpectedly [*]

Test truncation_rights failed
  [exit_code] 0 == 134
STDOUT:

STDERR: implementation doesn't support setting file sizes through file descriptors, skipping

thread 'main' panicked at src/bin/truncation_rights.rs:59:9: assertion left == right failed: reading the fdstat from a directory left: 524288 right: 0 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: failed to run main module /home/wingo/src/wasip3/wasi-testsuite/tests/rust/testsuite/truncation_rights.wasm

Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0xfc8f - truncation_rights-06a9454bdc837336.wasm!abort 1: 0xb84e - truncation_rights-06a9454bdc837336.wasm!std::sys::pal::wasi::helpers::abort_internal::hcc3b2e0cde3c9001 2: 0x9504 - truncation_rights-06a9454bdc837336.wasm!std::process::abort::h0e38511b4c8b6f04 3: 0x94fa - truncation_rights-06a9454bdc837336.wasm!__rustc[5224e6b81cd82a8f]::__rust_abort 4: 0xcd9e - truncation_rights-06a9454bdc837336.wasm!__rustc[5224e6b81cd82a8f]::__rust_start_panic 5: 0xcc0f - truncation_rights-06a9454bdc837336.wasm!__rustc[5224e6b81cd82a8f]::rust_panic 6: 0xcb94 - truncation_rights-06a9454bdc837336.wasm!std::panicking::rust_panic_with_hook::h085fb375cd657b2f 7: 0xbbfe - truncation_rights-06a9454bdc837336.wasm!std::panicking::begin_panic_handler::{{closure}}::he68af7f9d5c53e56 8: 0xbb6a - truncation_rights-06a9454bdc837336.wasm!std::sys::backtrace::__rust_end_short_backtrace::h4c38003a22ca226f 9: 0xc57b - truncation_rights-06a9454bdc837336.wasm!__rustc[5224e6b81cd82a8f]::rust_begin_unwind 10: 0x116fd - truncation_rights-06a9454bdc837336.wasm!core::panicking::panic_fmt::h4e32e8d1cab5f47e 11: 0x133d4 - truncation_rights-06a9454bdc837336.wasm!core::panicking::assert_failed_inner::hf7ede4d3870aaaec 12: 0x11682 - truncation_rights-06a9454bdc837336.wasm!core::panicking::assert_failed::ha0414e0a634ffb40 13: 0x2a73 - truncation_rights-06a9454bdc837336.wasm!truncation_rights::test_truncation_rights::he5b8c863abddf5e7 14: 0x32e4 - truncation_rights-06a9454bdc837336.wasm!truncation_rights::main::h4ac2586dcc743fd3 15: 0xa2b - truncation_rights-06a9454bdc837336.wasm!core::ops::function::FnOnce::call_once::h5f4a05effd728e69 16: 0x9f6 - truncation_rights-06a9454bdc837336.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h8f0a6916570c2d72 17: 0x9d4 - truncation_rights-06a9454bdc837336.wasm!std::rt::lang_start::{{closure}}::h7a92174de49c195b 18: 0x99e7 - truncation_rights-06a9454bdc837336.wasm!std::rt::lang_start_internal::h19bf9a2af7de177a 19: 0x9a8 - truncation_rights-06a9454bdc837336.wasm!std::rt::lang_start::h7e9d90ed271da6fe 20: 0x33d4 - truncation_rights-06a9454bdc837336.wasm!__main_void 21: 0x5b2 - truncation_rights-06a9454bdc837336.wasm!_start 2: wasm trap: wasm unreachable instruction executed

path_filestat.rs:29: unexpected ENOTSUP

Test path_filestat failed
  [exit_code] 0 == 134
STDOUT:

STDERR:

thread 'main' panicked at src/bin/path_filestat.rs:29:6: opening a file: Errno { code: 58, name: "NOTSUP", message: "Not supported, or operation not supported on socket." } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: failed to run main module /home/wingo/src/wasip3/wasi-testsuite/tests/rust/testsuite/path_filestat.wasm

Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0x1452e - path_filestat-be1b958e60404974.wasm!abort 1: 0x100ed - path_filestat-be1b958e60404974.wasm!std::sys::pal::wasi::helpers::abort_internal::hcc3b2e0cde3c9001 2: 0xd8b0 - path_filestat-be1b958e60404974.wasm!std::process::abort::h0e38511b4c8b6f04 3: 0xd8a6 - path_filestat-be1b958e60404974.wasm!__rustc[5224e6b81cd82a8f]::__rust_abort 4: 0x1163d - path_filestat-be1b958e60404974.wasm!__rustc[5224e6b81cd82a8f]::__rust_start_panic 5: 0x114ae - path_filestat-be1b958e60404974.wasm!__rustc[5224e6b81cd82a8f]::rust_panic 6: 0x11433 - path_filestat-be1b958e60404974.wasm!std::panicking::rust_panic_with_hook::h085fb375cd657b2f 7: 0x1049d - path_filestat-be1b958e60404974.wasm!std::panicking::begin_panic_handler::{{closure}}::he68af7f9d5c53e56 8: 0x10409 - path_filestat-be1b958e60404974.wasm!std::sys::backtrace::__rust_end_short_backtrace::h4c38003a22ca226f 9: 0x10e1a - path_filestat-be1b958e60404974.wasm!__rustc[5224e6b81cd82a8f]::rust_begin_unwind 10: 0x16034 - path_filestat-be1b958e60404974.wasm!core::panicking::panic_fmt::h4e32e8d1cab5f47e 11: 0x17850 - path_filestat-be1b958e60404974.wasm!core::result::unwrap_failed::heb00d4d50e638a08 12: 0x6ea7 - path_filestat-be1b958e60404974.wasm!core::result::Result<T,E>::expect::h431772895bda03ab 13: 0x3cfb - path_filestat-be1b958e60404974.wasm!path_filestat::test_path_filestat::hfa5ab1d011b1b5de 14: 0x5a79 - path_filestat-be1b958e60404974.wasm!path_filestat::main::h374a27f2a65d7263 15: 0xacc - path_filestat-be1b958e60404974.wasm!core::ops::function::FnOnce::call_once::h511817eb8dd320cb 16: 0xa97 - path_filestat-be1b958e60404974.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h6966d1505053aacd 17: 0xa75 - path_filestat-be1b958e60404974.wasm!std::rt::lang_start::{{closure}}::h4e2bae0c9cc7528e 18: 0xdd93 - path_filestat-be1b958e60404974.wasm!std::rt::lang_start_internal::h19bf9a2af7de177a 19: 0xa49 - path_filestat-be1b958e60404974.wasm!std::rt::lang_start::hb5f551ef7996482e 20: 0x5b69 - path_filestat-be1b958e60404974.wasm!__main_void 21: 0x653 - path_filestat-be1b958e60404974.wasm!_start 2: wasm trap: wasm unreachable instruction executed

file_allocate.rs:30: unexpected ENOTSUP

Test file_allocate failed
  [exit_code] 0 == 134
STDOUT:

STDERR:

thread 'main' panicked at src/bin/file_allocate.rs:30:44: allocating size: Errno { code: 58, name: "NOTSUP", message: "Not supported, or operation not supported on socket." } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: failed to run main module /home/wingo/src/wasip3/wasi-testsuite/tests/rust/testsuite/file_allocate.wasm

Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0x11c62 - file_allocate-811c635520e9477c.wasm!abort 1: 0xd836 - file_allocate-811c635520e9477c.wasm!std::sys::pal::wasi::helpers::abort_internal::hcc3b2e0cde3c9001 2: 0xaff9 - file_allocate-811c635520e9477c.wasm!std::process::abort::h0e38511b4c8b6f04 3: 0xafef - file_allocate-811c635520e9477c.wasm!__rustc[5224e6b81cd82a8f]::__rust_abort 4: 0xed86 - file_allocate-811c635520e9477c.wasm!__rustc[5224e6b81cd82a8f]::__rust_start_panic 5: 0xebf7 - file_allocate-811c635520e9477c.wasm!__rustc[5224e6b81cd82a8f]::rust_panic 6: 0xeb7c - file_allocate-811c635520e9477c.wasm!std::panicking::rust_panic_with_hook::h085fb375cd657b2f 7: 0xdbe6 - file_allocate-811c635520e9477c.wasm!std::panicking::begin_panic_handler::{{closure}}::he68af7f9d5c53e56 8: 0xdb52 - file_allocate-811c635520e9477c.wasm!std::sys::backtrace::__rust_end_short_backtrace::h4c38003a22ca226f 9: 0xe563 - file_allocate-811c635520e9477c.wasm!__rustc[5224e6b81cd82a8f]::rust_begin_unwind 10: 0x136ee - file_allocate-811c635520e9477c.wasm!core::panicking::panic_fmt::h4e32e8d1cab5f47e 11: 0x14f0a - file_allocate-811c635520e9477c.wasm!core::result::unwrap_failed::heb00d4d50e638a08 12: 0x4802 - file_allocate-811c635520e9477c.wasm!core::result::Result<T,E>::expect::h5a9a0bfff6ae2382 13: 0x2055 - file_allocate-811c635520e9477c.wasm!file_allocate::test_file_allocate::hfc1a610a067fe0b7 14: 0x3234 - file_allocate-811c635520e9477c.wasm!file_allocate::main::hf6f22ece0e5b9b02 15: 0x895 - file_allocate-811c635520e9477c.wasm!core::ops::function::FnOnce::call_once::h895ed85d468fff7c 16: 0x860 - file_allocate-811c635520e9477c.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h72ee5fbe33c7d837 17: 0x83e - file_allocate-811c635520e9477c.wasm!std::rt::lang_start::{{closure}}::h7d9fad005a5fcab6 18: 0xb4dc - file_allocate-811c635520e9477c.wasm!std::rt::lang_start_internal::h19bf9a2af7de177a 19: 0x812 - file_allocate-811c635520e9477c.wasm!std::rt::lang_start::h848cb6a5d9bd8945 20: 0x3324 - file_allocate-811c635520e9477c.wasm!__main_void 21: 0x618 - file_allocate-811c635520e9477c.wasm!_start 2: wasm trap: wasm unreachable instruction executed

remove_directory_trailing_slashes.rs:19: EINVAL

Test remove_directory_trailing_slashes failed
  [exit_code] 0 == 134
STDOUT:

STDERR:

thread 'main' panicked at src/bin/remove_directory_trailing_slashes.rs:19:10: remove_directory with a trailing slash on a directory should succeed: Errno { code: 28, name: "INVAL", message: "Invalid argument." } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: failed to run main module /home/wingo/src/wasip3/wasi-testsuite/tests/rust/testsuite/remove_directory_trailing_slashes.wasm

Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0x13877 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!abort 1: 0xf436 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::sys::pal::wasi::helpers::abort_internal::hcc3b2e0cde3c9001 2: 0xcbf9 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::process::abort::h0e38511b4c8b6f04 3: 0xcbef - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!__rustc[5224e6b81cd82a8f]::__rust_abort 4: 0x10986 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!__rustc[5224e6b81cd82a8f]::__rust_start_panic 5: 0x107f7 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!__rustc[5224e6b81cd82a8f]::rust_panic 6: 0x1077c - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::panicking::rust_panic_with_hook::h085fb375cd657b2f 7: 0xf7e6 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::panicking::begin_panic_handler::{{closure}}::he68af7f9d5c53e56 8: 0xf752 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::sys::backtrace::__rust_end_short_backtrace::h4c38003a22ca226f 9: 0x10163 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!__rustc[5224e6b81cd82a8f]::rust_begin_unwind 10: 0x15336 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!core::panicking::panic_fmt::h4e32e8d1cab5f47e 11: 0x16b52 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!core::result::unwrap_failed::heb00d4d50e638a08 12: 0x6699 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!core::result::Result<T,E>::expect::h5a9a0bfff6ae2382 13: 0x4036 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!remove_directory_trailing_slashes::test_remove_directory_trailing_slashes::hcb80a30e54ba33fc 14: 0x5128 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!remove_directory_trailing_slashes::main::h5a9e81ed868fb64e 15: 0xa47 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!core::ops::function::FnOnce::call_once::hc8b9897f8a9c4b24 16: 0xa12 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h93455bc94e8a1992 17: 0x9f0 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::rt::lang_start::{{closure}}::hd546ee509a4c9f4a 18: 0xd0dc - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::rt::lang_start_internal::h19bf9a2af7de177a 19: 0x9c4 - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!std::rt::lang_start::h9473ee18f1d371a8 20: 0x51bb - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!__main_void 21: 0x5ce - remove_directory_trailing_slashes-244c1cf56d7c3578.wasm!_start 2: wasm trap: wasm unreachable instruction executed

path_link.rs:52: link fdstat missing 0x40 flag [*]

Test path_link failed
  [exit_code] 0 == 134
STDOUT:

STDERR:

thread 'main' panicked at src/bin/path_link.rs:52:5: assertion left == right failed: fs_rights_base should be equal left: 1073741823 right: 1073741759 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: failed to run main module /home/wingo/src/wasip3/wasi-testsuite/tests/rust/testsuite/path_link.wasm

Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0x18756 - path_link-53142c80c4b8fd95.wasm!abort 1: 0x14315 - path_link-53142c80c4b8fd95.wasm!std::sys::pal::wasi::helpers::abort_internal::hcc3b2e0cde3c9001 2: 0x11ad8 - path_link-53142c80c4b8fd95.wasm!std::process::abort::h0e38511b4c8b6f04 3: 0x11ace - path_link-53142c80c4b8fd95.wasm!__rustc[5224e6b81cd82a8f]::__rust_abort 4: 0x15865 - path_link-53142c80c4b8fd95.wasm!__rustc[5224e6b81cd82a8f]::__rust_start_panic 5: 0x156d6 - path_link-53142c80c4b8fd95.wasm!__rustc[5224e6b81cd82a8f]::rust_panic 6: 0x1565b - path_link-53142c80c4b8fd95.wasm!std::panicking::rust_panic_with_hook::h085fb375cd657b2f 7: 0x146c5 - path_link-53142c80c4b8fd95.wasm!std::panicking::begin_panic_handler::{{closure}}::he68af7f9d5c53e56 8: 0x14631 - path_link-53142c80c4b8fd95.wasm!std::sys::backtrace::__rust_end_short_backtrace::h4c38003a22ca226f 9: 0x15042 - path_link-53142c80c4b8fd95.wasm!__rustc[5224e6b81cd82a8f]::rust_begin_unwind 10: 0x1a25c - path_link-53142c80c4b8fd95.wasm!core::panicking::panic_fmt::h4e32e8d1cab5f47e 11: 0x1c04f - path_link-53142c80c4b8fd95.wasm!core::panicking::assert_failed_inner::hf7ede4d3870aaaec 12: 0x1a1e1 - path_link-53142c80c4b8fd95.wasm!core::panicking::assert_failed::ha0414e0a634ffb40 13: 0x6864 - path_link-53142c80c4b8fd95.wasm!path_link::fdstats_assert_eq::hdfc3eaf474c8d636 14: 0x7055 - path_link-53142c80c4b8fd95.wasm!path_link::check_rights::h79b47683ac59f8be 15: 0x7163 - path_link-53142c80c4b8fd95.wasm!path_link::test_path_link::h483f17fe13a5b4e1 16: 0x956c - path_link-53142c80c4b8fd95.wasm!path_link::main::hbaf84a3363ad7908 17: 0xaf5 - path_link-53142c80c4b8fd95.wasm!core::ops::function::FnOnce::call_once::ha977048562b5427c 18: 0xac0 - path_link-53142c80c4b8fd95.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h5ae9b98778c154eb 19: 0xa9e - path_link-53142c80c4b8fd95.wasm!std::rt::lang_start::{{closure}}::h5641e85ddada4c4f 20: 0x11fbb - path_link-53142c80c4b8fd95.wasm!std::rt::lang_start_internal::h19bf9a2af7de177a 21: 0xa72 - path_link-53142c80c4b8fd95.wasm!std::rt::lang_start::h8bf533004e7b6e2a 22: 0x965c - path_link-53142c80c4b8fd95.wasm!__main_void 23: 0x67c - path_link-53142c80c4b8fd95.wasm!_start 2: wasm trap: wasm unreachable instruction executed

fd_advise.rs:46: ENOTSUP

Test fd_advise failed
  [exit_code] 0 == 134
STDOUT:

STDERR:

thread 'main' panicked at src/bin/fd_advise.rs:46:46: allocating size: Errno { code: 58, name: "NOTSUP", message: "Not supported, or operation not supported on socket." } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: failed to run main module /home/wingo/src/wasip3/wasi-testsuite/tests/rust/testsuite/fd_advise.wasm

Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0x11463 - fd_advise-6b73f47db6633b38.wasm!abort 1: 0xd037 - fd_advise-6b73f47db6633b38.wasm!std::sys::pal::wasi::helpers::abort_internal::hcc3b2e0cde3c9001 2: 0xa7fa - fd_advise-6b73f47db6633b38.wasm!std::process::abort::h0e38511b4c8b6f04 3: 0xa7f0 - fd_advise-6b73f47db6633b38.wasm!__rustc[5224e6b81cd82a8f]::__rust_abort 4: 0xe587 - fd_advise-6b73f47db6633b38.wasm!__rustc[5224e6b81cd82a8f]::__rust_start_panic 5: 0xe3f8 - fd_advise-6b73f47db6633b38.wasm!__rustc[5224e6b81cd82a8f]::rust_panic 6: 0xe37d - fd_advise-6b73f47db6633b38.wasm!std::panicking::rust_panic_with_hook::h085fb375cd657b2f 7: 0xd3e7 - fd_advise-6b73f47db6633b38.wasm!std::panicking::begin_panic_handler::{{closure}}::he68af7f9d5c53e56 8: 0xd353 - fd_advise-6b73f47db6633b38.wasm!std::sys::backtrace::__rust_end_short_backtrace::h4c38003a22ca226f 9: 0xdd64 - fd_advise-6b73f47db6633b38.wasm!__rustc[5224e6b81cd82a8f]::rust_begin_unwind 10: 0x12eef - fd_advise-6b73f47db6633b38.wasm!core::panicking::panic_fmt::h4e32e8d1cab5f47e 11: 0x1470b - fd_advise-6b73f47db6633b38.wasm!core::result::unwrap_failed::heb00d4d50e638a08 12: 0x40fe - fd_advise-6b73f47db6633b38.wasm!core::result::Result<T,E>::expect::h5a9a0bfff6ae2382 13: 0x2488 - fd_advise-6b73f47db6633b38.wasm!fd_advise::test_fd_advise::h2f06139598c81546 14: 0x2b8d - fd_advise-6b73f47db6633b38.wasm!fd_advise::main::hec04507fcf0eb0e1 15: 0x8a3 - fd_advise-6b73f47db6633b38.wasm!core::ops::function::FnOnce::call_once::h616c670c4b998f7b 16: 0x86e - fd_advise-6b73f47db6633b38.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h7dda6033e727f889 17: 0x84c - fd_advise-6b73f47db6633b38.wasm!std::rt::lang_start::{{closure}}::hc8d7c7156233a02f 18: 0xacdd - fd_advise-6b73f47db6633b38.wasm!std::rt::lang_start_internal::h19bf9a2af7de177a 19: 0x820 - fd_advise-6b73f47db6633b38.wasm!std::rt::lang_start::hc74ed36b3508538d 20: 0x2c20 - fd_advise-6b73f47db6633b38.wasm!__main_void 21: 0x626 - fd_advise-6b73f47db6633b38.wasm!_start 2: wasm trap: wasm unreachable instruction executed

fd_fdstat_set_rights.rs:51: dropped rights, but rights are still there

Test fd_fdstat_set_rights failed
  [exit_code] 0 == 134
STDOUT:

STDERR:

thread 'main' panicked at src/bin/fd_fdstat_set_rights.rs:51:5: assertion left == right failed: base rights should not have FD_READ | FD_WRITE left: 66 right: 0 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: failed to run main module /home/wingo/src/wasip3/wasi-testsuite/tests/rust/testsuite/fd_fdstat_set_rights.wasm

Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0x10e0e - fd_fdstat_set_rights-4856c93a50adf571.wasm!abort 1: 0xc90c - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::sys::pal::wasi::helpers::abort_internal::hcc3b2e0cde3c9001 2: 0xa5c2 - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::process::abort::h0e38511b4c8b6f04 3: 0xa5b8 - fd_fdstat_set_rights-4856c93a50adf571.wasm!__rustc[5224e6b81cd82a8f]::__rust_abort 4: 0xde5c - fd_fdstat_set_rights-4856c93a50adf571.wasm!__rustc[5224e6b81cd82a8f]::__rust_start_panic 5: 0xdccd - fd_fdstat_set_rights-4856c93a50adf571.wasm!__rustc[5224e6b81cd82a8f]::rust_panic 6: 0xdc52 - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::panicking::rust_panic_with_hook::h085fb375cd657b2f 7: 0xccbc - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::panicking::begin_panic_handler::{{closure}}::he68af7f9d5c53e56 8: 0xcc28 - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::sys::backtrace::__rust_end_short_backtrace::h4c38003a22ca226f 9: 0xd639 - fd_fdstat_set_rights-4856c93a50adf571.wasm!__rustc[5224e6b81cd82a8f]::rust_begin_unwind 10: 0x1287c - fd_fdstat_set_rights-4856c93a50adf571.wasm!core::panicking::panic_fmt::h4e32e8d1cab5f47e 11: 0x1459a - fd_fdstat_set_rights-4856c93a50adf571.wasm!core::panicking::assert_failed_inner::hf7ede4d3870aaaec 12: 0x12801 - fd_fdstat_set_rights-4856c93a50adf571.wasm!core::panicking::assert_failed::ha0414e0a634ffb40 13: 0x3606 - fd_fdstat_set_rights-4856c93a50adf571.wasm!fd_fdstat_set_rights::test_fd_fdstat_set_rights::h1d0281e2be6addeb 14: 0x4744 - fd_fdstat_set_rights-4856c93a50adf571.wasm!fd_fdstat_set_rights::main::hf4ed699f5c4829f5 15: 0xaa7 - fd_fdstat_set_rights-4856c93a50adf571.wasm!core::ops::function::FnOnce::call_once::hf8ec59f6bd73407a 16: 0xa72 - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h065801d1b93871de 17: 0xa50 - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::rt::lang_start::{{closure}}::hde924d03de8f08f6 18: 0xaaa5 - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::rt::lang_start_internal::h19bf9a2af7de177a 19: 0xa24 - fd_fdstat_set_rights-4856c93a50adf571.wasm!std::rt::lang_start::hc1a2309b87a30156 20: 0x4834 - fd_fdstat_set_rights-4856c93a50adf571.wasm!__main_void 21: 0x62e - fd_fdstat_set_rights-4856c93a50adf571.wasm!_start 2: wasm trap: wasm unreachable instruction executed

renumber.rs:76: wasi::fd_renumber unexpectedly allowed a renumbering

Test renumber failed
  [exit_code] 0 == 134
STDOUT:

STDERR:

thread 'main' panicked at src/bin/renumber.rs:76:43: fd_renumber should not allow renumbering to invalid destination file descriptors: () note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error: failed to run main module /home/wingo/src/wasip3/wasi-testsuite/tests/rust/testsuite/renumber.wasm

Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0x10285 - renumber-e7cade739cf1defb.wasm!abort 1: 0xbe44 - renumber-e7cade739cf1defb.wasm!std::sys::pal::wasi::helpers::abort_internal::hcc3b2e0cde3c9001 2: 0x9afa - renumber-e7cade739cf1defb.wasm!std::process::abort::h0e38511b4c8b6f04 3: 0x9af0 - renumber-e7cade739cf1defb.wasm!__rustc[5224e6b81cd82a8f]::__rust_abort 4: 0xd394 - renumber-e7cade739cf1defb.wasm!__rustc[5224e6b81cd82a8f]::__rust_start_panic 5: 0xd205 - renumber-e7cade739cf1defb.wasm!__rustc[5224e6b81cd82a8f]::rust_panic 6: 0xd18a - renumber-e7cade739cf1defb.wasm!std::panicking::rust_panic_with_hook::h085fb375cd657b2f 7: 0xc1f4 - renumber-e7cade739cf1defb.wasm!std::panicking::begin_panic_handler::{{closure}}::he68af7f9d5c53e56 8: 0xc160 - renumber-e7cade739cf1defb.wasm!std::sys::backtrace::__rust_end_short_backtrace::h4c38003a22ca226f 9: 0xcb71 - renumber-e7cade739cf1defb.wasm!__rustc[5224e6b81cd82a8f]::rust_begin_unwind 10: 0x11cf3 - renumber-e7cade739cf1defb.wasm!core::panicking::panic_fmt::h4e32e8d1cab5f47e 11: 0x1350f - renumber-e7cade739cf1defb.wasm!core::result::unwrap_failed::heb00d4d50e638a08 12: 0x2276 - renumber-e7cade739cf1defb.wasm!core::result::Result<T,E>::expect_err::h3c734bba424697cd 13: 0x3217 - renumber-e7cade739cf1defb.wasm!renumber::test_renumber::h45c58dd93e720650 14: 0x3a26 - renumber-e7cade739cf1defb.wasm!renumber::main::h533ce606536a485f 15: 0xa16 - renumber-e7cade739cf1defb.wasm!core::ops::function::FnOnce::call_once::h7fe43baafd4a9830 16: 0x9e1 - renumber-e7cade739cf1defb.wasm!std::sys::backtrace::__rust_begin_short_backtrace::hae14fc0815fb3867 17: 0x9bf - renumber-e7cade739cf1defb.wasm!std::rt::lang_start::{{closure}}::h0aaa978f081b8e4f 18: 0x9fdd - renumber-e7cade739cf1defb.wasm!std::rt::lang_start_internal::h19bf9a2af7de177a 19: 0x993 - renumber-e7cade739cf1defb.wasm!std::rt::lang_start::hc5ad50fe7d7c81e9 20: 0x3b16 - renumber-e7cade739cf1defb.wasm!__main_void 21: 0x59d - renumber-e7cade739cf1defb.wasm!_start 2: wasm trap: wasm unreachable instruction executed

wingo avatar Aug 21 '25 14:08 wingo

For each of these tests, we should classify it as one of the following:

  • test case is too picky; it expects an over-constrained interpretation of wasip1
  • wasmtime has a bug that should be fixed
  • wasmtime deviates from wasip1, but in a way that won't be changed

Obviously the first two cases are best, but the decision is up to the runtime maintainers as to what to do.

wingo avatar Aug 21 '25 14:08 wingo

For truncation_rights.rs, path_link.rs, and fd_fdstat_set_rights.rs Wasmtime is basically in "compat mode" with rights-related things and generally doesn't implement rights any more except where necessary to appease wasi-libc. In that sense those are at-a-glance unlikely to change behavior in Wasmtime. Given that WASIp2-and-beyond have jettisoned rights-related bits, it might make sense to codify that in this test suite and basically say that tests expecting rights to work are too picky?

For path_filestat.rs that looks like a bug in Wasmtime maybe? Or maybe a bug in the test? My guess is it's something to do with the open mode or something like that, e.g. a missing flag or something or other. I'd have to dig into wasmtime-wasi to figure out more.

For fd_advise.rs and file_allocate.rs that's not implemented in Wasmtime due to spotty support on Linux filesystems and no support on Windows or macOS. This is another case where the API is jettisoned in WASIp2 so it may also make sense to just assert that the API always returns "failure" in the test?

For renumber.rs that seems reasonable to me to bring Wasmtime in-line with what the test and other runtimes are doing (aka reasonable to consider that a bug in Wasmtime)

alexcrichton avatar Aug 21 '25 19:08 alexcrichton

For path_filestat.rs the error as shown is ENOTSUP when opening with FDFLAGS_SYNC: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi/src/filesystem.rs#L943.

wingo avatar Aug 22 '25 09:08 wingo

For remove_directory_trailing_slashes, there appears to be a bug somewhere in cap-std. If I strace the process I get:

mkdirat(11, "dir.cleanup", 0777)        = 0
unlinkat(11, "dir.cleanup", AT_REMOVEDIR) = 0
mkdirat(11, "dir.cleanup", 0777)        = 0
openat2(11, "dir.cleanup/", {flags=O_RDONLY|O_CLOEXEC|O_PATH|O_DIRECTORY, resolve=RESOLVE_NO_MAGICLINKS|RESOLVE_BENEATH}, 24) = 12
unlinkat(12, ".", AT_REMOVEDIR)         = -1 EINVAL (Invalid argument)

(The error being that we try to remove "." from a directory instead of the directory from its parent.)

wingo avatar Aug 22 '25 12:08 wingo

@alexcrichton wdyt about making fd_fdstat_set_rights() in wasmtime return ENOTSUP ? AFAICS it is not used in wasi-libc, and other users (if any) would be better served by an error than a silent success. In that case we could adapt the wasi-testsuite test case to skip if ENOTSUP.

wingo avatar Aug 25 '25 08:08 wingo

That seems reasonable to me yeah!

alexcrichton avatar Aug 25 '25 14:08 alexcrichton