Stream: git-wasmtime

Topic: wasmtime / issue #13398 wasip3: `sockets-udp-send::test_w...


view this post on Zulip Wasmtime GitHub notifications bot (May 16 2026 at 12:55):

cataggar opened issue #13398:

Summary

The upstream wasi-testsuite fixture wasm32-wasip3/sockets-udp-send (tests/rust/wasm32-wasip3/src/bin/sockets-udp-send.rs's test_wrong_address_family) panics on wasmtime 44.0.1 (first stable release with -Sp3 support). The fixture creates a UDP socket bound to one address family and sends a packet to an address of the other family, expecting ErrorCode::InvalidArgument. wasmtime returns something other than Err(InvalidArgument) and the matches! assertion panics.

Reproduction

cd tests/rust/wasm32-wasip3 && make build && cd -
wasmtime -Wcomponent-model-async -Sp3,inherit-network \
    tests/rust/testsuite/wasm32-wasip3/sockets-udp-send.wasm

Output (trimmed):

thread '<unnamed>' (1) panicked at src/bin/sockets-udp-send.rs:21:5:
assertion failed: matches!(result, Err(ErrorCode::InvalidArgument))

   12:   0x44e2 - sockets_udp_send!sockets_udp_send::test_wrong_address_family::{closure#0}

    1: wasm trap: wasm `unreachable` instruction executed

The asserting code (tests/wasi-testsuite tests/rust/wasm32-wasip3/src/bin/sockets-udp-send.rs:12-22):

async fn test_wrong_address_family(family: IpAddressFamily) {
    let sock = UdpSocket::create(family).unwrap();

    let addr = match family {
        IpAddressFamily::Ipv4 => IpSocketAddress::localhost(IpAddressFamily::Ipv6, 0),
        IpAddressFamily::Ipv6 => IpSocketAddress::localhost(IpAddressFamily::Ipv4, 0),
    };

    let result = sock.send(vec![0; 1], Some(addr)).await;
    assert!(matches!(result, Err(ErrorCode::InvalidArgument)));   // panics on wasmtime 44.0.1
}

Cross-runtime parity

The same fixture passes on the WAMR-Zig WASIp3 host (40 / 40 wasm32-wasip3 fixtures pass, this one included). The WAMR host validates the destination address family against the socket's family before reaching the kernel and returns Err(InvalidArgument) on the mismatch. wasmtime 44 either passes the send through to the kernel (which fails with EINVAL / EAFNOSUPPORT and gets mapped to a different ErrorCode variant) or accepts it.

Why this matters

One of four wasm32-wasip3 fixtures that fail on stock wasmtime 44.0.1 but pass on the WAMR-Zig host; tracked in cataggar/wamr#583 C1.

Environment

view this post on Zulip Wasmtime GitHub notifications bot (May 19 2026 at 14:05):

saulecabrera commented on issue #13398:

I believe this is a duplicate of https://github.com/bytecodealliance/wasmtime/issues/12475

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2026 at 16:10):

fitzgen closed issue #13398:

Summary

The upstream wasi-testsuite fixture wasm32-wasip3/sockets-udp-send (tests/rust/wasm32-wasip3/src/bin/sockets-udp-send.rs's test_wrong_address_family) panics on wasmtime 44.0.1 (first stable release with -Sp3 support). The fixture creates a UDP socket bound to one address family and sends a packet to an address of the other family, expecting ErrorCode::InvalidArgument. wasmtime returns something other than Err(InvalidArgument) and the matches! assertion panics.

Reproduction

cd tests/rust/wasm32-wasip3 && make build && cd -
wasmtime -Wcomponent-model-async -Sp3,inherit-network \
    tests/rust/testsuite/wasm32-wasip3/sockets-udp-send.wasm

Output (trimmed):

thread '<unnamed>' (1) panicked at src/bin/sockets-udp-send.rs:21:5:
assertion failed: matches!(result, Err(ErrorCode::InvalidArgument))

   12:   0x44e2 - sockets_udp_send!sockets_udp_send::test_wrong_address_family::{closure#0}

    1: wasm trap: wasm `unreachable` instruction executed

The asserting code (tests/wasi-testsuite tests/rust/wasm32-wasip3/src/bin/sockets-udp-send.rs:12-22):

async fn test_wrong_address_family(family: IpAddressFamily) {
    let sock = UdpSocket::create(family).unwrap();

    let addr = match family {
        IpAddressFamily::Ipv4 => IpSocketAddress::localhost(IpAddressFamily::Ipv6, 0),
        IpAddressFamily::Ipv6 => IpSocketAddress::localhost(IpAddressFamily::Ipv4, 0),
    };

    let result = sock.send(vec![0; 1], Some(addr)).await;
    assert!(matches!(result, Err(ErrorCode::InvalidArgument)));   // panics on wasmtime 44.0.1
}

Cross-runtime parity

The same fixture passes on the WAMR-Zig WASIp3 host (40 / 40 wasm32-wasip3 fixtures pass, this one included). The WAMR host validates the destination address family against the socket's family before reaching the kernel and returns Err(InvalidArgument) on the mismatch. wasmtime 44 either passes the send through to the kernel (which fails with EINVAL / EAFNOSUPPORT and gets mapped to a different ErrorCode variant) or accepts it.

Why this matters

One of four wasm32-wasip3 fixtures that fail on stock wasmtime 44.0.1 but pass on the WAMR-Zig host; tracked in cataggar/wamr#583 C1.

Environment

view this post on Zulip Wasmtime GitHub notifications bot (May 21 2026 at 16:10):

fitzgen commented on issue #13398:

I will close this in favor of #12475, but if that's incorrect, feel free to reopen! Thanks


Last updated: Jun 01 2026 at 09:49 UTC