Bug#813796: libio-socket-ssl-perl: tests hang with no real network interfaces

Niko Tyni ntyni at debian.org
Fri Feb 5 11:15:06 UTC 2016


Package: libio-socket-ssl-perl
Version: 2.023-1 
User: debian-perl at lists.debian.org
Usertags: perl-5.22-transition

As seen on
 https://tests.reproducible-builds.org/rb-pkg/unstable/amd64/libio-socket-ssl-perl.html
the test suite of this package hangs if there are no network
interfaces other than 'lo' on the build system.

t/acceptSSL-timeout.t fails with
  1..15
  ok # listening @127.0.0.1:55914
  # server >> OK
  Waiting
  <<
  ok # [server] OK
  ok # [server] Waiting
  # client_ssl >> OK
  <<
  ok # [client_ssl] OK
  not ok # [server] Connect from
  not ok # fatal error at ./t/testlib.pl line 168.
  
and t/alpn.t hangs with
  1..5
  ok # [server] Server Initialization at 127.0.0.1
  # server at 127.0.0.1:39579
  not ok # [client] connect failed: IO::Socket::IP configuration failed
 
This is easy to test with Linux network namespaces, using 'unshare -n'
and 'ip li set lo up' or something like that. This is pretty much what
pbuilder does with USENETWORK=no.

The issue is similar to #759799 / [rt.cpan.org #98328].  Starting with
Perl 5.22 (IO::Socket::IP 0.31), IO::Socket::SSL uses IO::Socket::IP
for the underlying sockets. IO::Socket::IP configures sockets with
getaddrinfo(3), using the AI_ADDRCONFIG flag by default. Quoting
getaddrinfo(3):

       If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4
       addresses are returned in the list pointed to by res only if
       the local system has at least one IPv4 address configured,  and
       IPv6  addresses  are returned  only  if  the local system has at
       least one IPv6 address configured.  The loopback address is not
       considered for this case as valid as a configured address.

which fails if there's just the loopback interface.

This can be overridden by providing GetAddrInfoFlags to the socket,
as was done in the IO::Socket::IP test suite to fix the above issues.
However, sprinkling such fixes all over reverse dependencies does seem
somewhat wrong to me...

In any case, at least the hanging test suite is nasty and needs fixing.
-- 
Niko Tyni   ntyni at debian.org



More information about the pkg-perl-maintainers mailing list