SA Bugzilla – Bug 1704
Perl warnings in Dns.pm, EvalTests.pm and BayesStore.pm
Last modified: 2003-06-16 02:43:40 UTC
Using Spamassassin from CVS, with perl version 5.6.1 (RH 7.3), when starting spamd gives the warning: Use of uninitialized value in list assignment at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/Dns.pm line 819. This is repeated for each message processed. The lines in the source read: 814 sub leave_helper_run_mode { 815 my ($self) = @_; 816 817 dbg ("leaving helper-app run mode"); 818 $/ = $self->{old_slash}; 819 if ( defined $self->{old_env} ) { 820 %ENV = %{$self->{old_env}}; 821 } 822 else { 823 undef %ENV; 824 } 825 } running "spamassassin" itself produces no warning.
This is still happening and has now been joined by some other warnings:- Use of uninitialized value in join or string at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/EvalTests.pm line 1145, <GEN92> line 45. Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/EvalTests.pm line 1149, <GEN92> line 45. Argument "" isn't numeric in numeric gt (>) at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 322. (only seen that last one once!)
Dave, Can you try current 2.60-cvs to see if any of these problems still happen? If any do, please paste an excerpt from the code as the line numbers change as the code is modified. Thanks.
OK, updated. First warning comes as soon as you start spamd (this is the original one I submitted the report about):- Use of uninitialized value in list assignment at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/Dns.pm line 894. 889 sub leave_helper_run_mode { 890 my ($self) = @_; 891 892 dbg ("leaving helper-app run mode"); 893 $/ = $self->{old_slash}; 894 if ( defined $self->{old_env} ) { 895 %ENV = %{$self->{old_env}}; 896 } 897 else { 898 undef %ENV; 899 } 900 } I'll add the rest as they show up (when I get some mail, which will be pretty soon I would think!)
Bug 1857 is a duplicate of this BTW.
attaching example of the other two. Could these be related to the fact that I have header RCVD_IN_BONDEDSENDER rbleval:check_rbl('relay-last1', 'sa.bondedsender.org.') in my config file as per the note on www.bondedsender.org ?? I'll try commenting it out!
Created attachment 977 [details] Log file and code snippets
*** Bug 1857 has been marked as a duplicate of this bug. ***
ok, I just put in a fix (I believe) for the Dns.pm issue.
Nope, still there. spamd[18451]: Use of uninitialized value in list assignment at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/Dns.pm line 1081. 1076 sub leave_helper_run_mode { 1077 my ($self) = @_; 1078 1079 dbg ("leaving helper-app run mode"); 1080 $/ = $self->{old_slash}; -> 1081 %ENV = %{$self->{old_env}}; 1082 }
damn it! ok, I'll try to come up with an actual fix tonight or something. <sigh> that section of code works for me ... :P
can you save the output of "perl -e 'while(($k,$v) = each %ENV){ $v="undef" if not defined $v; print "$k => $v\n" }'" into a file and attach to this bug? I'd like to see what environment you have that is doing this.
Tricky. I'm using "spamd", as I said originally, running "spamassassin" directly doesn't produce the message. Spamd is started using the arguments "-d -x -u mail" Should I "su" or "su -" to mail before running the perl snippet?? Dave
Subject: Re: Perl warnings in Dns.pm, EvalTests.pm and BayesStore.pm On Thu, Jun 12, 2003 at 04:43:51PM -0700, bugzilla-daemon@hughes-family.org wrote: > Spamd is started using the arguments "-d -x -u mail" > > Should I "su" or "su -" to mail before running the perl snippet?? hmmm. let me see if I can replicate it first.
well, after some kluging, I got this to reproduce on my system (also RH7.3). Turns out TMPDIR is undefined. Interestingly, TMPDIR isn't defined in my env, so it must be getting added somewhere.
ok, fixed this on my box. File::Spec->tmpdir() seems to set TMPDIR to undefined if it's not already set to something. I added in a line to remove TMPDIR if it's not defined. A kluge, but I can't fix File::Spec ... <G>
OK, message from Dns.pm has gone!! The other messages disappeared a while ago. Success!