Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: rt [...] illuminated.co.uk
Cc: davidp [...] preshweb.co.uk
dcantrell [...] cpan.org
AdminCc:

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



Subject: Calling $resolver->nameservers multiple times returns an increasingly-long list
I think somehow @returnval is being turned into a state variable or something. This is clearer if you use the debugger in a modern Perl (it was clear in perl 5.20.0, totally baffling in 5.14.2). Test script: #!/usr/bin/env perl use Net::DNS; my $resolver = Net::DNS::Resolver->new(nameservers => ['192.42.93.30']); for (1..3) { print "Nameservers are ", join(', ', $resolver->nameservers), "\n"; } Output: Nameservers are 192.42.93.30 Nameservers are 192.42.93.30, 192.42.93.30 Nameservers are 192.42.93.30, 192.42.93.30, 192.42.93.30 The offending line appears to be in Net::DNS::Resolver::Base, line 341 in version 0.76: my @returnval = @{$self->{nameserver6}} if $has_inet6 && !$self->force_v4(); If I replace that with my @returnval; @returnval = @{$self->{nameserver6}} if $has_inet6 && !$self->force_v4(); the bug goes away.
From: rwfranks [...] acm.org
On Wed Jun 18 09:13:08 2014, SKINGTON wrote: Show quoted text
> I think somehow @returnval is being turned into a state variable or > something. This is clearer if you use the debugger in a modern Perl > (it was clear in perl 5.20.0, totally baffling in 5.14.2). >
Something very strange going on here! If I run your script using Net::DNS 0.77 on perlbrew 5.20.0 or 5.14.4, I can repeat your observations. However, if I do the same using the perl installed on my Fedora 20 machine (allegedly 5.18.2 + patches), I get the result you expected. This would appear to point the finger at the compiler. $ perl -w test.pl Nameservers are 192.42.93.30 Nameservers are 192.42.93.30 Nameservers are 192.42.93.30 I hate to admit defeat, but I am as baffled as you are, so in the absence of a real understanding of the problem, your suggested patch seems a reasonable response.
Show quoted text
> However, if I do the same using the perl installed on my Fedora 20 > machine (allegedly 5.18.2 + patches), I get the result you expected. > This would appear to point the finger at the compiler...
One for p5p?
From: rwfranks [...] acm.org
On Tue Jun 24 10:42:33 2014, DCANTRELL wrote: Show quoted text
> > However, if I do the same using the perl installed on my Fedora 20 > > machine (allegedly 5.18.2 + patches), I get the result you expected. > > This would appear to point the finger at the compiler...
> > One for p5p?
p5p is about jam tomorrow. We need jam today.
Will be in 0.78