Ticket #1989 (new bug)

Opened 3 years ago

Last modified 3 years ago

t/pmc/socket_ipv6.t: new test failures

Reported by: jkeenan Owned by:
Priority: normal Milestone:
Component: testing Version: 3.0.0
Severity: medium Keywords:
Cc: dukeleto Language:
Patch status: Platform: solaris

Description

Observed on linux/i386. Also reported earlier to day on parrot-dev by Andy Dougherty.

gethostbyname failure [::1]
gethostbyname failure [::1]
gethostbyname failure [::1]
gethostbyname failure [::1]
getaddrinfo failure: Name or service not known
Null PMC access in clone()
current instr.: 'test_bind' pc 142 (t/pmc/socket_ipv6.t:51)
called from Sub 'main' pc 83 (t/pmc/socket_ipv6.t:36)
t/pmc/socket_ipv6.t .. 
1..18
# This Parrot is IPv6-aware
ok 1 - A TCP ipv6 sockaddr to localhost was set isa Sockaddr
ok 2 - A TCP ipv6 sockaddr to ::1 was set isa Sockaddr
ok 3 - A raw TCP ipv6 sockaddr to localhost was set: isa Sockaddr
ok 4 - A raw TCP ipv6 sockaddr to ::1 was set: isa Sockaddr
ok 5 - A UDP ipv6 sockaddr to localhost was set: isa Sockaddr
ok 6 - A UDP ipv6 sockaddr to ::1 was set: isa Sockaddr
ok 7 - A raw UDP ipv6 sockaddr to localhost was set:  isa Sockaddr
ok 8 - A raw UDP ipv6 sockaddr to ::1 was set:  isa Sockaddr
not ok 9 - bind ok (IPv6 localhost)
# Have: -1
# Want: 0
Dubious, test returned 1 (wstat 256, 0x100)
Failed 10/18 subtests 

Test Summary Report
-------------------
t/pmc/socket_ipv6.t (Wstat: 256 Tests: 9 Failed: 1)
  Failed test:  9
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 18 tests but ran 9.
Files=1, Tests=9,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.01 cusr  0.00 csys =  0.03 CPU)
Result: FAIL

Attachments

tt1989-passive.patch Download (1.4 KB) - added by doughera 3 years ago.
set AI_PASSIVE on getaddrinfo() calls prior to bind()

Change History

follow-up: ↓ 2   Changed 3 years ago by nwellnhof

in reply to: ↑ 1   Changed 3 years ago by jkeenan

Replying to nwellnhof:

Should be fixed in  https://github.com/parrot/parrot/commit/958c51a370

Yes, it is now passing for me on linux/i386. Let's watch for smoke results on other OSes. Then we can close it.

Thank you very much.

kid51

  Changed 3 years ago by doughera

Still failing as of RELEASE_3_0_0-294-g2057f20 on Solaris 8/SPARC with

$ prove -v t/pmc/socket_ipv6.t
t/pmc/socket_ipv6.t .. 
1..11
# This Parrot is IPv6-aware
ok 1 - A TCP ipv6 sockaddr to localhost was set isa Sockaddr
ok 2 - A TCP ipv6 sockaddr to ::1 was set isa Sockaddr
ok 3 - A UDP ipv6 sockaddr to localhost was set: isa Sockaddr
ok 4 - A UDP ipv6 sockaddr to ::1 was set: isa Sockaddr
connect failed: 126
current instr.: 'test_bind' pc 114 (t/pmc/socket_ipv6.t:47)
called from Sub 'main' pc 65 (t/pmc/socket_ipv6.t:34)
Dubious, test returned 1 (wstat 256, 0x100)
Failed 7/11 subtests 

follow-up: ↓ 8   Changed 3 years ago by dukeleto

  • platform set to solaris
  • component changed from core to testing

This could be related to the fact that some people will not be able to create raw sockets.

We need a good way to detect if raw sockets can be created and then skip the appropriate tests if needed.

