Skip Menu |

This queue is for tickets about the IO-Socket-IP CPAN distribution.

Report information
The Basics
Id: 96064
Status: resolved
Priority: 0/
Queue: IO-Socket-IP

People
Owner: Nobody in particular
Requestors: GAAS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.29
Fixed in: 0.37



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:

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.

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.

Subject: [rt.cpan.org #96064] - Patches I have been using with SMOKE
Date: Tue, 27 Jan 2015 11:39:26 +0100
To: bug-IO-Socket-IP [...] rt.cpan.org
From: Michael Felt <aixtools [...] gmail.com>
There are four tests that fail actually, and here are the patches I use when smoking the blead branch of perl. Hope this helps!

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

On Tue Jan 27 05:39:36 2015, aixtools@gmail.com wrote: Show quoted text
> There are four tests that fail actually, and here are the patches I use > when smoking the blead branch of perl. > > Hope this helps!
Oops. Yeah - those patches are just fixing the "LocalPort" argument which the tests erroneously pass as just "Port". I imagine that might fix a few things ;) -- Paul Evans
Released in 0.37 -- Paul Evans