Stream: git-wasmtime

Topic: wasmtime / issue #7429 The preview2_tcp_bind test is flaky


view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2023 at 19:18):

alexcrichton opened issue #7429:

I can't figure out what's going on here so I'm going to open a tracking issue. This if for this failure which looks like this:

<details>

---- async_::preview2_tcp_bind stdout ----
preopen: TempDir { path: "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\wasi_components_preview2_tcp_bind.component_hZxoQE" }
[guest] stderr:
thread 'main' panicked at crates\test-programs\src\bin\preview2_tcp_bind.rs:34:19:
error: access-denied (error 1)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

===
thread 'async_::preview2_tcp_bind' panicked at crates\wasi\tests\all\async_.rs:319:51:
called `Result::unwrap()` on an `Err` value: error while executing at wasm backtrace:
    0: 0xe2f1 - <unknown>!__rust_start_panic
    1: 0xe141 - <unknown>!rust_panic
    2: 0xe11e - <unknown>!std::panicking::rust_panic_with_hook::hc93abff18edee779
    3: 0xd4ca - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h922bcdd9c6fdedfb
    4: 0xd3f7 - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h2597d6ecb1d3419e
    5: 0xda39 - <unknown>!rust_begin_unwind
    6: 0x129c1 - <unknown>!core::panicking::panic_fmt::h35d9e7e9c02f9eb5
    7: 0x2f82 - <unknown>!preview2_tcp_bind::test_tcp_bind_specific_port::he40761acd6a2af48
    8: 0x4e9e - <unknown>!preview2_tcp_bind::main::h47d079031e93f9b9
    9: 0x17d1 - <unknown>!core::ops::function::FnOnce::call_once::h1a7ef71025f93dd4
   10: 0x17a8 - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::h93f974fb575844d0
   11: 0x1889 - <unknown>!std::rt::lang_start::{{closure}}::h64df62ed2be5009e
   12: 0xb925 - <unknown>!std::rt::lang_start_internal::h394de9c4666f4612
   13: 0x1834 - <unknown>!std::rt::lang_start::h103283f62218f32f
   14: 0x5466 - <unknown>!__main_void
   15: 0x1783 - <unknown>!_start
   16: 0x2e103c - wit-component:adapter:wasi_snapshot_preview1!wasi:cli/run@0.2.0-rc-2023-11-05#run
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information

Caused by:
    wasm trap: wasm `unreachable` instruction executed
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src/result.rs:1652:5
   3: core::result::Result<T,E>::unwrap
   4: all::async_::preview2_tcp_bind::{{closure}}::test_impl::{{closure}}
   5: all::async_::preview2_tcp_bind::{{closure}}
   6: <core::pin::Pin<P> as core::future::future::Future>::poll
   7: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
   8: tokio::runtime::park::CachedParkThread::block_on
   9: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
  10: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
  11: tokio::runtime::context::runtime::enter_runtime
  12: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
  13: tokio::runtime::runtime::Runtime::block_on
  14: all::async_::preview2_tcp_bind
  15: all::async_::preview2_tcp_bind::{{closure}}
  16: core::ops::function::FnOnce::call_once
  17: core::ops::function::FnOnce::call_once
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- sync::preview2_tcp_bind stdout ----
preopen: TempDir { path: "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\wasi_components_preview2_tcp_bind.component_TmfeeA" }
[guest] stderr:
thread 'main' panicked at crates\test-programs\src\bin\preview2_tcp_bind.rs:34:19:
error: access-denied (error 1)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

===
thread 'sync::preview2_tcp_bind' panicked at crates\wasi\tests\all\sync.rs:262:45:
called `Result::unwrap()` on an `Err` value: error while executing at wasm backtrace:
    0: 0xe2f1 - <unknown>!__rust_start_panic
    1: 0xe141 - <unknown>!rust_panic
