Bug 820 - uncancelled alarm kills spamd
Summary: uncancelled alarm kills spamd
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: SpamAssassin Developer Mailing List
URL: http://bugs.debian.org/154055
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-03 21:01 UTC by Duncan Findlay
Modified: 2002-09-04 20:45 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
Patch patch None Duncan Findlay [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Findlay 2002-09-03 21:01:16 UTC
From Brad <lists@anomie.yi.org> in Debian bug 154055:

Mail/SpamAssassin/Reporter.pm, at line 108, starts an alarm just after
setting a SIG_ALRM handler inside an eval. At the end of this eval (line
121), it calls alarm(0) to deactivate the alarm if it hadn't fired yet.
Only one problem, at line 111 it can call die. This exits the eval, and
resets the default SIG_ALRM handler, but doesn't turn off the pending
alarm. So, a few seconds later, spamd exits with an error "Alarm clock".


I've taken his patch and extended to cover other cases of the bug, and included
razor2 support.
Comment 1 Duncan Findlay 2002-09-03 21:01:57 UTC
Created attachment 297 [details]
Patch
Comment 2 Duncan Findlay 2002-09-03 21:03:07 UTC
I'd commit, but I'd like someone to review this to make sure this makes sense.
I'm a little tired right now :-)
Comment 3 Justin Mason 2002-09-04 06:32:27 UTC
looks good to me, applied.
Comment 4 Theo Van Dinter 2002-09-04 07:34:06 UTC
Subject: Re: [SAdev]  uncancelled alarm kills spamd

On Tue, Sep 03, 2002 at 09:03:07PM -0700, bugzilla-daemon@hughes-family.org wrote:
> I'd commit, but I'd like someone to review this to make sure this makes sense.
> I'm a little tired right now :-)

Maybe I missed something, but didn't I fix this in July?

http://www.hughes-family.org/bugzilla/show_bug.cgi?id=446

There's already an extra "alarm 0" after the eval statement in case a
die was received during the eval and the alarm was missed.
Comment 5 Duncan Findlay 2002-09-04 11:44:39 UTC
Subject: Re:  uncancelled alarm kills spamd

Perhaps; I wasn't around in July!

Hmm... damn, you're right :-)

Anyways, could someone slightly better than me at CVS please back out
that patch. The only fix that is necessary (IMO) is an "alarm 0;" at
214 in Reporter.pm

Comment 6 Theo Van Dinter 2002-09-04 14:54:30 UTC
Subject: Re: [SAdev]  uncancelled alarm kills spamd

On Wed, Sep 04, 2002 at 11:44:39AM -0700, bugzilla-daemon@hughes-family.org wrote:
> Anyways, could someone slightly better than me at CVS please back out
> that patch. The only fix that is necessary (IMO) is an "alarm 0;" at
> 214 in Reporter.pm

Yeah, it looks like some chunks of my Razor2 patches either didn't make
it into CVS or got chopped out when splitting Razor1 and Razor2 checks,
that's why this alarm issue and the debugging issue I submitted a patch
for yesterday were necessary. :(

Comment 7 Justin Mason 2002-09-05 04:45:42 UTC
BTW, I like the approach anyway, so I'll leave it in
for paranoia.  it shouldn't make any difference either way,
but this way's a little more paranoid.