Bug 1704 - Perl warnings in Dns.pm, EvalTests.pm and BayesStore.pm
Summary: Perl warnings in Dns.pm, EvalTests.pm and BayesStore.pm
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC Linux
: P2 blocker
Target Milestone: 2.60
Assignee: Theo Van Dinter
URL:
Whiteboard:
Keywords:
: 1857 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-29 04:30 UTC by Dave Hill
Modified: 2003-06-16 02:43 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Log file and code snippets text/plain None Dave Hill [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hill 2003-03-29 04:30:06 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.
Comment 1 Dave Hill 2003-04-29 11:02:22 UTC
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!)
Comment 2 Daniel Quinlan 2003-05-18 21:38:03 UTC
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.
Comment 3 Dave Hill 2003-05-19 04:08:12 UTC
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!)
Comment 4 Dave Hill 2003-05-19 04:23:16 UTC
Bug 1857 is a duplicate of this BTW.
Comment 5 Dave Hill 2003-05-19 10:08:27 UTC
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!
Comment 6 Dave Hill 2003-05-19 10:09:52 UTC
Created attachment 977 [details]
Log file and code snippets
Comment 7 Duncan Findlay 2003-06-06 23:44:31 UTC
*** Bug 1857 has been marked as a duplicate of this bug. ***
Comment 8 Theo Van Dinter 2003-06-11 22:12:32 UTC
ok, I just put in a fix (I believe) for the Dns.pm issue.
Comment 9 Dave Hill 2003-06-12 09:05:11 UTC
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 }
Comment 10 Theo Van Dinter 2003-06-12 15:49:10 UTC
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
Comment 11 Theo Van Dinter 2003-06-12 15:50:32 UTC
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.
Comment 12 Dave Hill 2003-06-12 16:43:51 UTC
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
Comment 13 Theo Van Dinter 2003-06-12 17:51:59 UTC
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.

Comment 14 Theo Van Dinter 2003-06-13 14:44:16 UTC
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.
Comment 15 Theo Van Dinter 2003-06-13 14:54:19 UTC
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>
Comment 16 Dave Hill 2003-06-16 10:43:40 UTC
OK, message from Dns.pm has gone!!

The other messages disappeared a while ago.

Success!