error: test failed, to rerun pass `-p wasmtime-wasi --test all`
    2: 0xe11e - <unknown>!std::panicking::rust_panic_with_hook::hc93abff18edee779
    3: 0xd4ca - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h922bcdd9c6fdedfb
    4: 0xd3f7 - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h2597d6ecb1d3419e
    5: 0xda39 - <unknown>!rust_begin_unwind
    6: 0x129c1 - <unknown>!core::panicking::panic_fmt::h35d9e7e9c02f9eb5
    7: 0x2f82 - <unknown>!preview2_tcp_bind::test_tcp_bind_specific_port::he40761acd6a2af48
    8: 0x4e9e - <unknown>!preview2_tcp_bind::main::h47d079031e93f9b9
    9: 0x17d1 - <unknown>!core::ops::function::FnOnce::call_once::h1a7ef71025f93dd4
   10: 0x17a8 - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::h93f974fb575844d0
   11: 0x1889 - <unknown>!std::rt::lang_start::{{closure}}::h64df62ed2be5009e
   12: 0xb925 - <unknown>!std::rt::lang_start_internal::h394de9c4666f4612
   13: 0x1834 - <unknown>!std::rt::lang_start::h103283f62218f32f
   14: 0x5466 - <unknown>!__main_void
   15: 0x1783 - <unknown>!_start
   16: 0x2e103c - wit-component:adapter:wasi_snapshot_preview1!wasi:cli/run@0.2.0-rc-2023-11-05#run
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information

Caused by:
    wasm trap: wasm `unreachable` instruction executed
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src/result.rs:1652:5
   3: core::result::Result<T,E>::unwrap
   4: all::sync::preview2_tcp_bind::test_impl
   5: all::sync::preview2_tcp_bind
   6: all::sync::preview2_tcp_bind::{{closure}}
   7: core::ops::function::FnOnce::call_once
   8: core::ops::function::FnOnce::call_once
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    async_::preview2_tcp_bind
    sync::preview2_tcp_bind

test result: FAILED. 170 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 300.39s

</details>

This is on the MinGW platform (so Windows) and the precise commit at the time was https://github.com/bytecodealliance/wasmtime/commit/cd895435378182bdf7473ee99b8148b6f32204db.

I also saw this before with a similar failure (but slightly different code)

I'm running this in a loop locally on Windows and it's not failing, so I'm not entirely sure.

cc @badeend

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2023 at 20:22):

badeend commented on issue #7429:

@alexcrichton I think this is exactly the same issue as https://github.com/bytecodealliance/wasmtime/pull/7339, except that Windows sometimes returns EACCESS instead of EADDRINUSE (depending on some arcane rules I still don't fully understand)

Hopefully, changing Err(ErrorCode::AddressInUse) => {} to Err(ErrorCode::AddressInUse | ErrorCode::AccessDenied) => {} in the test will "fix" this.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2023 at 21:32):

alexcrichton commented on issue #7429:

Oh wow now that is a set of tables! Makes sense though, and thanks for pointing that out! I'll look to add this tomorrow unless you beat me to it

view this post on Zulip Wasmtime GitHub notifications bot (Nov 01 2023 at 17:23):

fitzgen closed issue #7429:

I can't figure out what's going on here so I'm going to open a tracking issue. This if for this failure which looks like this:

<details>

---- async_::preview2_tcp_bind stdout ----
preopen: TempDir { path: "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\wasi_components_preview2_tcp_bind.component_hZxoQE" }
[guest] stderr:
thread 'main' panicked at crates\test-programs\src\bin\preview2_tcp_bind.rs:34:19:
error: access-denied (error 1)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

===
thread 'async_::preview2_tcp_bind' panicked at crates\wasi\tests\all\async_.rs:319:51:
called `Result::unwrap()` on an `Err` value: error while executing at wasm backtrace:
    0: 0xe2f1 - <unknown>!__rust_start_panic
    1: 0xe141 - <unknown>!rust_panic
    2: 0xe11e - <unknown>!std::panicking::rust_panic_with_hook::hc93abff18edee779
    3: 0xd4ca - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h922bcdd9c6fdedfb
    4: 0xd3f7 - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h2597d6ecb1d3419e
    5: 0xda39 - <unknown>!rust_begin_unwind
    6: 0x129c1 - <unknown>!core::panicking::panic_fmt::h35d9e7e9c02f9eb5
    7: 0x2f82 - <unknown>!preview2_tcp_bind::test_tcp_bind_specific_port::he40761acd6a2af48
    8: 0x4e9e - <unknown>!preview2_tcp_bind::main::h47d079031e93f9b9
    9: 0x17d1 - <unknown>!core::ops::function::FnOnce::call_once::h1a7ef71025f93dd4
   10: 0x17a8 - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::h93f974fb575844d0
   11: 0x1889 - <unknown>!std::rt::lang_start::{{closure}}::h64df62ed2be5009e
   12: 0xb925 - <unknown>!std::rt::lang_start_internal::h394de9c4666f4612
   13: 0x1834 - <unknown>!std::rt::lang_start::h103283f62218f32f
   14: 0x5466 - <unknown>!__main_void
   15: 0x1783 - <unknown>!_start
   16: 0x2e103c - wit-component:adapter:wasi_snapshot_preview1!wasi:cli/run@0.2.0-rc-2023-11-05#run
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information