I am not sure what PIO_SOCK_ERRNO=126 means.

  Changed 3 years ago by nwellnhof

I had to remove the raw socket tests because they simply didn't work after I implemented strict error checking for the socket functions.

I also have some upcoming changes to enable system error messages instead of error codes.

follow-ups: ↓ 7 ↓ 9   Changed 3 years ago by nwellnhof

Now it seems that Configure.pl doesn't detect IPv6 support on Solaris. I kind of expected that after I changed the feature detection code. We should find out why config/auto/ipv6/test.in fails. The output from "perl Configure.pl --verbose" should contain that information.

in reply to: ↑ 6   Changed 3 years ago by jkeenan

Replying to nwellnhof:

We should find out why config/auto/ipv6/test.in fails. The output from "perl Configure.pl --verbose" should contain that information.

See if commit 17f46f5 helps.

kid51

in reply to: ↑ 4   Changed 3 years ago by doughera

Replying to dukeleto:

This could be related to the fact that some people will not be able to create raw sockets. We need a good way to detect if raw sockets can be created and then skip the appropriate tests if needed. I am not sure what PIO_SOCK_ERRNO=126 means.

Assuming that's an errno (I haven't looked at the parrot code to see where it comes from), it corresponds to:

    EADDRNOTAVAIL   126     /* Can't assign requested address */

on Solaris.

in reply to: ↑ 6   Changed 3 years ago by doughera

Replying to nwellnhof:

Now it seems that Configure.pl doesn't detect IPv6 support on Solaris. I kind of expected that after I changed the feature detection code. We should find out why config/auto/ipv6/test.in fails. The output from "perl Configure.pl --verbose" should contain that information.

Odd. The Configure.pl test works for me on Solaris 8 (the only thing handy at the moment to test). I see

auto::ipv6 -          Determine IPV6 capabilities.........................yes.

  Changed 3 years ago by doughera

As of RELEASE_3_0_0-317-g0e83c3b this is still failing on Solaris 10 at what looks like the same bind() call:

t/pmc/socket_ipv6.t .. 
1..11
# This Parrot is IPv6-aware
ok 1 - A TCP ipv6 sockaddr to localhost was set isa Sockaddr
ok 2 - A TCP ipv6 sockaddr to ::1 was set isa Sockaddr
ok 3 - A UDP ipv6 sockaddr to localhost was set: isa Sockaddr
ok 4 - A UDP ipv6 sockaddr to ::1 was set: isa Sockaddr
bind failed: Cannot assign requested address
current instr.: 'test_bind' pc 114 (t/pmc/socket_ipv6.t:47)
called from Sub 'main' pc 65 (t/pmc/socket_ipv6.t:34)
Dubious, test returned 1 (wstat 256, 0x100)
Failed 7/11 subtests 

follow-up: ↓ 12   Changed 3 years ago by nwellnhof

I googled a bit and my hunch is that getaddrinfo returns multiple IPv6 addresses and some of them are invalid for some reason. I added some debug output to the IPv6 test in 2cdf5dd.

in reply to: ↑ 11 ; follow-up: ↓ 13   Changed 3 years ago by doughera

Replying to nwellnhof:

I googled a bit and my hunch is that getaddrinfo returns multiple IPv6 addresses and some of them are invalid for some reason. I added some debug output to the IPv6 test in 2cdf5dd.

Thank you for the attempt. I think the problems are elsewhere, however.

I've never done any socket programming, but based on reading the man pages, it looks like the call to getaddrinfo() is wrong in the cases where the result is going to be passed to bind. According to the man page, AI_PASSIVE should be set in those cases. I've attached a patch to the tests to fix that.

That patch leads to new failures in tests 5 and 6 in the returned strings. I now suspect the those tests were wrong as well, but I'd appreciate confirmation from someone who actually knows anything about socket programming.

With my patch applied, and ignoring the errors from the "expected" names in tests 5 and 6, I still get failures on both Solaris 8 and 10 at the connect() stage:

