nasty bug in SA.pm (I think)

Jeff A. Earickson jaearick at colby.edu
Fri Aug 11 21:15:59 IST 2006


Julian,

More input (late on a Friday afternoon)...

I can't find the closing bracket for "sub SAForkAndTest {" (line 722)
either.  I notice another commented-out if at line whose curly
bracket marries up with the closing bracket for SAForkAndTest at line
955.  Methinks that multiple commented-out if brackets hid this bug
well....

Jeff Earickson
Colby College

On Fri, 11 Aug 2006, Jeff A. Earickson wrote:

> Date: Fri, 11 Aug 2006 16:00:53 -0400 (EDT)
> From: Jeff A. Earickson <jaearick at colby.edu>
> Reply-To: MailScanner discussion <mailscanner at lists.mailscanner.info>
> To: mailscanner mailing list <mailscanner at lists.mailscanner.info>
> Subject: nasty bug in SA.pm (I think)
> 
> Julian,
>
> I've been intermittantly chasing this bug for several releases now,
> and I think that I may have it cornered.  The problem:  if I start
> MS with my /etc/init.d script, MS just loops and does nothing.  If
> I start it via /opt/MailScanner/bin/check_mailscanner from cron,
> MailScanner works.
>
> The syslog output for a loop up looks like:
>
> MailScanner[25980]: MailScanner E-Mail Virus Scanner version 4.55.10 
> starting...
> MailScanner[25980]: Read 748 hostnames from the phishing whitelist
> MailScanner[25980]: Config: calling custom init function IPBlock
> MailScanner[25980]: Initialising IP blocking
> MailScanner[25980]: Read 128 IP blocking entries from 
> /etc/MailScanner/IPBlock.conf
> MailScanner[25980]: Using SpamAssassin results cache
> MailScanner[25980]: Connected to SpamAssassin cache database
> (repeat ad nauseum)
>
> So I started putting in info syslog messages into lib/MailScanner/SA.pm
> after the "cache database" message to trace what happened.  Attached
> is my modified version of SA.pm.  I never get anything after the info
> msg "got to here3".
>
> So I stared at SA.pm.  You commented out line 287:
>
> #if (MailScanner::Config::Value('compilespamassassinonce')) {
>
> at some point, which commented out half of a curly-bracket block.
> I can't find where the right curly-bracket for this line is, and I
> think something is mis-aligned here.
>
> Using the power feature of vi whereby you put the cursor over a
> bracket, paren, etc and then hit "%", I don't find the closing curly bracket 
> for line 72 ("sub initialise {").  This routine seems
> mangled and I think this is the root cause of the loop-up bug.
> But I can't figure out where the closing bracket for line 287 might be.
> Have I found this loopup bug in the mangled bracketing of initialise???
>
> Jeff Earickson
> Colby College


More information about the MailScanner mailing list