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

Spurious libstd test failures on machines without IPv6 networking #39798

Open
zackw opened this Issue Feb 13, 2017 · 7 comments

Comments

Projects
None yet
3 participants
@zackw
Copy link
Contributor

zackw commented Feb 13, 2017

I have IPv6 disabled on my office computer, because the router doesn't support it but glibc tries to use it anyway unless it's completely turned off. This causes a great many spurious failures in net::tcp and net::udp - they appear to be trying to use the IPv6 loopback address.

Please make the net tests check for whether the computer has a v6 loopback interface configured, and skip testing v6 if it doesn't.

zackw added a commit to zackw/rust that referenced this issue Dec 3, 2017

Skip IPv{4,6} tests when IPv{4,6} loopback doesn't work (rust-lang#39798
)

If the computer on which libstd tests are being run has been
configured without support for IPv6 or IPv4, then all of the
net::{tcp,udp} tests for that address family will fail.  This
patch detects this condition and skips all of the affected tests.

The automatic detector works by attempting to bind a socket on the
appropriate loopback address (::1 or 127.0.0.1).  If this succeeds,
the tests are run; if it fails with EADDRNOTAVAIL, they are skipped.
This is not exactly the same thing as "computer was configured without
support for IPvX", but it _is_ the failing operation in most of the
problem tests on my computer that doesn't do IPv6.

Because the automatic detector might not be perfectly accurate, and
because one might _want_ the tests to fail if the computer has been
configured incorrectly (this would be appropriate for the CI bots, for
instance), it can be overridden with environment variables: set
`RUST_TEST_IPV{4,6}=0` to skip the IPv{4,6} tests unconditionally, or
`RUST_TEST_IPV{4,6}=1` to run them unconditionally.
@Hello71

This comment has been minimized.

Copy link

Hello71 commented Apr 23, 2018

In 2018, you should never disable IPv6 globally. Maybe you don't have IPv6 connectivity, but there is basically never a good reason to permanently disable it, not least because it causes issues like this. If your "router" (gateway) is broken, you should preferably fix it, or at worst disable obtaining an IPv6 address in your networking software.

@zackw

This comment has been minimized.

Copy link
Contributor Author

zackw commented Apr 23, 2018

@Hello71 The sysdamins for my organization have informed me that IPv6 support is on their to-do list but I should not hold my breath because it will involve replacing hundreds of thousands of dollars' worth of gear.

"Disable obtaining an IPv6 address" is exactly what I have done. This has negative side effects (notably, the local resolver still queries for AAAA records, which get dropped on the floor at the organizational DNS server, causing all network connections to take longer) if I don't also disable IPv6 loopback.

@Hello71

This comment has been minimized.

Copy link

Hello71 commented Apr 23, 2018

get dropped on the floor at the organizational DNS server

sounds like godawful "security" aka nobody will ever want to use anything other than HTTP over port 80. (the same garbage holding up TLS 1.3...) general-purpose DNS servers have absolutely zero legitimate reason to block unknown RR types.

regardless, I am told that the Linux sysctl to disable IPv6 does not affect glibc. on Windows, Microsoft says "IPv6 is a mandatory part of the Windows operating system". it follows that Rust should not add compatibility cruft for unnecessarily broken build machines.

@zackw

This comment has been minimized.

Copy link
Contributor Author

zackw commented Apr 23, 2018

Arguments from how someone's large organization's routers and DNS servers ought to be configured are unconvincing to me. They are configured in an IPv6-hostile manner and there's nothing whatsoever I can do about that. I do not think my situation is unique; in fact, I think it's rather more common than not.

Also, I find your tone unnecessarily hostile. You tell anyone that their development workstation is "unnecessarily broken", especially when the problem is due to something they have no control over, and they're liable to take their ball and go home.

@Hello71

This comment has been minimized.

Copy link

Hello71 commented May 1, 2018

To be clear, I am saying that:

  1. your DNS servers sound broken in a stupid way. this is not your fault personally, but unnecessarily impedes deployment of modern protocols like SCTP and TLS 1.3.

  2. I don't understand what your (technical) problem is.

  3. Because of 2, I don't understand what your workaround is, but it sounds like it either doesn't work at all or, alternatively, Rust shouldn't bother supporting it.

@zackw

This comment has been minimized.

Copy link
Contributor Author

zackw commented May 1, 2018

I don't understand what your (technical) problem is

The situation here seems to have improved since I originally reported this issue, and I may be able to turn my IPv6 loopback on again without problems, but I can't yet confirm that this leads to successful libstd test runs because currently x.py test src/libstd --stage 0 fails with an unrelated problem,

  Compiling std v0.0.0 (file:///.../rust/src/libstd)
error: the #[global_allocator] in this crate conflicts with global allocator in: std

But that's not the point.

I do not see the specific technical reasons why my computer, or any computer, may need to be configured without an IPv6 loopback address as relevant.

The request is for the libstd test suite to notice when the computer has been configured without IPv6, for whatever reason, and skip testing IPv6-dependent functionality. IPv4-only is a legitimate configuration - yes, even for development workstations - and should be supported. No networking at all, and IPv6-only, are also legitimate configurations that should be supported.

@Hello71

This comment has been minimized.

Copy link

Hello71 commented May 2, 2018

Microsoft says that turning off IPv6 entirely is not supported for exactly the reason that testing every possible configuration is impossible, and even if it were possible, it's far too much work.

Besides, under your proposal, the build would contain possibly non-working IPv6 code. Unless you are proposing to disable IPv6 support entirely if the build machine does not support it, which sounds like a bad plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.