Skip Menu |

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

Report information
The Basics
Id: 61724
Status: resolved
Priority: 0/
Queue: IO-Async

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

Bug Information
Severity: Critical
Broken in: 0.30
Fixed in: 0.31



Subject: Test failure: socket listens on INADDR_ANY
Tests speak louder than words: t/23signal.t ................. ok # Failed test 'socket listens on INADDR_ANY' # at t/24listener.t line 162. # got: ' # ?' # expected: '' # Looks like you failed 1 test of 29. t/24listener.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/29 subtests I suspect that part of the reason of this failing is that this test was run inside a FreeBSD jail. Attached is the complete report itself, which was not sent to the CPAN reporters.
Subject: io-async_report.txt
Dear Paul Evans, This is a computer-generated report for IO-Async-0.30 on perl 5.12.1, created by CPAN-Reporter-1.18. Thank you for uploading your work to CPAN. However, there was a problem testing your distribution. If you think this report is invalid, please consult the CPAN Testers Wiki for suggestions on how to avoid getting FAIL reports for missing library or binary dependencies, unsupported operating systems, and so on: http://wiki.cpantesters.org/wiki/CPANAuthorNotes Sections of this report: * Tester comments * Program output * Prerequisites * Environment and other context ------------------------------ TESTER COMMENTS ------------------------------ Additional comments from tester: none provided ------------------------------ PROGRAM OUTPUT ------------------------------ Output from './Build test': t/00use.t .................... ok t/01timequeue.t .............. ok t/02loop-magic.t ............. ok t/03loop-osabstract.t ........ ok t/04notifier.t ............... ok t/05notifier-child.t ......... ok t/10loop-poll-io.t ........... ok t/10loop-select-io.t ......... ok t/11loop-poll-timer.t ........ ok t/11loop-select-timer.t ...... ok t/12loop-poll-signal.t ....... ok t/12loop-select-signal.t ..... ok t/13loop-poll-idle.t ......... ok t/13loop-select-idle.t ....... ok t/14loop-poll-child.t ........ ok t/14loop-select-child.t ...... ok t/15loop-poll-control.t ...... ok t/15loop-select-control.t .... ok t/18loop-poll-legacy.t ....... ok t/18loop-select-legacy.t ..... ok t/19test.t ................... ok t/20handle.t ................. ok t/21stream.t ................. ok t/22timer-countdown.t ........ ok t/22timer-periodic.t ......... ok t/23signal.t ................. ok # Failed test 'socket listens on INADDR_ANY' # at t/24listener.t line 162. # got: ' # ?' # expected: '' # Looks like you failed 1 test of 29. t/24listener.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/29 subtests t/25socket.t ................. ok t/30loop-detachchild.t ....... ok t/31loop-spawnchild.t ........ ok t/32loop-spawnchild-setup.t .. ok t/33loop-openchild.t ......... ok t/34loop-runchild.t .......... ok t/35loop-child-root.t ........ skipped: not root t/40detachedcode-marshall.t .. ok t/41detachedcode-call.t ...... ok t/50loop-resolve.t ........... ok t/51loop-connect.t ........... ok # Failed test '$listenaddr is INADDR_LOOPBACK' # at t/52loop-listen.t line 92. # got: ' # ?' # expected: '' # Looks like you failed 1 test of 14. t/52loop-listen.t ............ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/14 subtests t/60protocol.t ............... ok t/60sequencer-client.t ....... ok t/60sequencer-server.t ....... ok t/61protocol-stream.t ........ ok t/99pod.t .................... ok Test Summary Report ------------------- t/24listener.t (Wstat: 256 Tests: 29 Failed: 1) Failed test: 24 Non-zero exit status: 1 t/52loop-listen.t (Wstat: 256 Tests: 14 Failed: 1) Failed test: 10 Non-zero exit status: 1 Files=44, Tests=1014, 94 wallclock secs ( 1.36 usr 0.62 sys + 23.68 cusr 5.00 csys = 30.66 CPU) Result: FAIL Failed 2/44 test programs. 2/1014 subtests failed. ------------------------------ PREREQUISITES ------------------------------ Prerequisite modules loaded: requires: Module Need Have ------------------- ---- ------ Async::MergePoint 0 0.03 Heap 0.80 0.80 IO::Poll 0 0.07 Socket::GetAddrInfo 0.18 0.18 Storable 0 2.22 Time::HiRes 0 1.9719 build_requires: Module Need Have ------------------- ---- ------ File::Temp 0 0.22 Test::Exception 0 0.29 Test::More 0 0.94 Test::Refcount 0 0.06 Test::Warn 0 0.22 configure_requires: Module Need Have ------------------- ---- ------ Module::Build 0.36 0.3603 ------------------------------ ENVIRONMENT AND OTHER CONTEXT ------------------------------ Environment variables: PATH = /home/squeek/perl5/perlbrew/bin:/home/squeek/perl5/perlbrew/perls/current/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/squeek/bin PERL5LIB = PERL5OPT = PERL5_CPANPLUS_IS_RUNNING = 49242 PERL5_CPAN_IS_RUNNING = 49242 SHELL = /bin/csh TERM = xterm-color Perl special variables (and OS-specific diagnostics, for MSWin32): $^X = /home/squeek/perl5/perlbrew/perls/perl-5.12.1/bin/perl $UID/$EUID = 1002 / 1002 $GID = 1002 1002 1002 $EGID = 1002 1002 1002 Perl module toolchain versions installed: Module Have ------------------- ------- CPAN 1.94_56 Cwd 3.31 ExtUtils::CBuilder 0.27 ExtUtils::Command 1.16 ExtUtils::Install 1.55 ExtUtils::MakeMaker 6.56 ExtUtils::Manifest 1.57 ExtUtils::ParseXS 2.2206 File::Spec 3.31 Module::Build 0.3603 Module::Signature n/a Test::Harness 3.17 Test::More 0.94 YAML n/a YAML::Syck n/a version 0.82
On Tue Sep 28 11:52:46 2010, SQUEEK wrote: Show quoted text
> t/23signal.t ................. ok > # Failed test 'socket listens on INADDR_ANY' > # at t/24listener.t line 162. > # got: ' > # ?' > # expected: '' > # Looks like you failed 1 test of 29. > t/24listener.t ............... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/29 subtests > > I suspect that part of the reason of this failing is that this test was > run inside a FreeBSD jail.
Hmm... Probably networking-related. Can you show an output of ifconfig -A or whatever it is, that shows the interfaces and addresses, please? -- Paul Evans
Output from ifconfig -v: fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC> ether 00:10:f3:12:e0:96 inet 10.21.5.150 netmask 0xfffff000 broadcast 10.21.15.255 media: Ethernet autoselect (100baseTX <full-duplex>) status: active fxp1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC> ether 00:10:f3:12:e0:97 media: Ethernet autoselect (none) status: no carrier fxp2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC> ether 00:10:f3:12:e0:98 media: Ethernet autoselect (none) status: no carrier fxp3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC> ether 00:10:f3:12:e0:99 media: Ethernet autoselect (none) status: no carrier plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 groups: lo
On Tue Sep 28 11:52:46 2010, SQUEEK wrote: Show quoted text
> Tests speak louder than words: > > t/23signal.t ................. ok > # Failed test 'socket listens on INADDR_ANY' > # at t/24listener.t line 162. > # got: ' > # ?' > # expected: '' > # Looks like you failed 1 test of 29. > t/24listener.t ............... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/29 subtests > > I suspect that part of the reason of this failing is that this test was > run inside a FreeBSD jail.
Try applying the attached patch, and see if that fixes it. -- Paul Evans
Subject: rt61724.patch
=== modified file 't/24listener.t' --- t/24listener.t 2010-08-22 16:07:34 +0000 +++ t/24listener.t 2010-09-29 15:36:06 +0000 @@ -135,6 +135,16 @@ undef $listener; undef $listensock; +# Some odd locations like BSD jails might not like INADDR_ANY. We'll establish +# a baseline first to test against +my $INADDR_ANY = do { + my $anysock = IO::Socket::INET->new( LocalPort => 0, Listen => 1 ); + $anysock->sockaddr; +}; +if( $INADDR_ANY ne INADDR_ANY ) { + diag( sprintf "Testing with INADDR_ANY=%vd; this may be because of odd networking", $INADDR_ANY ); +} + $listener = IO::Async::Listener->new( on_accept => sub { ( undef, $newclient ) = @_ }, ); @@ -146,7 +156,7 @@ my $listen_self; $listener->listen( - addr => [ AF_INET, SOCK_STREAM, 0, pack_sockaddr_in( 0, INADDR_ANY ) ], + addr => [ AF_INET, SOCK_STREAM, 0, pack_sockaddr_in( 0, $INADDR_ANY ) ], on_listen => sub { $listen_self = shift }, on_listen_error => sub { die "Test died early - $_[0] - $_[-1]\n"; }, ); @@ -159,7 +169,9 @@ my ( $port, $sinaddr ) = unpack_sockaddr_in( $sockname ); ok( $port > 0, 'socket listens on some defined port number' ); -is( $sinaddr, INADDR_ANY, 'socket listens on INADDR_ANY' ); +is( sprintf("%vd",$sinaddr), + sprintf("%vd",$INADDR_ANY), + 'socket listens on INADDR_ANY' ); is( $listen_self, $listener, '$listen_self is $listener' ); undef $listen_self; # for refcount === modified file 't/52loop-listen.t' --- t/52loop-listen.t 2010-09-20 21:17:21 +0000 +++ t/52loop-listen.t 2010-09-29 15:35:09 +0000 @@ -56,6 +56,16 @@ undef $newclient; undef $notifier; +# Some odd locations like BSD jails might not like INADDR_LOOPBACK. We'll +# establish a baseline first to test against +my $INADDR_LOOPBACK = do { + my $localsock = IO::Socket::INET->new( LocalAddr => "localhost", Listen => 1 ); + $localsock->sockaddr; +}; +if( $INADDR_LOOPBACK ne INADDR_LOOPBACK ) { + diag( sprintf "Testing with INADDR_LOOPBACK=%vd; this may be because of odd networking", $INADDR_LOOPBACK ); +} + $loop->listen( family => AF_INET, socktype => 'stream', @@ -89,7 +99,9 @@ my ( $listenport, $listen_inaddr ) = unpack_sockaddr_in( $listenaddr ); -is( $listen_inaddr, "\x7f\0\0\1", '$listenaddr is INADDR_LOOPBACK' ); +is( sprintf("%vd",$listen_inaddr), + sprintf("%vd",$INADDR_LOOPBACK), + '$listenaddr is INADDR_LOOPBACK' ); $clientsock = IO::Socket::INET->new( Type => SOCK_STREAM ) or die "Cannot socket() - $!";
On Wed Sep 29 11:38:19 2010, PEVANS wrote: Show quoted text
> Try applying the attached patch, and see if that fixes it.
The patch appears to PASS, with the diag messages showing the fxp0 interface being used. Cheers.
On Thu Sep 30 16:53:08 2010, SQUEEK wrote: Show quoted text
> On Wed Sep 29 11:38:19 2010, PEVANS wrote:
> > Try applying the attached patch, and see if that fixes it.
> > The patch appears to PASS, with the diag messages showing the fxp0 > interface being used. > > Cheers.
Excellent. That's now committed in bzr repo; will be in 0.31. -- Paul Evans