2

I am trying to test out the new version of cpan-Net-DNS (version 1.35) and it fails in the Net/DNS/Resolver/Base.pm file at line 987 with the following error.

***  FATAL PROGRAM ERROR!!  Unknown instance method 'size'
***  which the program has attempted to call for the object:
***
.   IN  OPT  ; no data
***
***  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.
***
Net::DNS::RR 1714 at Net/DNS/Resolver/Base.pm line 987.
    Net::DNS::Resolver::Base::_make_query_packet(Net::DNS::Resolver=HASH(0x55ebcfcd3d68), "example.com") called at Net/DNS/Resolver/Base.pm line 402
    Net::DNS::Resolver::Base::send(Net::DNS::Resolver=HASH(0x55ebcfcd3d68), "example.com") called at Net/DNS/Resolver/Base.pm line 374

Has anyone seen this before?

This was on linux version 5.15. I tried the same thing on linux version 5.10 and it works but I can't pin point as to why. Here is the snippet of code I am running. This is on perl5.26

use Test::Simple;
use Net::DNS;
my $resolver = new Net::DNS::Resolver();
my $packet = $resolver->query('example.com');
ok($packet->answersize > 0, "NET::DNS");
11
  • 1
    "This was on linux version 5.15. I tried the same thing on linux version 5.10" - whatever you mean with this: The linux kernel version - irrelevant, some linux distribution like RHEL, CentOS, ... - please specify. The really relevant thing though is the version of Net::DNS used, not the version of linux or the distribution. Commented Dec 19, 2022 at 13:25
  • 1
    Does the error really happen with example.com or with another value you've entered? In the latter case - did you also try example.com? Commented Dec 19, 2022 at 16:08
  • 2
    So does DNS resolution work at all in this environment (linux kernel 5.15), i.e. have you tried dig or just ping example.com ? And if these work - is it only Net::DNS 1.35 or also older versions? Commented Dec 19, 2022 at 16:38
  • 1
    "Yes I have tried dig, ping etc" - and do they work on 5.15, i.e. show the expected IP address? Because - for me your code actually works with 5.15. Commented Dec 19, 2022 at 17:39
  • 1
    Rating my stupidity level at 10 I am gonna say that I didn't have the right PERLLIB set to the right path. In my defense the error wasn't very descriptive Commented Dec 20, 2022 at 0:00

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.