$ ./parrot t/pmc/socket_ipv6.t
1..11
# This Parrot is IPv6-aware
ok 1 - A TCP ipv6 sockaddr to localhost was set isa Sockaddr
ok 2 - A TCP ipv6 sockaddr to ::1 was set isa Sockaddr
ok 3 - A UDP ipv6 sockaddr to localhost was set: isa Sockaddr
ok 4 - A UDP ipv6 sockaddr to ::1 was set: isa Sockaddr
# address 1: family 26, type 2, protocol 0
not ok 5 - local address of bound socket is ::1
# Have: :::1234
# Want: ::1:1234
not ok 6 - local address of bound socket is 127.0.0.1
# Have: 0.0.0.0:1234
# Want: 127.0.0.1:1234
ok 7 - Server process started
connect failed: Network is unreachable
current instr.: 'test_server' pc 365 (t/pmc/socket_ipv6.t:111)
called from Sub 'main' pc 74 (t/pmc/socket_ipv6.t:36)

At this point I'm *way* beyond my sphere of knowledge, so I have no idea what to do next.

Changed 3 years ago by doughera

set AI_PASSIVE on getaddrinfo() calls prior to bind()

in reply to: ↑ 12 ; follow-up: ↓ 14   Changed 3 years ago by nwellnhof

Replying to doughera:

I've never done any socket programming, but based on reading the man pages, it looks like the call to getaddrinfo() is wrong in the cases where the result is going to be passed to bind. According to the man page, AI_PASSIVE should be set in those cases. I've attached a patch to the tests to fix that.

Yes, that seems to be the reason. Can you give b12ac89 a try?

in reply to: ↑ 13   Changed 3 years ago by doughera

Replying to nwellnhof:

Yes, that seems to be the reason. Can you give b12ac89 a try?

That seems to be worse. It's back to failing after test 4. As of RELEASE_3_0_0-448-gb12ac89, I get:

t/pmc/socket_ipv6.t .. 
1..11
# This Parrot is IPv6-aware
ok 1 - A TCP ipv6 sockaddr to localhost was set isa Sockaddr
ok 2 - A TCP ipv6 sockaddr to ::1 was set isa Sockaddr
ok 3 - A UDP ipv6 sockaddr to localhost was set: isa Sockaddr
ok 4 - A UDP ipv6 sockaddr to ::1 was set: isa Sockaddr
# address 1: family 26, type 2, protocol 0
bind failed: Cannot assign requested address
current instr.: 'test_bind' pc 158 (t/pmc/socket_ipv6.t:68)
called from Sub 'main' pc 65 (t/pmc/socket_ipv6.t:34)
Dubious, test returned 1 (wstat 256, 0x100)
Failed 7/11 subtests 

Test Summary Report
-------------------
t/pmc/socket_ipv6.t (Wstat: 256 Tests: 4 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 11 tests but ran 4.
Files=1, Tests=4,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.02 cusr  0.02 csys =  0.07 CPU)
Result: FAIL

follow-up: ↓ 16   Changed 3 years ago by nwellnhof

OK, then we should try your patch on top. I applied it in fd01a858b1.

in reply to: ↑ 15 ; follow-up: ↓ 17   Changed 3 years ago by doughera

Replying to nwellnhof:

OK, then we should try your patch on top. I applied it in fd01a858b1.

Oh, do you mean b12ac89 didn't include my patch? No wonder it didn't work. I'll test this the next chance I have, but that might not be for a while.

in reply to: ↑ 16   Changed 3 years ago by doughera

Replying to doughera:

Replying to nwellnhof:

OK, then we should try your patch on top. I applied it in fd01a858b1.

Oh, do you mean b12ac89 didn't include my patch? No wonder it didn't work. I'll test this the next chance I have, but that might not be for a while.

Testing today on Solaris 8/SPARC, I get the exact same error message I reported most recently -- the bind call fails after test 4.

Note: See TracTickets for help on using tickets.