Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: SpamAssassin: users

Crashes running SA as milter in Postfix

 

 

SpamAssassin users RSS feed   Index | Next | Previous | View Threaded


p at state-of-mind

Nov 1, 2009, 1:31 PM

Post #1 of 10 (302 views)
Permalink
Crashes running SA as milter in Postfix

We regularly experience SA crashes on a Ubuntu Hardy machine. The setup is as
follows:

Postfix (2.5.1) -> SpamAssassin Milter (0.3.1-6) -> SpamAssassin (3.2.4-1ubuntu1.1)

The milter is run like this:

/usr/sbin/spamass-milter -P /var/run/spamass/spamass.pid -f \
-p /var/spool/postfix/spamass/spamass.sock \
-u spamass-milter -i 127.0.0.1 -r 10

SpamAssassin is run like this:

/usr/bin/perl -T -w /usr/sbin/spamd -s local5 -u spamassassin \
--nouser-config --max-children 10 --debug=spamd -d \
--pidfile=/var/run/spamd.pid

It crashed again this weekend. This is what I found in the log:

Oct 29 08:01:51 mail01 spamd[10249]: spamd: fork: Cannot allocate memory at /usr/sbin/spamd line 999.
Oct 29 08:01:53 mail01 spamd[301]: auto-whitelist: open of auto-whitelist file failed: locker: safe_lock: cannot create tmp lockfile /nonexistent/.spamassassin/auto-whitelist.lo
ck.mail01.example.com.301 for /nonexistent/.spamassassin/auto-whitelist.lock: No such file or directory
Oct 29 08:01:53 mail01 spamd[301]: spamd: clean message (1.1/5.0) for singer-paf:65534 in 2.3 seconds, 28868 bytes.
Oct 29 08:01:53 mail01 spamd[301]: spamd: result: . 1 - EXTRA_MPART_TYPE,HTML_MESSAGE,RDNS_NONE scantime=2.3,size=28868,user=singer-paf,uid=65534,required_score=5.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=42576,mid=<542376CEA87A0943B958AFD2BF4636CD166E24[at]dc01.example.local>,autolearn=no
Oct 29 08:01:53 mail01 spamd[301]: syswrite() to parent failed: Broken pipe at /usr/share/perl5/Mail/SpamAssassin/SpamdForkScaling.pm line 576.

Something that annoys me, is that it keeps complaining "cannot create tmp
lockfile /nonexistent/.spamassassin/", while I keep it running as user
"spamassassin". I am purley speculating: Could this be in relation to my crash
problem?

Thanks,

p[at]rick

--
state of mind
Digitale Kommunikation

http://www.state-of-mind.de

Franziskanerstraße 15 Telefon +49 89 3090 4664
81669 München Telefax +49 89 3090 4666

Amtsgericht München Partnerschaftsregister PR 563


d.hill at yournetplus

Nov 1, 2009, 2:20 PM

Post #2 of 10 (286 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

Quoting Patrick Ben Koetter <p[at]state-of-mind.de>:

> We regularly experience SA crashes on a Ubuntu Hardy machine. The setup is as
> follows:
>
> Postfix (2.5.1) -> SpamAssassin Milter (0.3.1-6) -> SpamAssassin
> (3.2.4-1ubuntu1.1)
>
> The milter is run like this:
>
> /usr/sbin/spamass-milter -P /var/run/spamass/spamass.pid -f \
> -p /var/spool/postfix/spamass/spamass.sock \
> -u spamass-milter -i 127.0.0.1 -r 10
>
> SpamAssassin is run like this:
>
> /usr/bin/perl -T -w /usr/sbin/spamd -s local5 -u spamassassin \
> --nouser-config --max-children 10 --debug=spamd -d \
> --pidfile=/var/run/spamd.pid
>
> It crashed again this weekend. This is what I found in the log:
>
> Oct 29 08:01:51 mail01 spamd[10249]: spamd: fork: Cannot allocate
> memory at /usr/sbin/spamd line 999.
> Oct 29 08:01:53 mail01 spamd[301]: auto-whitelist: open of
> auto-whitelist file failed: locker: safe_lock: cannot create tmp
> lockfile /nonexistent/.spamassassin/auto-whitelist.lo
> ck.mail01.example.com.301 for
> /nonexistent/.spamassassin/auto-whitelist.lock: No such file or
> directory
> Oct 29 08:01:53 mail01 spamd[301]: spamd: clean message (1.1/5.0)
> for singer-paf:65534 in 2.3 seconds, 28868 bytes.
> Oct 29 08:01:53 mail01 spamd[301]: spamd: result: . 1 -
> EXTRA_MPART_TYPE,HTML_MESSAGE,RDNS_NONE
> scantime=2.3,size=28868,user=singer-paf,uid=65534,required_score=5.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=42576,mid=<542376CEA87A0943B958AFD2BF4636CD166E24[at]dc01.example.local>,autolearn=no
> Oct 29 08:01:53 mail01 spamd[301]: syswrite() to parent failed:
> Broken pipe at
> /usr/share/perl5/Mail/SpamAssassin/SpamdForkScaling.pm line 576.
>
> Something that annoys me, is that it keeps complaining "cannot create tmp
> lockfile /nonexistent/.spamassassin/", while I keep it running as user
> "spamassassin". I am purley speculating: Could this be in relation
> to my crash
> problem?

