Skip Menu |

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

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

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

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



Subject: AUTOLOAD error confusing w/o reference to object class
I get this error sometimes, but not always: *** FATAL PROGRAM ERROR!! Unknown method 'address' *** which the program has attempted to call for the object: *** 199.110.65.125.zen.spamhaus.org. 300 IN A \# 4 7f00000b *** *** This object does not have a method 'address'. THIS IS A BUG *** IN THE CALLING SOFTWARE, which incorrectly assumes that the *** object would be of a particular type. The type of an object *** should be checked before calling any of its methods. The line of code calling "address" is: my @reply = map { $_->address } grep { $_->type eq 'A' } $query->answer; So, I only call address after checking that type is A. This suggests that maybe the record isn't being blessed into the right class sometimes..? It might be useful to include the class of the object in the error as well. **FURTHERMORE**: This error never occurred/occurs with v0.63. It only happened when I tried upgrading to 0.82 -- rjbs
From: rwfranks [...] acm.org
On Wed Jan 28 13:49:54 2015, RJBS wrote: Show quoted text
> So, I only call address after checking that type is A. This suggests > that maybe the record isn't being blessed into the right class > sometimes..? It might be useful to include the class of the object in > the error as well.
That is a reasonable suggestion. However, I can tell you that the object was blessed into class Net::DNS::RR. If it had not been, the AUTOLOAD subroutine would not have been found to give the error message. Show quoted text
> > **FURTHERMORE**: This error never occurred/occurs with v0.63. It > only happened when I tried upgrading to 0.82
Given that history, I will hazard a guess that Perl is seeing a mixture of 0.63 and 0.82 packages on the library search path. The reason this matters is because the internal interface between the base Net::DNS::RR package and type-specific implementation packages changed in 0.69. Best thing to do is clean up your library path so Perl only sees Net::DNS 0.82. If that does not work, clear out all versions of Net::DNS and do a clean install of 0.82.
Subject: Re: [rt.cpan.org #101798] AUTOLOAD error confusing w/o reference to object class
Date: Thu, 29 Jan 2015 16:19:05 -0500
To: Dick Franks via RT <bug-Net-DNS [...] rt.cpan.org>
From: Ricardo Signes <rjbs [...] cpan.org>
* Dick Franks via RT <bug-Net-DNS@rt.cpan.org> [2015-01-29T16:07:18] Show quoted text
> > So, I only call address after checking that type is A. This suggests > > that maybe the record isn't being blessed into the right class > > sometimes..? It might be useful to include the class of the object in > > the error as well.
> > That is a reasonable suggestion. However, I can tell you that the object was > blessed into class Net::DNS::RR. If it had not been, the AUTOLOAD subroutine > would not have been found to give the error message.
Isn't it the case that it could be any subclass of Net::DNS::RR that does not have an address method? -- rjbs
Download signature.asc
application/pgp-signature 473b

Message body not shown because it is not plain text.

From: rwfranks [...] acm.org
On Thu Jan 29 16:19:16 2015, RJBS wrote: Show quoted text
> > Isn't it the case that it could be any subclass of Net::DNS::RR that > does not > have an address method?
No, there are only two possibilities; RR is either blessed into Net::DNS::RR::A or Net::DNS::RR.
Thanks Ricardo, The "has no method" message has been altered to mention the class and the version of the module for the class so we can see what went wrong more quickly in the future.