Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_vsock fails on Linux under QEMU #1403

Closed
asomers opened this issue Mar 21, 2021 · 4 comments
Closed

test_vsock fails on Linux under QEMU #1403

asomers opened this issue Mar 21, 2021 · 4 comments

Comments

@asomers
Copy link
Member

asomers commented Mar 21, 2021

Sometime in between 6-March-2021 and 16-March-2021, sys::test_socket::test_vsock has begin to fail for the QEMU architectures (but it still passes on x86_64 Linux).

For example, from https://github.com/nix-rust/nix/pull/1401/checks?check_run_id=2124256635 ,

---- sys::test_socket::test_vsock stdout ----
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `None`,
 right: `Some(Sys(EADDRNOTAVAIL))`', test/sys/test_socket.rs:1517:5

@stefano-garzarella @qwandor-google as the only two known users of Vsock with Nix, can one of you please debug this?

@asomers
Copy link
Member Author

asomers commented Mar 21, 2021

Possibly the same root cause as #1310

asomers added a commit to asomers/nix that referenced this issue Mar 21, 2021
bors bot added a commit that referenced this issue Mar 21, 2021
1404: Temporarily disable test_vsock on QEMU arches r=asomers a=asomers

Issue #1403

Co-authored-by: Alan Somers <[email protected]>
@stefano-garzarella
Copy link
Contributor

@asomers sure! I can take a look!

@stefano-garzarella
Copy link
Contributor

The test is failing here:

    let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_LOCAL, port);
    assert_eq!(bind(s1, &sockaddr).err(),
               Some(Error::Sys(Errno::EADDRNOTAVAIL)));

Starting from Linux 5.6, VMADDR_CID_LOCAL is supported to do local communication (loopback device).
Before this it was reserved, but probably the test runner now has a newer kernel and VMADDR_CID_LOCAL is supported.

I'll send a patch right away to remove that check and re-enable the test.

stefano-garzarella added a commit to stefano-garzarella/nix that referenced this issue Mar 22, 2021
Starting from Linux 5.6, VMADDR_CID_LOCAL is supported to do local
communication (loopback device).

Before Linux 5.6 it was called VMADDR_CID_RESERVED and was not
supported, so we could expect an EADDRNOTAVAIL, but now this address
is supported and handled by the 'vsock_loopback' kernel module loaded
automatically if no other vsock transports are loaded.

Issue nix-rust#1310
Issue nix-rust#1403

Signed-off-by: Stefano Garzarella <[email protected]>
bors bot added a commit that referenced this issue Mar 23, 2021
1407: Fix test_vsock failure on VMADDR_CID_LOCAL testing and re-enable it r=asomers a=stefano-garzarella

Starting from Linux 5.6, `VMADDR_CID_LOCAL` is supported to do local communication (loopback device).

Before Linux 5.6 it was called `VMADDR_CID_RESERVED` and was not supported, so we could expect an `EADDRNOTAVAIL`, but now this address is supported and handled by the 'vsock_loopback' kernel module loaded automatically if no other vsock transports are loaded.

Issue #1310
Issue #1403

Signed-off-by: Stefano Garzarella <[email protected]>

Co-authored-by: Stefano Garzarella <[email protected]>
bors bot added a commit that referenced this issue Mar 23, 2021
1407: Fix test_vsock failure on VMADDR_CID_LOCAL testing and re-enable it r=asomers a=stefano-garzarella

Starting from Linux 5.6, `VMADDR_CID_LOCAL` is supported to do local communication (loopback device).

Before Linux 5.6 it was called `VMADDR_CID_RESERVED` and was not supported, so we could expect an `EADDRNOTAVAIL`, but now this address is supported and handled by the 'vsock_loopback' kernel module loaded automatically if no other vsock transports are loaded.

Issue #1310
Issue #1403

Signed-off-by: Stefano Garzarella <[email protected]>

Co-authored-by: Stefano Garzarella <[email protected]>
@asomers
Copy link
Member Author

asomers commented Apr 10, 2021

Fixed by #1407 .

@asomers asomers closed this as completed Apr 10, 2021
asomers pushed a commit that referenced this issue Aug 14, 2021
Starting from Linux 5.6, VMADDR_CID_LOCAL is supported to do local
communication (loopback device).

Before Linux 5.6 it was called VMADDR_CID_RESERVED and was not
supported, so we could expect an EADDRNOTAVAIL, but now this address
is supported and handled by the 'vsock_loopback' kernel module loaded
automatically if no other vsock transports are loaded.

Issue #1310
Issue #1403

Signed-off-by: Stefano Garzarella <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants