Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 72314
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: willem [...] cpan.org
Requestors: jdhedden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.67
Fixed in: (no value)



Subject: t/13-udp-trunc.t failures under Cygwin on Windows
Net-DNS-0.67 > perl -Mblib t/13-udp-trunc.t # Testing availability of 127.0.0.1 1..100 ok 1 - use Net::DNS::Nameserver; Couldn't create TCP socket: Address family not supported by protocol at /var/perl/cpan/build/Net-DNS-0.67/blib/lib/Net/DNS/Nameserver.pm line 98 Net::DNS::Nameserver::new('Net::DNS::Nameserver', 'LocalPort', 5334, 'LocalAddres', 127.0.0.1, 'ReplyHandler', 'CODE(0x1016d3c0)') called at t/13-udp-trunc.t line 63 Couldn't create UDP socket: Address family not supported by protocol at /var/perl/cpan/build/Net-DNS-0.67/blib/lib/Net/DNS/Nameserver.pm line 117 Net::DNS::Nameserver::new('Net::DNS::Nameserver', 'LocalPort', 5334, 'LocalAddres', 127.0.0.1, 'ReplyHandler', 'CODE(0x1016d3c0)') called at t/13-udp-trunc.t line 63 Can't call method "udp_connection" on an undefined value at t/13-udp-trunc.t line 90. # Looks like you planned 100 tests but ran 1. # Looks like your test exited with 9 just after 1. Subject: FAIL Net-DNS-0.67 i686-cygwin-thread-multi-64int 1.7.5(0.22553) To: cpan-testers@perl.org From: jdhedden@cpan.org TEST RESULTS: PERL_DL_NONLAZY=1 /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t # # These tests were run using: # Net::DNS::VERSION: 0.67 # set environment variable NET_DNS_DEBUG to get all versions t/00-load.t ....................... ok t/00-pod.t ........................ ok t/00-version.t .................... ok t/01-resolver-env.t ............... ok t/01-resolver-file.t .............. ok t/01-resolver-flags.t ............. ok t/01-resolver-opt.t ............... ok t/01-resolver.t ................... ok t/02-domain.t ..................... ok t/02-domainname.t ................. ok t/02-header.t ..................... ok t/03-question.t ................... ok t/04-packet-unique-push.t ......... ok t/04-packet.t ..................... ok t/05-apl.t ........................ ok t/05-rr-opt.t ..................... ok t/05-rr-rrsort.t .................. ok t/05-rr-sshfp.t ................... skipped: Digest::BubbleBabble not installed. t/05-rr-txt.t ..................... ok t/05-rr-unknown.t ................. ok t/05-rr-various.t ................. ok # Number of RRs: 33 Number of methods: 127 t/05-rr.t ......................... ok t/06-update.t ..................... ok t/07-misc.t ....................... ok t/08-online.t ..................... ok t/09-tkey.t ....................... ok t/10-recurse.t .................... skipped: Cannot run these tests from this IP: 192.168.44.161 # Using the XS compiled dn_expand function # # disabling XS based dns_expand for a moment. # # Continuing to use the XS based dn_expand() t/11-escapedchars.t ............... ok t/11-inet6.t ...................... skipped: Online tests disabled. 123456789112345678921234567893123456789412345678951234567896123... truncated to 63 octets (RFC1035 2.3.1) at t/12-compression.t line 56 t/12-compression.t ................ ok # Testing availability of 127.0.0.1 Couldn't create TCP socket: Address family not supported by protocol at /var/perl/cpan/build/Net-DNS-0.67/blib/lib/Net/DNS/Nameserver.pm line 98 Net::DNS::Nameserver::new('Net::DNS::Nameserver', 'LocalPort', 5334, 'LocalAddres', 127.0.0.1, 'ReplyHandler', 'CODE(0x100fe000)') called at t/13-udp-trunc.t line 63 Couldn't create UDP socket: Address family not supported by protocol at /var/perl/cpan/build/Net-DNS-0.67/blib/lib/Net/DNS/Nameserver.pm line 117 Net::DNS::Nameserver::new('Net::DNS::Nameserver', 'LocalPort', 5334, 'LocalAddres', 127.0.0.1, 'ReplyHandler', 'CODE(0x100fe000)') called at t/13-udp-trunc.t line 63 Can't call method "udp_connection" on an undefined value at t/13-udp-trunc.t line 90. # Looks like you planned 100 tests but ran 1. # Looks like your test exited with 9 just after 1. t/13-udp-trunc.t .................. Dubious, test returned 9 (wstat 2304, 0x900) Failed 99/100 subtests t/17-pure-virtual-replyhandler.t .. ok # Cleaning t/99-cleanup.t .................... ok Test Summary Report ------------------- t/13-udp-trunc.t (Wstat: 2304 Tests: 1 Failed: 0) Non-zero exit status: 9 Parse errors: Bad plan. You planned 100 tests but ran 1. Files=33, Tests=1666, 79 wallclock secs ( 0.28 usr 0.38 sys + 11.06 cusr 7.99 csys = 19.71 CPU) Result: FAIL Failed 1/33 test programs. 0/1666 subtests failed. make: *** [test_dynamic] Error 255 -- Summary of my perl5 (revision 5 version 10 subversion 1) configuration: Platform: osname=cygwin, osvers=1.7.5(0.22553), archname=i686-cygwin-thread-multi-64int uname='cygwin_nt-5.1 reini 1.7.5(0.22553) 2010-04-12 19:07 i686 cygwin ' config_args='-de -Dlibperl=cygperl5_10.dll -Dcc=gcc-4 -Dld=g++-4 -Dmksymlinks -Dusethreads -Dmad=y -Doptimize=-O3 -Accflags=-g3' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='gcc-4', ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g3 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include', optimize='-O3', cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g3 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.3.4 20090804 (release) 1', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++-4', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib /lib libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat perllibs=-ldl -lcrypt libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=cygperl5_10.dll gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY MYMALLOC PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MAD PERL_USE_SAFE_PUTENV USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Locally applied patches: CYG11 no-bs CYG12 no archlib in otherlibdirs CYG14 Dynaloader CYG15 static-Win32CORE CYG17 utf8-paths CYG21 LibList-Kid.patch CYG22 cygwin-1.7 hints CYG23 544-stat CYG24 build man pages CYG25 rebase_privlib Module-Build-0.36_13 Bug#55162 CYG18 File::Spec::case_tolerant performance disable ExtUtils::MakeMaker::Coverage in Sys-Syslog Built under cygwin Compiled at Aug 28 2010 20:17:29 %ENV: PERLIO="perlio" PERL_CORE="" CYGWIN="nodosfilewarning" @INC: /usr/lib/perl5/5.10/i686-cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .
Hi Jerry, This is quiet mysterious. Test nameservers are also spawn in 17-pure-virtual-replyhandler.t which *did* work in your case... The major difference between those two tests is that 17 tries to find a free port, and 13 uses port 5334. I have modified test 13 to also test for a free port (attached), could you try it out and let me know if that is working? Thanks! Willem
Subject: 13-udp-trunc.t
# $Id: 13-udp-trunc.t 837 2009-12-30 10:23:25Z olaf $ -*-perl-*- # Bulk of this code is contributed by Aaron Crane in 2008 # via rt.cpan.org ticket 33547 # Portions (c) 2009 Olaf Kolkman use Test::More; use strict; use Data::Dumper; my $ZONE = 'example.com'; use_ok('Net::DNS::Nameserver'); use vars qw( $Address $TestPort $numberoftests ); sub freeport { my @sockets = map { IO::Socket::INET->new(Listen => 1) } (1..shift); return map { $_->sockport } @sockets; } BEGIN{ $TestPort = 5334; $Address = "127.0.0.1"; $numberoftests=100; if( eval {require IO::Socket;}){ diag ("Test nameserver will be listening on port..."); ($TestPort) = freeport(1); diag ("$TestPort."); plan tests => $numberoftests; }else{ plan skip_all => 'Some modules required for this test are not available (dont\'t worry about this)'; exit; } } { my @full_response; my $ns = Net::DNS::Nameserver->new( LocalPort => $TestPort, LocalAddres => $Address, ReplyHandler => sub { NOERROR => @full_response }, ); for (trad_query(), edns_query(1024), edns_query(2048)) { my ($query, $size) = @$_; for my $n ( [1, 1, 1], [5, 1, 1], [10, 1, 1], [1, 1, 30], [40, 40, 40], [50, 1, 1], [1, 50, 1], [20, 20, 1], [20, 1, 50], [60, 60, 60], [60, 100, 60], ) { @full_response = make_response($n); my $notcomp=Net::DNS::Packet->new(); $notcomp->push("question", $query->question); my ($ans, $auth, $add)=@full_response; $notcomp->push("answer", @$ans) if $ans; $notcomp->push("authority", @$auth) if $auth; $notcomp->push("additional", @$add) if $add; #$notcomp->print; my $socket = Mock::UDP->new($query->data); $ns->udp_connection($socket); my $reply_data = $socket->output; my $reply = Net::DNS::Packet->new(\$reply_data); #$reply->print; cmp_ok(length $reply_data, '<=', $size, "UDP-$size reply for\t($n->[0] , $n->[1], $n->[2])\t records short enough ($size: ".length($notcomp->data) ."->". length ( $reply_data ) . ")") || $reply->print; ok($reply, "UDP-$size reply for\t($n->[0] , $n->[1], $n->[2])\t received answer"); my $got = reply_records($reply); my $expected = response_records($query, @full_response); ok(is_prefix($reply->header->tc, $got, $expected), "UDP-$size reply for\t($n->[0] , $n->[1], $n->[2])\t records complete or sanely truncated"); } } } sub trad_query { return [Net::DNS::Packet->new($ZONE), 512]; } sub edns_query { my $size = shift; my $edns_rr = Net::DNS::RR->new(type => 'OPT', class => $size, name => ''); my $query = Net::DNS::Packet->new($ZONE); $query->push(additional => $edns_rr); return [$query, $size]; } sub reply_records { my ($reply) = @_; my @records; for my $section (qw<question answer authority additional>) { push @records, map { [$section => $_] } $reply->$section; } return \@records; } sub response_records { my ($query, @response) = @_; unshift @response, [$query->question]; my @records; for my $section (qw<question answer authority additional>) { push @records, map { [$section => $_] } @{ shift @response }; } return \@records; } sub is_prefix { my ($truncated, $got_list, $expected_list) = @_; die 'TEST BUG: no records expected' if !@$expected_list; if (@$got_list > @$expected_list) { diag("Most peculiar: got too many records"); return 0; } my @seen; my $rr_got; my $rr_exp; # Start investigating the additonal section # if we find an RR with a certain (name,class,type) in the additonal section (in got) then # we expect all RRs from from that (name,class,type) from the expected array to be in the packet. # if a certain RR (name,class,type) from the expected array is not found in the packet than all # RRs from that set expect to be stripped. foreach my $tst ( @$expected_list ){ next unless $tst->[0] eq "additional"; $rr_exp->{$tst->[1]->name. "--". $tst->[1]->class. "--". $tst->[1]->type}{$tst->[1]->rdatastr} = 1; } foreach my $tst ( @$got_list ){ next unless $tst->[0] eq "additional"; $rr_got->{$tst->[1]->name. "--". $tst->[1]->class. "--". $tst->[1]->type}{$tst->[1]->rdatastr} = 1; } foreach my $a (keys %$rr_exp){ if (defined $rr_got->{$a}){ foreach my $b (keys %{$rr_got->{$a}}){ if (defined($rr_exp->{$a}->{$b})){ delete $rr_got->{$a}->{$b}; delete $rr_exp->{$a}->{$b}; } delete $rr_got->{$a} unless (keys %{$rr_got->{$a}}); delete $rr_exp->{$a} unless (keys %{$rr_exp->{$a}}); } }else{ delete $rr_exp->{ $a } } } if (my @a=keys %$rr_exp){ foreach my $a ( @a) { diag ("One RR of name-class-type $a got stripped from the packet while leaving others in the additional section"); } return 0; } if (my @b=keys %$rr_got){ foreach my $b ( @b) { diag ("One RR of name-class-type $b did not get stripped from the additional section"); } return 0; } for (;;) { #return !$truncated == !@$expected_list if !@$got_list; last if ! @$got_list; my $got = shift @$got_list; push @seen, $got; my $expected = shift @$expected_list; my ($got_s, $expected_s) = map { $_->[1]->string } $got, $expected; if ($got->[0] eq "additional" && $expected->[0] eq "additional"){ # this is the situation where we are looking at the truncated additional section. # Since there are still records left the the TC bit should not be set. if ($truncated){ diag ("There are still records in the additonal section but the truncation bit seems set"); return 0; } next; }elsif ($got->[0] ne $expected->[0] || $got_s ne $expected_s) { diag("Got[$got->[0] $got_s] Expected[$expected->[0] $expected_s]"); return 0; } } return(1); } sub make_response { my ($n,$m,$p) = @{shift()}; # create sets of nameservers ns0... ns2 my @ans = map { Net::DNS::RR->new("$ZONE 9 IN A 10.0.0.$_") } 1 .. $n; my @auth = map { Net::DNS::RR->new("$ZONE 9 IN NS ns". $_%3 .".$ZONE") } 1 .. $m; my @add = map { Net::DNS::RR->new("ns". $_%3 .".$ZONE 9 IN A 10.0.1.".$_%256) } 1 .. $p; return \@ans, \@auth, \@add; } { package Mock::UDP; sub new { my ($class, $data) = @_; return bless { input => $data, output => '', }, $class; } sub peerhost { '127.0.0.1' } sub peerport { 65534 } sub output { $_[0]{output} } sub sockhost {$main::Address} sub sockport {$main::TestPort} sub recv { my ($self, $buf, $len) = @_; return if $self->{input} eq ''; my $data = substr $self->{input}, 0, $len, ''; $_[1] = $data; } sub send { my ($self, $data) = @_; $self->{output} .= $data; 1; } }
Subject: Re: [rt.cpan.org #72314] t/13-udp-trunc.t failures under Cygwin on Windows
Date: Thu, 10 Nov 2011 08:32:23 -0500
To: bug-Net-DNS [...] rt.cpan.org
From: "Jerry D. Hedden" <jdhedden [...] cpan.org>
Results are the same: Net-DNS-0.67 > perl -Mblib /xfer/13-udp-trunc.t # Test nameserver will be listening on port... # 1388. 1..100 ok 1 - use Net::DNS::Nameserver; Couldn't create TCP socket: Address family not supported by protocol at /var/perl/cpan/build/Net-DNS-0.67/blib/lib/Net/DNS/Nameserver.pm line 98 Net::DNS::Nameserver::new('Net::DNS::Nameserver', 'LocalPort', 1388, 'LocalAddres', 127.0.0.1, 'ReplyHandler', 'CODE(0x1016d3c0)') called at /xfer/13-udp-trunc.t line 53 Couldn't create UDP socket: Address family not supported by protocol at /var/perl/cpan/build/Net-DNS-0.67/blib/lib/Net/DNS/Nameserver.pm line 117 Net::DNS::Nameserver::new('Net::DNS::Nameserver', 'LocalPort', 1388, 'LocalAddres', 127.0.0.1, 'ReplyHandler', 'CODE(0x1016d3c0)') called at /xfer/13-udp-trunc.t line 53 Can't call method "udp_connection" on an undefined value at /xfer/13-udp-trunc.t line 80. # Looks like you planned 100 tests but ran 1. # Looks like your test exited with 9 just after 1. On Thu, Nov 10, 2011 at 05:34, Willem Toorop via RT <bug-Net-DNS@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=72314 > > > Hi Jerry, > > This is quiet mysterious. Test nameservers are also spawn in > 17-pure-virtual-replyhandler.t which *did* work in your case... > The major difference between those two tests is that 17 tries to find a > free port, and 13 uses port 5334. > I have modified test 13 to also test for a free port (attached), could > you try it out and let me know if that is working? > > Thanks! Willem >
Subject: Re: [rt.cpan.org #72314] t/13-udp-trunc.t failures under Cygwin on Windows
Date: Thu, 10 Nov 2011 16:26:44 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Willem Toorop <Willem [...] NLnetLabs.nl>
The silly thing is that the nameserver object doesn't even receive the test queries over the socket (that's were the Mock::UDP package in the test is for). Did you have this error with the 0.66 release too? If not, it might have something to do with the disabling of IPv6... -- Willem
Subject: Re: [rt.cpan.org #72314] t/13-udp-trunc.t failures under Cygwin on Windows
Date: Thu, 10 Nov 2011 12:30:00 -0500
To: bug-Net-DNS [...] rt.cpan.org
From: "Jerry D. Hedden" <jdhedden [...] cpan.org>
Seems that Net::DNS comes pre-installed with the version of Perl I'm using: Module: Net::DNS Version: 0.66_01 File: /usr/lib/perl5/vendor_perl/5.10/i686-cygwin/Net/DNS.pm When I tried to test v0.66 from CPAN, it fails all over the place because of no Win32::Registry, and I can't install that because of compilation errors (Could not find a typemap for C type 'FILETIME' in Registry.xs, line 548). Also, I don't know whether or not my Perl and/or PC handles IPv6. On Thu, Nov 10, 2011 at 10:26, Willem Toorop via RT <bug-Net-DNS@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=72314 > > > The silly thing is that the nameserver object doesn't even receive the > test queries over the socket (that's were the Mock::UDP package in the > test is for). > > Did you have this error with the 0.66 release too? If not, it might have > something to do with the disabling of IPv6...
The system I used for the 0.67 release unfortunately didn't produce the error, so I woke up and older virtual machine with an older Cygwin installation that I had lying around and it produces the error as well! The error was actually in two places. First in 13-udp-trunc.t there is a typo on line 61. LocalAddres => $Address, should become: LocalAddr => $Address, But, this wouldn't be a problem if not also the default address selection in Net::DNS::Nameserver was broken. A fix for it is committed in trunk and will be in the next Net::DNS release: 0.68. Thanks for you report! Willem