I've searched the archives, loosely, and I haven't really seen this issue
discussed much, if at all, but I know several people have been having this
problem, including myself.  So, I took it upon myself to find the issue and
come up with answer.

The situation started when Perl 5.8.7 was released into the FreeBSD ports
collection.  Many people upgraded and many people noticed that upon
restarted amavisd-new that it would stop working and were seeing messages in
their syslog:

Jul 22 11:36:06 xxxx kernel: pid 67831 (perl5.8.7), uid xxxx: exited on
signal 10

So, of course, naturally, we were pointing our fingers at amavisd-new.
After running through all of its debug information, I found out that it was
SpamAssassin tripping the signal 10, causing amavisd-new to fail.  Skipping
ahead of some boring details, I found out that simply 'spamassassin --lint'
was enough to repeatedly cause this signal 10 (Bus Error)

User$ spamassassin --lint
Bus error (core dumped)

Ok, good, we got us a core to work with.  Not running a debug version of
Perl however made this core pretty useless.

Skipping ahead even more, and after using the perl debugger, I traced the
fault to line 1958 of Mail::SpamAssassin::PerMsgStatus

  DB<4> v
1955    EOT
1956 
1957      # and run it.
1958==>   eval $evalstr;
1959:     if ($@) {
1960:       warn("Failed to compile URI SpamAssassin tests, skipping:\n".
1961              "\t($@)\n");
1962:       $self->{rule_errors}++;
1963      }
1964      else {

Doing an examine (x) on $evalstr revealed over 1MB worth of statements to be
evaluated.  Copying the results of 'x $evalstr' to a separate file, adding
my own 'eval $evalstr' to it results in the same Bus Error.  Finally using a
debugging version of Perl, I find out where in $evalstr that the Bus Error
occurs.  Removing the offending line, and everything after results with a
successful eval call.  Leaving lots of technical details out, I've come to
the conclusion that the perl 5.8.7 process is running clean out of stack
space and bailing out with a Bus Error.

I left a lot of the technical details out, because I'm not really sure where
the fault lies.  This same set up worked just fine under Perl 5.8.6, the
test cases work fine w/ a larger stack and the test cases work just fine on
other platforms such as an OpenBSD (which had a reported stack size of only
8MB) and Linux running perl 5.8.7.  Increasing the default stack size (from
64M to 128M) on FreeBSD 5.4 seemed to help but only so much.  On a whim, I
recompiled perl 5.8.7 w/ no optimizations (-O0) and still it would result in
a Bus Error.  Recompiling perl 5.8.7 with -Os, however, seems to work.

So if you're experiencing this problem, here's some suggestions:
        1> Reduce the number of rules/rulesets
        2> Go back and stay using perl 5.8.6 until someone blows the
all-clear
        3> Increase your stack space (the MAXSSIZ setting in the kernel
configuration)
        4> Recompile perl 5.8.7 using CFLAGS=-Os

If you're a developer for perl or spamassassin and want to try a more
official fix for this, let me know and I can provide you with more
information.  I no longer have the coredumps or logs (liberal use of 'rm' is
bad), but they can be recreated easily.  Thanks to g32, flap, RacerX, and
Mongo for helping me test and confirm my suspicions.


John Narron            | "Sacrifice, they always say
Network Administration |  Is a sign of nobility
CDS/CDSinet, LLC       |  But where does one draw the line
http://www.cdsinet.net |  In the face of injury?"
(660) 886 4045         |     - Queensryche 


Reply via email to