[Mimedefang] Slaves dying unexpectedly with signal 14

Jan Pieter Cornet johnpc at xs4all.nl
Wed Jan 18 07:25:08 EST 2006


On Wed, Jan 18, 2006 at 10:34:24PM +1300, Roland Pope wrote:
> From: "Jan Pieter Cornet" <johnpc at xs4all.nl>
> > I assume signal 14 is a SIGALRM. If "kill -l" on your system doesn't show
> > "14) SIGALRM" in the output somewhere, then the below is invalid.
> 
> Yes 14 is SIGALRM
> 
> > If it's a perl module that uses alarm() and then fails to unset it,
> > you might be able to trace it by inserting something like this (UNTESTED)
> >
> > use Carp qw(longmess);
> > my $buzz;
> > my $mess;
> > *CORE::GLOBAL::alarm = sub {
> >     my $arg = shift || $_;
> >     CORE::alarm($arg);
> >     if ( $arg == 0 ) {
> > undef $buzz;
> >     } else {
> > $buzz = time + $arg;
> > $mess = longmess;
> >     }
> > };
> Thanks Jan for your response.
> I inserted this code in near the start, and in the global section, of my
> mimedefang-filter, and got the error:
> <snip>
> Jan 18 22:27:48 hosta mimedefang-multiplexor[6491]: Slave 5 stderr: Argument
> " at /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/Loc..." isn't numeric
> in alarm at /etc/mail/mimedefang-filter line 95.

Wow, that's very brave. I said UNTESTED and I meant it. I just typed this
in as an example...

And indeed my code is flawed :) if the argument is "0" then "shift" is
false so it takes $_, but that's not the right criterium... "alarm" uses
$_ if there is no argument, not if there's a false argument... and it
seems any false argument to alarm (not just 0) also disables it... so,
attempt two... still LARGELY untested:

*CORE::GLOBAL::alarm = sub {
    my $arg = @_ ? shift : $_;
    CORE::alarm($arg);
    if ( !$arg ) {
       undef $buzz;
    } else {
       $buzz = time + $arg;
       $mess = Carp::longmess;
    }
};

> </snip>
> 
> When I added an 'md_syslog('info',"alarm=$arg");' right after the
> 'CORE::alarm($arg);' statement, I got:
> <snip>
> alarm= at /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/Locker/Flock.pm
> line 78       eval {...} called at
> /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/Locker/Flock.pm line 73
> Mail::SpamAssassin::Locker::Flock::safe_lock('Mail::SpamAssassin::Locker::Fl
> ock=HASH(0xb0617a0)','/home/cyrus/.spamassassin/auto-whitelist',30,640)
> called at
> /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/DBBasedAddrList.pm line 72
> Mail::SpamAssassin::DBBasedAddrList::new_checker('Mail::SpamAssassin::DBBase
> dAddrList=HASH(0xc287378)','Mail::SpamAssassin=HASH(0x9fe2044)') called at
> /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/AutoWhitelist.pm line 95
> Mail::SpamAssassin::AutoWhitelist::new('Mail::SpamAssassin::AutoWhitelist','
> Mail::SpamAssassin=HASH(0x9fe2044)') called at
> /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/Plugin/AWL.pm line 352
> eval {...} called at
> /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/Plugin/AWL.pm line 351
> Mail::SpamAssassin::Plugin::AWL::check_from_in_auto_whitelist('Mail
> </snip>
> 
> Any ideas what could be changed in your sample code to avoid this error?

Well my original code contained a "warn", so results like this is exactly
what is needed...

However, looking at this spamassassin code, it seems like there was
already an alarm active the moment M::A::Locker::Flock was called...
unfortunately my code only remembers the last alarm() call with a non-zero
argument... Or...

Hmm... it could also be that perl somehow forgot to install the SIGALRM
handler... I suddenly recall that that was the case last time this came
up. Quick check is: is it solved if you disable embedded perl? If it is,
then you can either leave embedded perl off, send a bug report to
spamassassin, or try to debug it yourself... Which might get tricky.

-- 
#!perl -wpl # mmfppfmpmmpp mmpffm <pmmppfmfpppppfmmmf at fpffmm4mmmpmfpmf.ppppmf>
$p=3-2*/[^\W\dmpf_]/i;s.[a-z]{$p}.vec($f=join('',$p-1?chr(sub{$_[0]*9+$_[1]*3+
$_[2]}->(map{/p|f/i+/f/i}split//,$&)+97):qw(m p f)[map{((ord$&)%32-1)/$_%3}(9,
3,1)]),5,1)='`'lt$&;$f.eig;                                # Jan-Pieter Cornet



More information about the MIMEDefang mailing list