SA Bugzilla – Bug 2827
[review] SA fails with 'Argument "" isn't numeric' runtime error
Last modified: 2004-03-08 23:05:52 UTC
Version 2.61 (note - Bugtraq doesn't have 2.61 yet as a choice) With Bayes enabled, Spamassassin generates a long sequences of diagnostic messages of the form: Argument "" isn't numeric in numeric lt (<) at /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/BayesStore.pm line 1248. (I was going to link to the SA Talk thread where this was discussed, but it looks like Source Forge has begun archiving the month of December. Either that or it isn't archiving any more). ---- In a subsequent exchange on SA Talk Theo wrote: On Wed, Dec 10, 2003 at 01:44:17PM -0800, Gary Funck wrote: > Follow-up, adding a check to see if $oldmagic is "" made the complaints > go away: > > 1248 my $oldmagic = > $self->{db_toks}->{$OLDEST_TOKEN_AGE_MAGIC_TOKEN}; > 1249 $oldmagic = 0 if (defined($oldmagic) && $oldmagic eq ""); > 1250 if (!defined ($oldmagic) || $atime < $oldmagic) { > 1251 $self->{db_toks}->{$OLDEST_TOKEN_AGE_MAGIC_TOKEN} = $atime; > 1252 } > > this can be recoded more succinctly, I'm sure. FYI: you changed the logic of the code there. if there is no oldest token atime (ie: this is the first token to be learned), it should set the value to the atime. you've now forced oldest to be 0 until the first expire occurs and fixes it. the !defined bit is supposed to catch when there is no oldest token, but apparently instead of undef, it sometimes comes back as "" (boo DB_File!)
aiming at 2.62
Created attachment 1639 [details] suggested patch I thought this may be a more widespread issue, but it turns out that the warning that appears specifies the only line I could find that had an issue. I simply added a check for "$oldest eq ''" in the if statement right after the defined check. Simple enough. :)
setting to review status. committed patch to SVN head.
I am having similar problem, but suggested patch does not solve it. Error message I have: Argument "\007027319M-i)M-m?" isn't numeric in numeric lt (<) at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1249. Argument "\007027319M-i)M-m?" isn't numeric in numeric lt (<) at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1249. Argument "\007027319M-i)M-m?" isn't numeric in numeric lt (<) at /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1249. ...
Subject: Re: [review] SA fails with 'Argument "" isn't numeric' runtime error On Sun, Dec 28, 2003 at 01:33:16AM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote: > I am having similar problem, but suggested patch does not solve it. > Error message I have: Similar error but very different root cause. > Argument "\007027319M-i)M-m?" isn't numeric in numeric lt (<) at > /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1249. > Argument "\007027319M-i)M-m?" isn't numeric in numeric lt (<) at > /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1249. > Argument "\007027319M-i)M-m?" isn't numeric in numeric lt (<) at > /usr/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1249. > ... This looks like you have some form of DB corruption. In this case, it looks like some of the magic token data (stored as a string) got mangled with actual token data (stored in a packed binary form).
+1 for 1639
committed to 2.62 svn.
Installed fresh copy of 2.63 today. A 'make test' returns success (skipping the razor section). I continue to get this error (was getting it back in 2.60) when trying to sa-learn a spam box: user@host% /pkg/spamassassin-2.63/bin/sa-learn --spam --mbox mail/Spam Argument "" isn't numeric in numeric lt (<) at /pkg/spamassassin-2.63/lib/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1267. Argument "" isn't numeric in numeric lt (<) at /pkg/spamassassin-2.63/lib/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1267. [ ...repeat for hundreds of lines... ] It does look like the patch attached here is in place if I look at line 1267 in SpamAssassin/BayesStore.pm. I can't find a newer, open bug in bugzilla. I can provide more specifics or my spam corpus if desired. Thank you.
Subject: Re: [review] SA fails with 'Argument "" isn't numeric' runtime error On Mon, Mar 08, 2004 at 11:47:51AM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote: > I can provide more specifics or my spam corpus if desired. Thank you. Is it repeatable with the mail in question? If so, attach it to the ticket.
Created attachment 1825 [details] Small spam corpus for testing
I snipped out ~100 messages from my 100+MB Spam corpus. I tested and the attached (mbox) file definitely throws the error: [ ... snip hundreds of lines ... ] Argument "" isn't numeric in numeric lt (<) at /pkg/spamassassin-2.63/lib/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line 1267. Learned from 1 message(s) (104 message(s) examined). However, once learned, the errors wouldn't show up, so you'll have to clear the bayes DBs to test multiple times: user@host% /pkg/spamassassin-2.63/bin/sa-learn --spam --mbox Spam_example Learned from 0 message(s) (104 message(s) examined). Thanks for your help, Ben
Subject: Re: [review] SA fails with 'Argument "" isn't numeric' runtime error On Tue, Mar 09, 2004 at 08:05:53AM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote: > I snipped out ~100 messages from my 100+MB Spam corpus. I tested and the > attached (mbox) file definitely throws the error: Excellent! > However, once learned, the errors wouldn't show up, so you'll have to clear the > bayes DBs to test multiple times: > > user@host% /pkg/spamassassin-2.63/bin/sa-learn --spam --mbox Spam_example > Learned from 0 message(s) (104 message(s) examined). $ wget -O 4 'http://bugzilla.spamassassin.org/attachment.cgi?id=1825&action=view' With 2.63: $ ls -la SA/spamassassin-2.60/masses/spamassassin/bayes* ls: No match. $ sa-learn-260 --spam --mbox --showdots 4 ........................................................................................................ Learned from 104 message(s) (104 message(s) examined). With 3.0: $ ls -la SA/spamassassin-head/masses/spamassassin/bayes* ls: No match. $ sa-learn-cvs --mbox --spam --showdots 4 ........................................................................................................ Learned from 104 message(s) (104 message(s) examined). The only configuration involved is: # for 3.0, it's head instead of 2.60 ... bayes_path /home/felicity/SA/spamassassin-2.60/masses/spamassassin/bayes use_razor2 0 bayes_auto_learn 0 So... It's looking like something on your system unfortunately. :( FYI: The line of code in SA has a check for oldmagic being "", so the only other variable in there that could be that is $atime, which is guaranteed to be set by the time the line in question gets run.