roast icon indicating copy to clipboard operation
roast copied to clipboard

S32-io/IO-Socket-Async.t incorrectly fails when IPv6 is disabled on a host

Open vrurg opened this issue 4 years ago • 5 comments

When IPv6 is system-wide off on a Linux host then the test fails with:

# host=::1
Failed to resolve host name '::1' with family 0.
Error: Address family for hostname not supported
  in block  at t/spec/S32-io/IO-Socket-Async.t line 221
  in block <unit> at t/spec/S32-io/IO-Socket-Async.t line 101

Unfortunately, a quick look into the issue did not reveal a concise and accurate way to resolve it:

  • the exception is thrown from within VM (moar in particular), thus it is X::AdHoc
  • apparently, Raku does not provide a resolver interface, so it is not possible to try to resolve ::1 and test for outcome

The latter is especially surprising to me. I'd expect some basic resolving functionality be provided by the core.

vrurg avatar Oct 09 '20 02:10 vrurg

Roast currently assumes that both IPv4 and IPv6 loopback interfaces exist, which is not ideal. If we had a way of working with networking interfaces, then we could determine whether or not any 127.0.0.1 or ::1 addresses exist before attempting to use them. I'm not sure how else you could determine if IPv6 is supported or not by a system without winding up with false positives from issues with DNS resolution or sockets themselves as things currently stand.

With the solution for https://github.com/Raku/problem-solving/issues/111 I'm working on, there would exist resolver interfaces. Whether or not IPv6 addresses can be resolved when it isn't supported by a system is backend-dependent behaviour though.

Kaiepi avatar Oct 13 '20 04:10 Kaiepi

I hope that backend-specific issues we'd be able to resolve using conditionals. Otherwise you confirm the conclusions I made after investigating the matter.

Looking forward for your success on the problems-solving issue!

vrurg avatar Oct 14 '20 02:10 vrurg

I wonder how much of an issue this is? Systems without v6 should become rarer and rarer. How many of those will want to run roast? OTOH this has been reported, so it is at least one...

Stefan

niner avatar Oct 14 '20 05:10 niner

I wonder how much of an issue this is? Systems without v6 should become rarer and rarer. How many of those will want to run roast? OTOH this has been reported, so it is at least one...

Actually pretty common. There were at least two different occasions in the last few years I had to disable ipv6 on my machines because things were misbehaving. I have little reason to change it back given that the connection I have doesn't support ipv6 anyway. Although, the test is passing for me so I guess I reinstalled the system during that time, so locally it is enabled again.

AlexDaniel avatar Oct 14 '20 07:10 AlexDaniel

This will be fixable with my solution for https://github.com/Raku/problem-solving/111. PR will be up soon-ish.

Kaiepi avatar Apr 02 '21 15:04 Kaiepi