Skip Menu |

This queue is for tickets about the IO CPAN distribution.

Report information
The Basics
Id: 128987
Status: resolved
Priority: 0/
Queue: IO

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

Bug Information
Severity: (no value)
Broken in: 1.39
Fixed in: (no value)



Subject: Skip EINVAL on FreeBSD tests when binding a tcp listener on localhost
Some freebsd's disallow resolving localhost and return EINVAL when binding a tcp listener on localhost. See my FreeBSD smoker errors: https://cirrus-ci.com/task/5137254568689664 The fix is attached. -- Reini Urban
Subject: IO-freebsd.patch
commit f445c280ec46d0d38160b1f8227ad92425f2c0dc Author: Reini Urban <rurban@cpan.org> Date: Mon Apr 1 10:14:48 2019 +0200 IO-1.39_02 Skip EINVAL on FreeBSD tests when binding a tcp listener on localhost. diff --git dist/IO/t/io_multihomed.t dist/IO/t/io_multihomed.t index f2a8e11f1c..c511f188b7 100644 --- dist/IO/t/io_multihomed.t +++ dist/IO/t/io_multihomed.t @@ -24,7 +24,6 @@ BEGIN { $| = 1; -print "1..8\n"; watchdog(15); package Multi; @@ -73,13 +72,24 @@ sub connect package main; use IO::Socket; +# Don't be locale-sensitive +$! = Errno::EINVAL; +my $EINVAL_STR = "$!"; $listen = IO::Socket::INET->new(LocalAddr => 'localhost', Listen => 2, Proto => 'tcp', Timeout => 5, - ) or die "$!"; + ); +unless ($listen) { + if ($^O eq 'freebsd' && $! eq $EINVAL_STR) { + skip_all("tcp listener on localhost disallowed on this $^O"); + } else { + die "$!"; + } +} +print "1..8\n"; print "ok 1\n"; $port = $listen->sockport; diff --git dist/IO/t/io_sock.t dist/IO/t/io_sock.t index 37c8dad84e..6933b9f5e2 100644 --- dist/IO/t/io_sock.t +++ dist/IO/t/io_sock.t @@ -27,7 +27,6 @@ BEGIN { my $has_perlio = find PerlIO::Layer 'perlio'; $| = 1; -print "1..26\n"; eval { $SIG{ALRM} = sub { die; }; @@ -35,6 +34,9 @@ eval { }; use IO::Socket; +# Don't be locale-sensitive +$! = Errno::EINVAL; +my $EINVAL_STR = "$!"; $listen = IO::Socket::INET->new(LocalAddr => 'localhost', Listen => 2, @@ -42,8 +44,16 @@ $listen = IO::Socket::INET->new(LocalAddr => 'localhost', # some systems seem to need as much as 10, # so be generous with the timeout Timeout => 15, - ) or die "$!"; + ); +unless ($listen) { + if ($^O eq 'freebsd' && $! eq $EINVAL_STR) { + skip_all("tcp listener on localhost disallowed on this $^O"); + } else { + die "$!"; + } +} +print "1..26\n"; print "ok 1\n"; # Check if can fork with dynamic extensions (bug in CRT):
Ticket migrated to github as https://github.com/Dual-Life/IO/issues/50