-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daryl C. W. O'Shea writes:
> Matthias Keller wrote:
> > Theo Van Dinter wrote:
> > 
> >> On Tue, Feb 14, 2006 at 04:48:17PM -0500, Daryl C. W. O'Shea wrote:
> >>  
> >>
> >>>> I do have the two messages causing this on my SA 3.1.0 and the debug 
> >>>> output - it always hangs in the "running full-text regexp tests" 
> >>>> section...
> >>>>     
> >>> http://issues.apache.org/SpamAssassin/
> >>>   
> >>
> >> It would also help to mention if you have any additional rules added in.
> >> SA by itself only has 3 (well, 6, but it's really 3,) full rules, and
> >> they're all calling external apps to do network checks (DCC, Pyzor,
> >> and Razor).  My understanding is that all of them will indicate through
> >> the debug output that they're starting processing.  So if I don't see
> >> anything after that line, my guess is you have some other full rule
> >> added in which has a horrible regular expression that's taking forever on
> >> certain mails (which is why we highly recommend _not_ using full rules!)
> >>  
> >>
> > Thanks, that was it!
> > 
> > There was an ancient full rule which went mad on this particular mail 
> > which i was able to remove.
> 
> Should we be wrapping full rules in alarms (using M::SA::Timeout) to 
> prevent this?

1. No, but the entire scan process -- or possibly the check() function --
should impose an overall timeout.  This is implemented already in spamd
iirc, but possibly should also happen in check() as a new feature.

2. the Timeout class isn't suitable for this --
Mail::SpamAssassin::Util::trap_sigalrm_fully() will be required, since an
out-of-control regexp match can only be trapped using that function.

(however that fn should not be used for general alarm use, since it can
screw up perl interpreter state, and doesn't respect scoping as neatly as
the traditional "local $SIG{ALRM} = sub { ... }" idiom.)

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFD8pX9MJF5cimLx9ARAtjEAKC8hqzZTEz5ZnIscPXCHQJER1GXUgCgilw/
ffvzV1+rD3vX16yjUhB48F8=
=dWxx
-----END PGP SIGNATURE-----

Reply via email to