You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Per Jessen <pe...@computer.org> on 2004/12/03 10:26:10 UTC

how to debug/diagnose a tight loop?

I'm running a number of SA2.64 and spampd instances - every now and then one the
children spawned will enter a tight loop.  Not being much of a Perl programmer,
I'm at a loss when it comes to debugging and/or diagnosing this - it is not
reproducable, except it happens perhaps 1-2/week.  
I would prefer to fix the problem rather than writing a little watchdog to keep
an eye on spampd/SA. (which would be the easy way out for me).

Can I eg. kill such a looping thread and get a coredump I can gdb or something?


thanks,
Per

-- 
Per Jessen, Zurich
Let your spam stop here -- http://www.spamchek.com



Re: how to debug/diagnose a tight loop?

Posted by Per Jessen <pe...@computer.org>.
Michael Barnes wrote:

> On Fri, Dec 03, 2004 at 10:26:10AM +0100, Per Jessen wrote:
>> I'm running a number of SA2.64 and spampd instances - every now and
>> then one the children spawned will enter a tight loop.  Not being much
> 
> Odds are its due to the bayes db going through its expiratory stage.
> When I ran 2.6x, I had a cronjob that ran 'sa-learn --force-expire' from
> time to time and the periodic CPU burning went away.

OK, sounds interesting.  However, there doesn't appear to anything periodic
about these loops - i.e. a couple of child-threads will start looping, and
that's it.  I don't really keep an eye on it every day, so occasionally one of
these might be looping for a day or two till I kill it. 
I'll try the force-expire though.

thanks,


-- 
Per Jessen, Zurich
Let your spam stop here -- http://www.spamchek.com



Re: how to debug/diagnose a tight loop?

Posted by Michael Barnes <mb...@compsci.wm.edu>.
On Fri, Dec 03, 2004 at 10:26:10AM +0100, Per Jessen wrote:
> I'm running a number of SA2.64 and spampd instances - every now and
> then one the children spawned will enter a tight loop.  Not being much
> of a Perl programmer, I'm at a loss when it comes to debugging and/or
> diagnosing this - it is not reproducable, except it happens perhaps
> 1-2/week.  I would prefer to fix the problem rather than writing a
> little watchdog to keep an eye on spampd/SA. (which would be the easy
> way out for me).


Odds are its due to the bayes db going through its expiratory stage.
When I ran 2.6x, I had a cronjob that ran 'sa-learn --force-expire' from
time to time and the periodic CPU burning went away.

Now I run 3.0.1 with a mysql db backend for the bayes database, and it
runs much better that way for me, and I don't have to do the manual
expire.

> Can I eg. kill such a looping thread and get a coredump I can gdb or
> something?
 
You could, but at best it would give you debug information about the
perl binary itself, and not the script that it is running.

I would check the force-expire option first.

Mike

-- 
/-----------------------------------------\
| Michael Barnes <mb...@compsci.wm.edu> |
| UNIX Systems Administrator              |
| College of William and Mary             |
| Phone: (757) 879-3930                   |
\-----------------------------------------/