Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: steveocepek [...] gmail.com
Cc: cpan [...] barely3am.com
AdminCc:

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



Subject: Resolver 0.69 and newer fails to load non-existant linux.pm file
Date: Thu, 31 Jan 2013 18:07:23 -0500
To: bug-Net-DNS [...] rt.cpan.org
From: Steve Ocepek <steveocepek [...] gmail.com>
Net::DNS::Resolver does this at line 33: eval "require Net::DNS::Resolver::$_;"; $_ is $^O which is "linux" on Linux distros, which causes an error. 0.68 and older don't do this, that code uses $^O for MSWin32/cygwin, then falls back to UNIX.pm as a default.
From: rwfranks [...] acm.org
On Thu Jan 31 18:07:32 2013, steveocepek@gmail.com wrote: Show quoted text
> Net::DNS::Resolver does this at line 33: > > eval "require Net::DNS::Resolver::$_;"; > > > $_ is $^O which is "linux" on Linux distros, which causes an error. > 0.68 and older don't do this, that code uses $^O for MSWin32/cygwin, > then falls back to UNIX.pm as a default.
How does this cause a problem? Error message text? Platform?
Subject: Re: [rt.cpan.org #83078] Resolver 0.69 and newer fails to load non-existant linux.pm file
Date: Wed, 20 Feb 2013 11:07:35 -0500
To: bug-Net-DNS [...] rt.cpan.org
From: Steve Ocepek <steveocepek [...] gmail.com>
Problem: the require fails, stops program execution Error: Can't locate Net/DNS/Resolver/linux.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at (eval 172) line 1. Platform: Ubuntu 12.10, 12.04 Imagine it affects other Linux distros as well due to use of $^O in eval statement On Sat, Feb 9, 2013 at 6:20 AM, Dick Franks via RT <bug-Net-DNS@rt.cpan.org>wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83078 > > > On Thu Jan 31 18:07:32 2013, steveocepek@gmail.com wrote:
> > Net::DNS::Resolver does this at line 33: > > > > eval "require Net::DNS::Resolver::$_;"; > > > > > > $_ is $^O which is "linux" on Linux distros, which causes an error. > > 0.68 and older don't do this, that code uses $^O for MSWin32/cygwin, > > then falls back to UNIX.pm as a default.
> > How does this cause a problem? > > Error message text? > > Platform? > >
RT-Send-CC: rwfranks [...] acm.org
Broken on Debian as well. Can't locate Net/DNS/Resolver/linux.pm in @INC (@INC contains: /opt/cif/bin/../local/lib /opt/cif/bin/../lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 1054) line 1.
From: rwfranks [...] acm.org
The cpantesters.org database lists 56 PASS and 0 FAIL results for 0.72 on Debian. A further 2000+ PASS results are listed for 0.69+ across a wide spread of linux and Unix platforms; none of these was hampered by the absence of linux.pm, sunos.pm or whatever.pm. There must be something else going on here. Please can you unpack a clean 0.72 tarball into /tmp, follow the build instructions and capture the output from "make test". If the output gets excessive, you can stop it after 03-rr.t The test should be run with no non-standard elements in the @INC search path. The environment variable PERL5LIB should be undefined. On Mon Feb 25 15:10:16 2013, DCRAWFORD wrote: Show quoted text
> Broken on Debian as well. > > > Can't locate Net/DNS/Resolver/linux.pm in @INC (@INC contains: > /opt/cif/bin/../local/lib > /opt/cif/bin/../lib /etc/perl /usr/local/lib/perl/5.10.1 > /usr/local/share/perl/5.10.1 > /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 > /usr/share/perl/5.10 /usr/local/lib/site_perl > .) at (eval 1054) line 1. >
Subject: Re: [rt.cpan.org #83078] Resolver 0.69 and newer fails to load non-existant linux.pm file
Date: Thu, 14 Mar 2013 16:46:51 -0400
To: bug-Net-DNS [...] rt.cpan.org
From: Steve Ocepek <steveocepek [...] gmail.com>
Indeed I agree there is something else at work here. I did the build as you recommended and I cannot reproduce the issue. The eval statement still looks for Net::DNS::Resolver::linux as seen in the debugger: Net::DNS::Resolver::CODE(0x27ebba8)((eval 6)[/usr/local/lib/perl/5.14.2/Net/DNS/Resolver.pm:33]:1): 1: require Net::DNS::Resolver::linux; but I realize now that using eval is a trick to avoiding program interruption when trying to include a module that may or may not exist. What is strange is that many of us using the CIF project are seeing this error quite a bit: https://groups.google.com/forum/?fromgroups=#!searchin/ci-framework/net::dns::resolver::linux and it seems to occur in that eval statement that doesn't produce an error under normal conditions. For example: cif@cif lib]$ time /opt/cif/bin/cif_analytic -d -t 8 -m 1250 Can't locate Net/DNS/Resolver/linux.pm in @INC (@INC contains: /opt/cif/bin/../local/lib /opt/cif/bin/../lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 150) line 1. So it could be a bug in a specific perl version that we're using or maybe thread-related, but I couldn't reproduce the error so far by doing the require inside of a thread. There have been cases where eval's work differently when threads are used however: http://www.nntp.perl.org/group/perl.perl5.porters/2012/06/msg187631.html I agree it's not a coding error, just documenting a few things here in case it helps someone to locate the exact problem. If the other poster on this thread could share more details around their use of Net::DNS, that would also be helpful. Thanks for looking into this and I'll let you know if I ever track down the exact condition that causes the problem. On Wed, Feb 27, 2013 at 1:02 AM, Dick Franks via RT <bug-Net-DNS@rt.cpan.org Show quoted text
> wrote:
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83078 > > > > The cpantesters.org database lists 56 PASS and 0 FAIL results for 0.72 > on Debian. A further 2000+ PASS results are listed for 0.69+ across a > wide spread of linux and Unix platforms; none of these was hampered by > the absence of linux.pm, sunos.pm or whatever.pm. > > There must be something else going on here. > > Please can you unpack a clean 0.72 tarball into /tmp, follow the build > instructions and capture the output from "make test". If the output gets > excessive, you can stop it after 03-rr.t > > The test should be run with no non-standard elements in the @INC search > path. The environment variable PERL5LIB should be undefined. > > > > On Mon Feb 25 15:10:16 2013, DCRAWFORD wrote:
> > Broken on Debian as well. > > > > > > Can't locate Net/DNS/Resolver/linux.pm in @INC (@INC contains: > > /opt/cif/bin/../local/lib > > /opt/cif/bin/../lib /etc/perl /usr/local/lib/perl/5.10.1 > > /usr/local/share/perl/5.10.1 > > /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 > > /usr/share/perl/5.10 /usr/local/lib/site_perl > > .) at (eval 1054) line 1. > >
> > > >
From: marcus [...] mindmined.com
Had this same thing happen to me, on a Red Hat EL6 system, using Perlbrew and Carton for installations: Can't locate Net/DNS/Resolver/linux.pm in @INC (@INC contains: . local/lib/perl5/x86_64-linux-thread-multi local/lib/perl5 IX/local/lib/perl5/x86_64-linux-thread-multi IX/local/lib/perl5 IX Local RGraph Remedy /usr/local/bin/perl5/perls/perl-5.10.1/lib/5.10.1/x86_64-linux-thread-multi /usr/local/bin/perl5/perls/perl-5.10.1/lib/5.10.1 /usr/local/bin/perl5/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux-thread-multi /usr/local/bin/perl5/perls/perl-5.10.1/lib/site_perl/5.10.1) at (eval 96) Copying UNIX.pm to a new linux.pm and changing the first line in linux.pm to: package Net::DNS::Resolver::linux; ... resolved the problem for me.
From: rwfranks [...] acm.org
Steve, On Thu Mar 14 16:47:04 2013, steveocepek@gmail.com wrote: Show quoted text
> Indeed I agree there is something else at work here. I did the build > as you > recommended and I cannot reproduce the issue.
Thanks Show quoted text
> The eval statement still > looks for Net::DNS::Resolver::linux as seen in the debugger:
The eval{ require something; } idiom is widely used to load code which may or may not be installed. The "linux" part comes from Perl's idea about the platform it is running on. Linux is much like Unix, so nothing needs be done. Show quoted text
>
As the failure involves a 2 line code fragment, which one might expect to be too small to have any interesting behaviour, the only mechanism I can think of which might break it, is to speculate that the $@ variable is getting destroyed by another thread in between the inside of eval where it is set and the test for error. I would have expected $@ to be local to each thread, otherwise the construct is inherently unsafe. As there are Perl revisions out there which exhibit this failing, we will need to write it out of the code. Dick
This is fixed in the upcoming 0.73 release