Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: adam.bogacz [...] getresponse.com
Cc:
AdminCc:

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



Subject: Bug report
Date: Wed, 1 Mar 2017 12:15:25 +0000
To: "bug-Net-DNS [...] rt.cpan.org" <bug-Net-DNS [...] rt.cpan.org>
From: Adam Bogacz <adam.bogacz [...] getresponse.com>
Hi, I would like to report a bug in Net::DNS::Resolver::Base “Use of uninitialized value $unread in integer gt (>) at /<retracted>/Net/DNS/Resolver/Base.pm line 817.” Unfortunately, I’m not able to reproduce this bug on my dev environment, but we see few of them per day from our production environment. It looks like it was introduced in version 1.07_03 where function “_read_tcp” was changed: -while ($unread) { +while ( $unread > 0 ) { Thanks in advance for fixing this bug. — Best regards Adam Bogacz Software Developer GetResponse
From: rwfranks [...] acm.org
On Wed Mar 01 10:49:48 2017, adam.bogacz@getresponse.com wrote: Show quoted text
> Hi, > > I would like to report a bug in Net::DNS::Resolver::Base > > “Use of uninitialized value $unread in integer gt (>) at > /<retracted>/Net/DNS/Resolver/Base.pm line 817.” >
Does your application use Net::DNS directly, or does it depend on some other package that does so?
Subject: Re: [rt.cpan.org #120470] Bug report
Date: Thu, 2 Mar 2017 06:35:02 +0000
To: "bug-Net-DNS [...] rt.cpan.org" <bug-Net-DNS [...] rt.cpan.org>
From: Adam Bogacz <adam.bogacz [...] getresponse.com>
Hi, Our application uses Net::DNS directly. — Best regards Adam Bogacz Software Developer GetResponse On 01/03/2017, 17:29, "Dick Franks via RT" <bug-Net-DNS@rt.cpan.org> wrote: <URL: https://rt.cpan.org/Ticket/Display.html?id=120470 > On Wed Mar 01 10:49:48 2017, adam.bogacz@getresponse.com wrote: Show quoted text
> Hi, > > I would like to report a bug in Net::DNS::Resolver::Base > > “Use of uninitialized value $unread in integer gt (>) at > /<retracted>/Net/DNS/Resolver/Base.pm line 817.” >
Does your application use Net::DNS directly, or does it depend on some other package that does so?
From: rwfranks [...] acm.org
On Thu Mar 02 09:09:09 2017, adam.bogacz@getresponse.com wrote: Show quoted text
> Hi, > > Our application uses Net::DNS directly. >
It would be helpful to have some information about the system where the problem occurs. 1) Output from perl -V 2) The table of version numbers near the beginning of the "make test" output. If the original installation log is no longer to hand, a test build of 1.08 will gather the information I need. 3) An outline description of the Net::DNS::Resolver related parts of your application. 4) Confessions for sinful usage not covered by the documentation. 5) What software is the local recursive name server running, what version and on what platform. 6) Any observed pattern, if any, in the failing cases. Are some zones more likely to fail than others? If you would rather not publish all of this in RT, feel free to mail me directly.
From: rwfranks [...] acm.org
Answer came there none.
From: bbkr [...] post.pl
Hi I'll try to answer your questions as best as I can: -------- 1) Output from perl -V $ perl -V Summary of my perl5 (revision 5 version 24 subversion 1) configuration: Platform: osname=linux, osvers=3.2.50-vs2.3.2.16-beng, archname=x86_64-linux uname='linux b-gr-dev.v.l 3.2.50-vs2.3.2.16-beng #1 smp fri aug 30 16:43:33 bst 2013 x86_64 gnulinux ' config_args='-de -Dprefix=/home/ppabian/.perl5/perls/perl-5.24.1 -Duserelocatableinc -Duse64bitall -Doptimize=-O2 -march=native -pipe -Aeval:scriptdir=/home/ppabian/.perl5/perls/perl-5.24.1/bin' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2', optimize='-O2 -march=native -pipe', cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='', gccversion='4.9.2', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -march=native -pipe -L/usr/local/lib -fstack-protector-strong' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF Locally applied patches: Devel::PatchPerl 1.38 Built under linux Compiled at Feb 24 2017 14:42:48 %ENV: PERLBREW_BASHRC_VERSION="0.75" PERLBREW_HOME="/home/ppabian/.perlbrew" PERLBREW_MANPATH="/home/ppabian/.perl5/perls/perl-5.24.1/man" PERLBREW_PATH="/home/ppabian/.perl5/bin:/home/ppabian/.perl5/perls/perl-5.24.1/bin" PERLBREW_PERL="perl-5.24.1" PERLBREW_ROOT="/home/ppabian/.perl5" PERLBREW_VERSION="0.75" @INC: /home/ppabian/.perl5/perls/perl-5.24.1/lib/site_perl/5.24.1/x86_64-linux /home/ppabian/.perl5/perls/perl-5.24.1/lib/site_perl/5.24.1 /home/ppabian/.perl5/perls/perl-5.24.1/lib/5.24.1/x86_64-linux /home/ppabian/.perl5/perls/perl-5.24.1/lib/5.24.1 . -------- 2) The table of version numbers near the beginning of the "make test" output. If the original installation log is no longer to hand, a test build of 1.08 will gather the information I need. $ NET_DNS_DEBUG=1 cpanm --test-only --verbose Net::DNS ... --> Working on Net::DNS Fetching http://www.cpan.org/authors/id/N/NL/NLNETLABS/Net-DNS-1.09.tar.gz ... OK ... # These tests were run using: # Net::DNS 1.09 # Data::Dumper 2.160 # Digest::HMAC 1.03 # Digest::MD5 2.54 # Digest::SHA 5.95_01 # File::Spec 3.6301 # IO::File 1.16 # IO::Select 1.22 # IO::Socket 1.38 # IO::Socket::INET 1.35 # IO::Socket::IP 0.37 # MIME::Base64 3.15 # PerlIO 1.09 # Scalar::Util 1.47 # Socket 2.020_03 # Time::Local 1.2300 -------- 3) An outline description of the Net::DNS::Resolver related parts of your application. my $resolver = Net::DNS::Resolver->new( 'tcp_timeout' => 4, 'udp_timeout' => 4, 'persistent_tcp' => 1, 'persistent_udp' => 1, ); my $type = "A"; my $name = "mx2.hotmail.com"; if ( my $reply = $resolver->search( $name, $type ) ) { if ( my @records = grep { $_->type eq $type } $reply->answer ) { if ( $type eq 'A' ) { my $a = shift @records; return { 'resolved' => $a->address, 'until' => time + $a->ttl }; } } } -------- 4) Confessions for sinful usage not covered by the documentation. None. -------- 5) What software is the local recursive name server running, what version and on what platform. I don't know ATM, I'll try to obtain it. -------- 6) Any observed pattern, if any, in the failing cases. Are some zones more likely to fail than others? Here is full stack trace: Use of uninitialized value $unread in integer gt (>) at Net/DNS/Resolver/Base.pm line 817. Net::DNS::Resolver::Base::_read_tcp(IO::Socket::IP=GLOB(0x7661d70)) called at Net/DNS/Resolver/Base.pm line 438 Net::DNS::Resolver::Base::_send_tcp(Net::DNS::Resolver=HASH(0x426dd28), Net::DNS::Packet=HASH(0x7661c50), "\x{e3}\x{95}\x{1}\x{0}\x{0}\x{1}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{3}mx2\x{7}hotmail\x{3}com\x{0}\x{0}\x{1}\x{0}\x{1}") called at Net/DNS/Resolver/Base.pm line 413 Net::DNS::Resolver::Base::send(Net::DNS::Resolver=HASH(0x426dd28), "mx2.hotmail.com", "A") called at Net/DNS/Resolver/Base.pm line 390 Net::DNS::Resolver::Base::search(Net::DNS::Resolver=HASH(0x426dd28), "mx2.hotmail.com", "A") I see all kind of zones, domains and record types failing from time to time. However I cannot reproduce this bug in constant fashion using oneliner. Therefore I suspect that this occurs only on some network issues, maybe _read_tcp hits timeout and returns nothing for callee?
From: bbkr [...] post.pl
I have a suspicion that something is broken with "truncated" reply that causes UDP->TCP fallback for long answers. All errors I've captured are in _read_tcp() and happens on large output such as DKIM TXT records, big ISPs or some cloud addresses. Maybe timeout started in UDP communication is not properly terminated and started again in TCP communication, and TCP communication suddenly gets interrupted by "foreign" timer? I'm not an expert in DNS stuff, so this is only theory without proper Net::DNS code analysis.
From: rwfranks [...] acm.org
On Mon Apr 03 04:22:10 2017, bbkr@post.pl wrote: Show quoted text
> Hi > > I'll try to answer your questions as best as I can: >
Thanks I note that you have already built Net::DNS 1.09. That release contains a speculative modification based on the hypothesis that the present problem might be caused by the two byte DNS packet length becoming split across two socket->recv()s. Without making any other changes, please try installing 1.09 to see if this makes the problem disappear.
From: bbkr [...] post.pl
Hi Thanks for prompt reply! Sorry about the confusion with 1.08 vs 1.09 version while listing dependencies. i'm using 1.08 and haven't realized cpanm fetched newer one. Still, the list of dependencies remains valid. I've scheduled update to 1.09 on Wednesday, I'll report on Friday if issue is resolved (I hit this error up to 10 times per day, so 2 days observation should give reasonable conclusions).
From: bbkr [...] post.pl
After update to 1.09 on Wednesday i no longer get “Use of uninitialized value $unread in integer gt (>) at /<retracted>/Net/DNS/Resolver/Base.pm line 817.” So I think task can be marked as resolved. However after this update I'm getting SpamAssassin errors: Use of uninitialized value $4 in concatenation (.) or string at /home/getresponse/perl-5.24.1/lib/site_perl/5.24.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm line 1042. Use of uninitialized value $3 in concatenation (.) or string at /home/getresponse/perl-5.24.1/lib/site_perl/5.24.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm line 1042. Use of uninitialized value $2 in concatenation (.) or string at /home/getresponse/perl-5.24.1/lib/site_perl/5.24.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm line 1042. dns: new_dns_packet (domain=...(.sbl.spamhaus.org. type=A class=IN) failed: a domain name contains a null label dns: new_dns_packet (domain=...(.zen.spamhaus.org. type=A class=IN) failed: a domain name contains a null label I'll report it upstream to SA team. Thanks for your help. I appreciate it.
From: rwfranks [...] acm.org
On Mon Apr 10 03:43:40 2017, bbkr@post.pl wrote: Show quoted text
> After update to 1.09 on Wednesday i no longer get “Use of > uninitialized value $unread in integer gt (>) at > /<retracted>/Net/DNS/Resolver/Base.pm line 817.” > > So I think task can be marked as resolved. >
Thanks Show quoted text
> However after this update I'm getting SpamAssassin errors: > > Use of uninitialized value $4 in concatenation (.) or string at > /home/getresponse/perl- > 5.24.1/lib/site_perl/5.24.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm line > 1042. > Use of uninitialized value $3 in concatenation (.) or string at > /home/getresponse/perl- > 5.24.1/lib/site_perl/5.24.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm line > 1042. > Use of uninitialized value $2 in concatenation (.) or string at > /home/getresponse/perl- > 5.24.1/lib/site_perl/5.24.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm line > 1042. > dns: new_dns_packet (domain=...(.sbl.spamhaus.org. type=A class=IN) > failed: a domain name contains a null label > dns: new_dns_packet (domain=...(.zen.spamhaus.org. type=A class=IN) > failed: a domain name contains a null label >
Replace DomainName.pm with the 1.08 version to see if the problem disappears. If it does, please raise another bug report here. The reason these differ is to get round a compiler optimisation problem that derails Devel::Cover. If not, do the same with Domain.pm.