Bug 3524 - sa-learn segmentation fault and thereafter errors while learning
Summary: sa-learn segmentation fault and thereafter errors while learning
Status: RESOLVED INVALID
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Learner (show other bugs)
Version: 2.63
Hardware: PC Linux
: P5 major
Target Milestone: 3.1.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-20 14:55 UTC by S. Anthony Sequeira
Modified: 2004-06-22 01:55 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description S. Anthony Sequeira 2004-06-20 14:55:43 UTC
Things working well for a period of weeks.

Yesterday, I started getting the following:

Argument "\004628575^_hM-T@" isn't numeric in numeric lt (<) at
/usr/lib/perl5/vendor_perl/5.8.2/Mail/SpamAssassin/BayesStore.pm line 1267.

Pages and pages of it, every time I used sa-learn.  It started with this:

Learned from 12 message(s) (2734 message(s) examined).
/etc/cron.hourly/sa-learn: line 14: 29650 Segmentation fault     
/usr/bin/sa-learn --ham $MD/.Ham/{cur,new}
Argument "\008766079^_hM-T@" isn't numeric in numeric gt (>) at
/usr/lib/perl5/vendor_perl/5.8.2/Mail/SpamAssassin/BayesStore.pm line 1260.

I use Gentoo, I deinstalled and reinstalled SA, but the problem is obviously in
one of my emails, because when I restarted (with a clean bayes DB), it started
again.  I believe that it is down to some messaages I copied from my Windows
machine as ham.

I have stopped learning, so if you require further details, I can provide them.

Also, not sure whether this is relevant, but sa-learn --dump data/all (not
magic) segfaults too.
Comment 1 Michael Parker 2004-06-21 06:36:35 UTC
Subject: Re:  New: sa-learn segmentation fault and thereafter errors while learning

Can you please see if you can narrow it down to the message that
causes the problem and then attach that message (using the Create a
New Attachment link) to the bug.

Thanks.
Michael

Comment 2 S. Anthony Sequeira 2004-06-21 07:11:45 UTC
I'll do my best.  It will be difficult to narrow down the initial message (the 
cause of the problem), unless there is some quick way I can clear out the bayes 
database in between attempts.  Is there such a way?

What I think is that once the bad message has been learned (causing the problem 
at line 1260 > numeric test), all or most of the other ones are being compared 
against what is in the database (line 1267 < test), and that's why sa-learn 
segfaults.

I can, if you wish, provide the bayes databases, and at least one message 
causing the problem currently.  If however you want me to find out the initial 
cause of the problem, I'll need what I mentioned above.  Will zeroing the bayes 
db files suffice?

Also, does sa-learn deal with messages in some kind of sorted order when it's 
given a Maildir directory?  Would make life easier if so.

Let me know, I'll get onto it when I get home.
Comment 3 Michael Parker 2004-06-21 08:32:55 UTC
Subject: Re:  sa-learn segmentation fault and thereafter errors while learning

On Mon, Jun 21, 2004 at 07:11:46AM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> ------- Additional Comments From tony@sequeira.com  2004-06-21 07:11 -------
> I'll do my best.  It will be difficult to narrow down the initial message (the 
> cause of the problem), unless there is some quick way I can clear out the bayes 
> database in between attempts.  Is there such a way?

The easiest way in < 3.0.0 is to just remove the files.

> What I think is that once the bad message has been learned (causing the problem 
> at line 1260 > numeric test), all or most of the other ones are being compared 
> against what is in the database (line 1267 < test), and that's why sa-learn 
> segfaults.
> 
> I can, if you wish, provide the bayes databases, and at least one message 
> causing the problem currently.  If however you want me to find out the initial 
> cause of the problem, I'll need what I mentioned above.  Will zeroing the bayes 
> db files suffice?

No idea why it is segfaulting, the database might be getting corrupted
and it's just not handling it well.  It could just be a bad
combination of libraries and database versions.

I'd like to find a msg that does this and test it against 3.0 and see
if I can re-create.

Michael

Comment 4 S. Anthony Sequeira 2004-06-22 04:01:48 UTC
Removed the bayes databases and reran the learn, and guess what?  No problem.  
I guess it's not duplicatable.  Please accept my apologies for wasting your 
time.
Comment 5 Michael Parker 2004-06-22 09:55:32 UTC
Closing as INVALID, certainly if you find a message that causes this corruption
again, feel free to re-open and attach the message to the bug.
Comment 6 Theo Van Dinter 2004-06-22 10:15:56 UTC
Subject: Re:  sa-learn segmentation fault and thereafter errors while learning

On Tue, Jun 22, 2004 at 09:55:33AM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> Closing as INVALID, certainly if you find a message that causes this corruption
> again, feel free to re-open and attach the message to the bug.

FYI: SA can't ever segfault, but perl can.  We can't do anything about
perl though, so ...

If it only happens with Bayes, I would assume some issue with DB_File/the
bayes DBs.  First step would be to make sure the Bayes DBs on disk have
an appropriate Berkeley DB version for the libdb that DB_File uses.
I've found issues where an older on-disk db version causes DB_File to
crash internally, and that kind of thing could definitely cause perl
to segfault.