Caused by:
    wasm trap: wasm `unreachable` instruction executed
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src/result.rs:1652:5
   3: core::result::Result<T,E>::unwrap
   4: all::async_::preview2_tcp_bind::{{closure}}::test_impl::{{closure}}
   5: all::async_::preview2_tcp_bind::{{closure}}
   6: <core::pin::Pin<P> as core::future::future::Future>::poll
   7: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
   8: tokio::runtime::park::CachedParkThread::block_on
   9: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
  10: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
  11: tokio::runtime::context::runtime::enter_runtime
  12: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
  13: tokio::runtime::runtime::Runtime::block_on
  14: all::async_::preview2_tcp_bind
  15: all::async_::preview2_tcp_bind::{{closure}}
  16: core::ops::function::FnOnce::call_once
  17: core::ops::function::FnOnce::call_once
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- sync::preview2_tcp_bind stdout ----
preopen: TempDir { path: "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\wasi_components_preview2_tcp_bind.component_TmfeeA" }
[guest] stderr:
thread 'main' panicked at crates\test-programs\src\bin\preview2_tcp_bind.rs:34:19:
error: access-denied (error 1)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

===
thread 'sync::preview2_tcp_bind' panicked at crates\wasi\tests\all\sync.rs:262:45:
called `Result::unwrap()` on an `Err` value: error while executing at wasm backtrace:
    0: 0xe2f1 - <unknown>!__rust_start_panic
    1: 0xe141 - <unknown>!rust_panic
error: test failed, to rerun pass `-p wasmtime-wasi --test all`
    2: 0xe11e - <unknown>!std::panicking::rust_panic_with_hook::hc93abff18edee779
    3: 0xd4ca - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h922bcdd9c6fdedfb
    4: 0xd3f7 - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h2597d6ecb1d3419e
    5: 0xda39 - <unknown>!rust_begin_unwind
    6: 0x129c1 - <unknown>!core::panicking::panic_fmt::h35d9e7e9c02f9eb5
    7: 0x2f82 - <unknown>!preview2_tcp_bind::test_tcp_bind_specific_port::he40761acd6a2af48
    8: 0x4e9e - <unknown>!preview2_tcp_bind::main::h47d079031e93f9b9
    9: 0x17d1 - <unknown>!core::ops::function::FnOnce::call_once::h1a7ef71025f93dd4
   10: 0x17a8 - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::h93f974fb575844d0
   11: 0x1889 - <unknown>!std::rt::lang_start::{{closure}}::h64df62ed2be5009e
   12: 0xb925 - <unknown>!std::rt::lang_start_internal::h394de9c4666f4612
   13: 0x1834 - <unknown>!std::rt::lang_start::h103283f62218f32f
   14: 0x5466 - <unknown>!__main_void
   15: 0x1783 - <unknown>!_start
   16: 0x2e103c - wit-component:adapter:wasi_snapshot_preview1!wasi:cli/run@0.2.0-rc-2023-11-05#run
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information

Caused by:
    wasm trap: wasm `unreachable` instruction executed
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src/result.rs:1652:5
   3: core::result::Result<T,E>::unwrap
   4: all::sync::preview2_tcp_bind::test_impl
   5: all::sync::preview2_tcp_bind
   6: all::sync::preview2_tcp_bind::{{closure}}
   7: core::ops::function::FnOnce::call_once
   8: core::ops::function::FnOnce::call_once
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    async_::preview2_tcp_bind
    sync::preview2_tcp_bind

test result: FAILED. 170 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 300.39s

</details>

This is on the MinGW platform (so Windows) and the precise commit at the time was https://github.com/bytecodealliance/wasmtime/commit/cd895435378182bdf7473ee99b8148b6f32204db.

I also saw this before with a similar failure (but slightly different code)

I'm running this in a loop locally on Windows and it's not failing, so I'm not entirely sure.

cc @badeend


Last updated: Oct 23 2024 at 20:03 UTC