The home directory for the username spamassassin is probably set to
/nonexistant in the passwd file (or whatever it is in Ubuntu).


p at state-of-mind

Nov 1, 2009, 2:23 PM

Post #3 of 10 (284 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

* d.hill[at]yournetplus.com <d.hill[at]yournetplus.com>:
> The home directory for the username spamassassin is probably set to
> /nonexistant in the passwd file (or whatever it is in Ubuntu).

Thanks for the reply. I wish, it was that easy, but it is not. The $HOME is
/home/spamassassin.

p[at]rick

--
state of mind
Digitale Kommunikation

http://www.state-of-mind.de

Franziskanerstraße 15 Telefon +49 89 3090 4664
81669 München Telefax +49 89 3090 4666

Amtsgericht München Partnerschaftsregister PR 563


d.hill at yournetplus

Nov 1, 2009, 3:26 PM

Post #4 of 10 (284 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

Quoting Patrick Ben Koetter <p[at]state-of-mind.de>:

> * d.hill[at]yournetplus.com <d.hill[at]yournetplus.com>:
>> The home directory for the username spamassassin is probably set to
>> /nonexistant in the passwd file (or whatever it is in Ubuntu).
>
> Thanks for the reply. I wish, it was that easy, but it is not. The $HOME is
> /home/spamassassin.

That's the only place I could think where the /nonexistant path would
be coming from.


Mark.Martinec+sa at ijs

Nov 1, 2009, 3:42 PM

Post #5 of 10 (284 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

Patrick,

> We regularly experience SA crashes on a Ubuntu Hardy machine. The setup is
> as follows:
>
> Postfix (2.5.1) -> SpamAssassin Milter (0.3.1-6) -> SpamAssassin
> (3.2.4-1ubuntu1.1)
>
> The milter is run like this:
>
> /usr/sbin/spamass-milter -P /var/run/spamass/spamass.pid -f \
> -p /var/spool/postfix/spamass/spamass.sock \
> -u spamass-milter -i 127.0.0.1 -r 10
>
> /usr/bin/perl -T -w /usr/sbin/spamd -s local5 -u spamassassin \
> --nouser-config --max-children 10 --debug=spamd -d \
> --pidfile=/var/run/spamd.pid
>
> It crashed again this weekend. This is what I found in the log:
>
> Oct 29 08:01:51 mail01 spamd[10249]: spamd: fork: Cannot allocate memory
> at /usr/sbin/spamd line 999.

/usr/include/errno.h
#define ENOMEM 12 /* Cannot allocate memory */

man 2 fork
[ENOMEM] There is insufficient swap space for the new process.


Mark


richard at buzzhost

Nov 1, 2009, 11:18 PM

Post #6 of 10 (282 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

On Sun, 2009-11-01 at 22:31 +0100, Patrick Ben Koetter wrote:
> We regularly experience SA crashes on a Ubuntu Hardy machine. The setup is as
> follows:
>
> Postfix (2.5.1) -> SpamAssassin Milter (0.3.1-6) -> SpamAssassin (3.2.4-1ubuntu1.1)
>
> The milter is run like this:
>
> /usr/sbin/spamass-milter -P /var/run/spamass/spamass.pid -f \
> -p /var/spool/postfix/spamass/spamass.sock \
> -u spamass-milter -i 127.0.0.1 -r 10
>
> SpamAssassin is run like this:
>
> /usr/bin/perl -T -w /usr/sbin/spamd -s local5 -u spamassassin \
> --nouser-config --max-children 10 --debug=spamd -d \
> --pidfile=/var/run/spamd.pid
>
> It crashed again this weekend. This is what I found in the log:
>
> Oct 29 08:01:51 mail01 spamd[10249]: spamd: fork: Cannot allocate memory at /usr/sbin/spamd line 999.
> Oct 29 08:01:53 mail01 spamd[301]: auto-whitelist: open of auto-whitelist file failed: locker: safe_lock: cannot create tmp lockfile /nonexistent/.spamassassin/auto-whitelist.lo
> ck.mail01.example.com.301 for /nonexistent/.spamassassin/auto-whitelist.lock: No such file or directory
> Oct 29 08:01:53 mail01 spamd[301]: spamd: clean message (1.1/5.0) for singer-paf:65534 in 2.3 seconds, 28868 bytes.
> Oct 29 08:01:53 mail01 spamd[301]: spamd: result: . 1 - EXTRA_MPART_TYPE,HTML_MESSAGE,RDNS_NONE scantime=2.3,size=28868,user=singer-paf,uid=65534,required_score=5.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=42576,mid=<542376CEA87A0943B958AFD2BF4636CD166E24[at]dc01.example.local>,autolearn=no
> Oct 29 08:01:53 mail01 spamd[301]: syswrite() to parent failed: Broken pipe at /usr/share/perl5/Mail/SpamAssassin/SpamdForkScaling.pm line 576.
>
> Something that annoys me, is that it keeps complaining "cannot create tmp
> lockfile /nonexistent/.spamassassin/", while I keep it running as user
> "spamassassin". I am purley speculating: Could this be in relation to my crash
> problem?
>
> Thanks,
>
> p[at]rick
>
Just to be clear - this is a proper hardware server, and not a VPS of
some kind?


