Skip Menu |

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

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

People
Owner: rt-cpan [...] triv.org
Requestors: DougB [...] FreeBSD.org
Cc:
AdminCc:

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



Subject: Unitialized variable warnings in RR.pm
This bug is new to 0.25. perl -v This is perl, version 5.005_03 built for i386-freebsd FreeBSD 4.6-STABLE-0714 The attached tarball contains a patch to RR.pm that helps highlight the problem, and a test script that reproduces it. The short version is that when running with -w, the new AUTOLOAD code causes an unitialized variable warning for each new type the first time it's created. On my system, with the attached patch applied the test script produces the following output: Show quoted text
Debug> class: Net::DNS::RR::NS name: type
Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 641. Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 644. Show quoted text
Debug> class: Net::DNS::RR::NS name: nsdname
Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 641. Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 644. name servers: dns.viptx.net viper.viptx.net name servers: viper.viptx.net dns.viptx.net name servers: dns.viptx.net viper.viptx.net Show quoted text
Debug> class: Net::DNS::RR::A name: name
Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 641. Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 644. Show quoted text
Debug> class: Net::DNS::RR::A name: address
Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 641. Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 644. Show quoted text
Debug> class: Net::DNS::RR::SOA name: serial
Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 641. Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 644. Serial: 2002050201 If I remove -w from the script, or if I change the code in lines 628-642 in RR.pm back to "return $self->{$name};" like it was in 0.24, everything works ok. I'm not sure what the solution is, I'm hardly an expert on AUTOLOAD... Doug
‹óN=íVmoÛ6öWéWܔvgK–ä·MF wH±o fçcB–Ζ0™rHªNd¿}GQžeI ´ÙøÀãswϝHž$ éV,g¹l½üÀ÷'£QË÷ý`2òOŸ áh<h! 4!{@˓ø¯¦è•1h¥eµy‰÷¹õÿ(ξëW‚÷W9ëïàîm»Bò<‘SýÏ%Ê(º¸\FÑEY|BN güz#oì |ë܊½,RW §eá1” c0ð‚¡æ¬žã„cO1'yʱ·w0gÎágdHº*xSÑþí´JÚ=hïs––ûmü+r¯äOÙ.—í·S{Çs&Áañ–*Ô"ús¦öçSJyÕ$‡^|EÕ°7¢Œ_È´ˆÓ¼Þ§|'oU“½çÒ-¯Þä[R°¸ˆêè:Þæ|µο¶-ªÕ3ÒàÞ¶”|U™.ŒªY¾–0ÿ8Õki¹söÔ.ïvøȪÍUÏîÿz#[ŠàÎR\U›ŽOµ6†£ÑqNô8G ǤâO½8J~× †×µï))e‚'YmÑ©t~G"õ²@–RJ]¦Ó§®Ì©Ùù:¬” 9/¹:«lxC›ãêýbqµh¿Um´ôK[^_œ_êï•GõI„¹X”ì´ûõ[¶,*«â Ú oe› ­Üe§ÈÝY̒²¢¤3ðµuvc&öºÕÖ\g¹úí3ä2CØñrUàÊDu“Hë’cœdP¿<~L¢ã踖R+PbpÊ]¿~êÂi»,­RïŒß ¹ìçMkW‰ì ®Eu&RU½*Úz,ÄãtŽš®Ô~¢>ÚÍÖÍòõ“‘úöO_ù°Xx»­—æëõëåPó<æýŸç¿?›ùO´ Tó0üÍóŸ—å‹_@ÿÓùïº.è=p‘ i]g¼«6øA4 ¢¡!}¢ÙÝnWó¬eÅ4ea…“hhÊ|î8÷ÆÐU`>·¶<XôceóI7}ŽkџÚ]»ûø‚úÀ.Ô<ƒ¤ˆ³7õÔiŒô•T_Fu¼3ø©Ê‹bØ¢ÌÊh¨»¤vñˆðý½£ý£¨vuÔd ±sÿï:€ß¿ê9ç(
[guest - Mon Aug 5 02:32:00 2002]: Show quoted text
> This bug is new to 0.25. > > perl -v > This is perl, version 5.005_03 built for i386-freebsd > > FreeBSD 4.6-STABLE-0714 > > The attached tarball contains a patch to RR.pm that helps highlight > the problem, and a test script that reproduces it. The short > version is that when running with -w, the new AUTOLOAD code causes > an unitialized variable warning for each new type the first time > it's created. On my system, with the attached patch applied the > test script produces the following output: >
> Debug> class: Net::DNS::RR::NS name: type
> Use of uninitialized value at > /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 641. > Use of uninitialized value at > /usr/local/lib/perl5/site_perl/5.005/Net/DNS/RR.pm line 644.
Thanks for the report, I was able to reproduce the bug, and fix it :). The attached patch is the fix, please apply it and yet me know if the problem persists. This fix will be in 0.26, which will be released in the next few days. Also, I have added a test to the test suite to test for this warning in t/07-misc.t. -- Chris Reinhardt ctriv@dyndns.org Systems Architect Dynamic DNS Network Services http://www.dyndns.org/
net-dns.patch=¹s¹smBIN‚zIndex: RR.pm =================================================================== RCS file: /storage/cvsroot/Net-DNS/lib/Net/DNS/RR.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- RR.pm 2002/08/01 08:51:40 1.19 +++ RR.pm 2002/08/05 07:06:56 1.20 @@ -1,6 +1,6 @@ package Net::DNS::RR; -# $Id: RR.pm,v 1.19 2002/08/01 08:51:40 ctriv Exp $ +# $Id: RR.pm,v 1.20 2002/08/05 07:06:56 ctriv Exp $ use strict; use vars qw($VERSION $AUTOLOAD); @@ -599,7 +599,7 @@ sub AUTOLOAD { my ($self) = @_; # If we do shift here, it will mess up the goto below. - my ($class, $name) = $AUTOLOAD =~ m/^(.*)::(.*)$/; + my ($name) = $AUTOLOAD =~ m/^.*::(.*)$/; # XXX -- We should test that we do in fact carp on unknown methods. unless (exists $self->{$name}) { @@ -628,7 +628,7 @@ no strict q/refs/; # Build a method in the class. - *{"$class::$name"} = sub { + *{$AUTOLOAD} = sub { my ($self, $new_val) = @_; if ($new_val) { @@ -639,7 +639,7 @@ }; # And jump over to it. - goto &{"$class::$name"}; + goto &{$AUTOLOAD}; }