Subject: | localserver test failures with AIX 5 |
3 tests based on setting up local test servers fail on AIX 5.3. The first test failure looks like this:
cpan/IO-Socket-IP/t/02local-server-v4 ......................... # Failed test '$testserver->sockhost for SOCK_STREAM' # at t/02local-server-v4.t line 39. # got: '0.0.0.0' # expected: '127.0.0.1' FAILED at test 4
This issue was verified and reported in this p5p thread: http://www.nntp.perl.org/group/perl.perl5.porters/2014/04/msg214792.html but no solution was found. According to that tread this problem only affects AIX 5; with AIX 6 or AIX 7 the tests succeed.
I tried replacing IO::Socket::IP with IO::Socket::INET and the tests then pass, so IO::Socket::IP isn't a drop-in replacement in this case.
The issue seems to boil down to the behaviour demonstrated by this script:
which prints:
I think we'll just give up on using AIX 5 as our build server, so I might not really care about solving this. This bug report was mostly provided to document my investigation on this issue -- in case somebody else encounters the same.
I tried replacing IO::Socket::IP with IO::Socket::INET and the tests then pass, so IO::Socket::IP isn't a drop-in replacement in this case.
The issue seems to boil down to the behaviour demonstrated by this script:
use strict;
use IO::Socket::INET;
use IO::Socket::IP;
for my $impl ("INET", "IP") {
my $class = "IO::Socket::$impl";
my $s = $class->new(
LocalHost => "127.0.0.1",
Listen => 1,
);
print "Connected to ", $s->sockhost, ":", $s->sockport, " with $class\n";
}
which prints:
Connected to 127.0.0.1:46074 with IO::Socket::INET
Connected to 0.0.0.0:46075 with IO::Socket::IP
From reading the source it looks like the issue is that IO::Socket::INET uses getsockname(2) to pick up the sockhost while IO::Socket::IP uses getnameinfo(2). So I simply conclude that getnameinfo is buggy on AIX 5, and probably not worth providing a workaround for either.
From reading the source it looks like the issue is that IO::Socket::INET uses getsockname(2) to pick up the sockhost while IO::Socket::IP uses getnameinfo(2). So I simply conclude that getnameinfo is buggy on AIX 5, and probably not worth providing a workaround for either.
I think we'll just give up on using AIX 5 as our build server, so I might not really care about solving this. This bug report was mostly provided to document my investigation on this issue -- in case somebody else encounters the same.