Stream: git-wasmtime

Topic: wasmtime / issue #12568 [wasi-sockets] Inconsistency in u...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 11 2026 at 15:38):

saulecabrera opened issue #12568:

Consider

async fn test_unspecified_remote_addr(family: IpAddressFamily) {
    let sock = UdpSocket::create(family).unwrap();
    let unspec = IpSocketAddress::unspecified(family, PORT);
    let result = sock.send(vec![0; 1], Some(unspec)).await;

    assert!(matches!(result, Err(ErrorCode::InvalidArgument)));
}

The test above fails.

According to the spec:

_invalid-argument: The IP address in remote-address is set to INADDR_ANY (0.0.0.0 / ::)._

The current implementation returns remote-unreachable instead. The behavior is consistent on macOS, Windows and Linux.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 11 2026 at 15:38):

saulecabrera added the bug label to Issue #12568.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 11 2026 at 15:38):

saulecabrera added the wasi label to Issue #12568.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 12 2026 at 01:41):

alexcrichton commented on issue #12568:

cc @badeend

view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2026 at 14:14):

alexcrichton commented on issue #12568:

@badeend if you don't mind me pinging you again on this, I was wondering if you had thoughts on this issue/test? On Linux at least this is returning Ok(()) instead of an error. On macOS I get ErrorCode::RemoteUnreachable as Saul mentions.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 13 2026 at 07:59):

badeend commented on issue #12568:

Hmm, never got a notification for that first ping. Anyhow..


Yes, good catch @saulecabrera. I think this got lost somewhere during the p2->p3 conversion. The P2 implementation _does_ have this check:

https://github.com/bytecodealliance/wasmtime/blob/ff944c96c9bee03da951e75e21aba26f3ee99ebd/crates/wasi/src/p2/host/udp.rs#L319-L322

I've opened a PR to do the same thing in P3: https://github.com/bytecodealliance/wasmtime/pull/13631

view this post on Zulip Wasmtime GitHub notifications bot (Jun 13 2026 at 18:12):

alexcrichton closed issue #12568:

Consider

async fn test_unspecified_remote_addr(family: IpAddressFamily) {
    let sock = UdpSocket::create(family).unwrap();
    let unspec = IpSocketAddress::unspecified(family, PORT);
    let result = sock.send(vec![0; 1], Some(unspec)).await;

    assert!(matches!(result, Err(ErrorCode::InvalidArgument)));
}

The test above fails.

According to the spec:

_invalid-argument: The IP address in remote-address is set to INADDR_ANY (0.0.0.0 / ::)._

The current implementation returns remote-unreachable instead. The behavior is consistent on macOS, Windows and Linux.


Last updated: Jul 29 2026 at 05:03 UTC