uhlar at fantomas

Nov 1, 2009, 11:43 PM

Post #7 of 10 (282 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

> * d.hill[at]yournetplus.com <d.hill[at]yournetplus.com>:
> > The home directory for the username spamassassin is probably set to
> > /nonexistant in the passwd file (or whatever it is in Ubuntu).

On 01.11.09 23:23, Patrick Ben Koetter wrote:
> Thanks for the reply. I wish, it was that easy, but it is not. The $HOME is
> /home/spamassassin.

you have passed the "-u spamass-milter" option. That means
that SA-milter will pass username of the recipient to spamd if there's
one recipient, so the recipient's homedir will be used. However, if there
are more recipients, SA-milter will pass the provided username
(spamass-milter) to the spamd, so it's apparently the spamass-milter user
whose directory is /nonexistent.

However, that should not be a reason why your SA crashes.

--
Matus UHLAR - fantomas, uhlar[at]fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
If Barbie is so popular, why do you have to buy her friends?


p at state-of-mind

Nov 2, 2009, 12:01 AM

Post #8 of 10 (282 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

Matus,

* Matus UHLAR - fantomas <uhlar[at]fantomas.sk>:
> > * d.hill[at]yournetplus.com <d.hill[at]yournetplus.com>:
> > > The home directory for the username spamassassin is probably set to
> > > /nonexistant in the passwd file (or whatever it is in Ubuntu).
>
> On 01.11.09 23:23, Patrick Ben Koetter wrote:
> > Thanks for the reply. I wish, it was that easy, but it is not. The $HOME is
> > /home/spamassassin.
>
> you have passed the "-u spamass-milter" option. That means
> that SA-milter will pass username of the recipient to spamd if there's
> one recipient, so the recipient's homedir will be used. However, if there

That explains it! I never bothered to question this setting, as I thought it
would instruct the milter to run as user spamass-milter, which seemed kind of
wishful to me.


> are more recipients, SA-milter will pass the provided username
> (spamass-milter) to the spamd, so it's apparently the spamass-milter user
> whose directory is /nonexistent.

I will track this a little to see that it really fixes this particular
problem.

> However, that should not be a reason why your SA crashes.

Agreed. Any ideas how I could trap this better? I run spamd in debug mode
debugging "spamd". Running debug with option "all" seemed a little too heavy
to me. Is there best practice to trace the crashes?

p[at]rick


gdt at ir

Nov 2, 2009, 9:21 AM

Post #9 of 10 (272 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

I have had problems in postfix with spamass-milter and milter-greylist,
on NetBSD/sparc64 5-stable. I think I saw a SIGBUS in the log, which
would indicate an unaligned access. This recently started - it used to
be ok.
Not sure if this is relevant to your issue....


p at state-of-mind

Nov 2, 2009, 10:19 AM

Post #10 of 10 (272 views)
Permalink
Re: Crashes running SA as milter in Postfix [In reply to]

Mark,

* Mark Martinec <Mark.Martinec+sa[at]ijs.si>:
> > We regularly experience SA crashes on a Ubuntu Hardy machine. The setup is
> > as follows:
> >
> > Postfix (2.5.1) -> SpamAssassin Milter (0.3.1-6) -> SpamAssassin
> > (3.2.4-1ubuntu1.1)
> >
> > The milter is run like this:
> >
> > /usr/sbin/spamass-milter -P /var/run/spamass/spamass.pid -f \
> > -p /var/spool/postfix/spamass/spamass.sock \
> > -u spamass-milter -i 127.0.0.1 -r 10
> >
> > /usr/bin/perl -T -w /usr/sbin/spamd -s local5 -u spamassassin \
> > --nouser-config --max-children 10 --debug=spamd -d \
> > --pidfile=/var/run/spamd.pid
> >
> > It crashed again this weekend. This is what I found in the log:
> >
> > Oct 29 08:01:51 mail01 spamd[10249]: spamd: fork: Cannot allocate memory
> > at /usr/sbin/spamd line 999.
>
> /usr/include/errno.h
> #define ENOMEM 12 /* Cannot allocate memory */
>
> man 2 fork
> [ENOMEM] There is insufficient swap space for the new process.

it seems your diagnosis hit the spot. The filter seems to run stable now.

thanks,

p[at]rick

--
state of mind
Digitale Kommunikation

http://www.state-of-mind.de

Franziskanerstraße 15 Telefon +49 89 3090 4664
81669 München Telefax +49 89 3090 4666

Amtsgericht München Partnerschaftsregister PR 563

SpamAssassin users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.