Bug#666651: librpc-xml-perl: FTBFS: tests failed

Niko Tyni ntyni at debian.org
Fri Apr 6 11:02:41 UTC 2012


tag 666651 = ipv6
clone 666651 -1 -2
submitter -1 !
retitle -1 libnet-server-perl: no IPv4 server when binding to localhost
reassign -1 libnet-server-perl 0.99-4
severity -1 serious # arguably just 'important'
affects -1 librpc-xml-perl
submitter -2 !
retitle -2 libhttp-daemon-perl: HTTP::Daemon::ClientConn is IPv4 only
severity -2 normal
reassign -2 libhttp-daemon-perl 6.01-1
affects -2 librpc-xml-perl
tag 666651 + patch sid wheezy
thanks

On Sun, Apr 01, 2012 at 04:01:59PM +0200, gregor herrmann wrote:
> On Sat, 31 Mar 2012 21:48:05 +0200, Lucas Nussbaum wrote:
> 
> > During a rebuild of all packages in sid, your package failed to build on
> > amd64.
> 
> I can't reproduce this (amd64 and i386 sid cowbuilder chroot).

It's about the IPv6 localhost address ::1. Removing that from /etc/hosts
makes the test pass.

The failing test starts an RPC::XML::Server on localhost with no_http
=> 1, which makes server_loop() use Net::Server to handle incoming
connections instead of HTTP::Daemon.

Unfortunately libnet-server-perl currently only binds an IPv6 socket
when asked for 'localhost' if localhost is both 127.0.0.1 and ::1 in
/etc/hosts.  I think this is a bug. Consider a server:

 # perl -MNet::Server -e 'package S; use base q/Net::Server/; sub process_request { print qq(hello, world!\n) }; S->run(port => 1600, host => q/localhost/)'
 2012/04/06-13:17:11 S (type Net::Server) starting! pid(3802)
 Using default listen value of 128
 Binding to TCP port 1600 on host localhost
 Group Not Defined.  Defaulting to EGID '1000 20 27 29 119 1000'
 User Not Defined.  Defaulting to EUID '1000'

and a client:

 # grep localhost /etc/hosts
 127.0.0.1   localhost
 ::1     localhost ip6-localhost ip6-loopback

 # telnet 127.0.0.1 1600
 Trying 127.0.0.1...
 telnet: Unable to connect to remote host: Connection refused

 # telnet localhost 1600
 Trying ::1...
 Connected to localhost.
 Escape character is '^]'.
 hello, world!
 Connection closed by foreign host.

I'm cloning a bug about this. It's clearly Debian specific behaviour,
as the IPv6 support was patched in with 0.99-3. I think it's bad enough
to be considered release critical, but other pkg-perl folks should feel
free to downgrade if they disagree.

Now, the librpc-xml-perl test suite would actually work over IPv6
localhost if it wasn't for this: (quote from XML::RPC::server::server_loop())

        # This is the Net::Server block, but for now HTTP::Daemon is needed
        # for the code that converts socket data to a HTTP::Request object

and the fact that HTTP::Daemon doesn't support IPv6, as seen in 
t/net_server.log:

 Bad arg length for Socket::unpack_sockaddr_in, length is 28, should be 16 at /usr/lib/perl/5.14/Socket.pm line 257.

This happens in RPC::XML::Server::process_request(), which blesses
the connection into a HTTP::Daemon::ClientConn object and then calls
peeraddr() on it.

I'm cloning another bug for libhttp-daemon-perl about this.

Earlier occurrences of related problems in RPC::XML::Server resulted in
 https://rt.cpan.org/Public/Bug/Display.html?id=43019
and the bandaid
 $RPC::XML::Server::IO_SOCKET_SSL_HACK_NEEDED 
but it looks like a proper fix is going to be more involved.

Now, the easiest targeted fix for this test suite failure would probably
be changing 'localhost' to '127.0.0.1' in t/60_net_server.t, which makes
it all work for me. Patch attached.
-- 
Niko Tyni   ntyni at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Explicitly-use-an-IPv4-socket-in-the-Net-Server-test.patch
Type: text/x-diff
Size: 1458 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20120406/8b7714be/attachment.patch>


More information about the pkg-perl-maintainers mailing list