Bug 4035 - spamd children do not respawn on FreeBSD/Alpha
Summary: spamd children do not respawn on FreeBSD/Alpha
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 3.0.1
Hardware: DEC FreeBSD
: P5 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords: triage
Depends on:
Blocks:
 
Reported: 2004-12-16 13:36 UTC by David Brodbeck
Modified: 2005-07-07 00:34 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
spamd -D log text/plain None David Brodbeck [NoCLA]
truss output for parent process application/octet-stream None David Brodbeck [NoCLA]
truss output for child process text/plain None David Brodbeck [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description David Brodbeck 2004-12-16 13:36:09 UTC
FreeBSD/Alpha 4.8-RELEASE, Perl 5.6.1, compiled from ports.  SpamAssassin 3.0.1
and 3.0.2, built and installed from the official tarballs.  'make test' passes.

When child processes hit their max-conn-per-child limit, they become zombies and
just sit there.  No new child processes are spawned, and eventually the system
runs out of spamd children.

I honestly don't know if this is a Perl problem or a spamd problem, but after
posting on the mailing list it was suggested I create a bug here.

I will attach the output of spamd -D, as well as truss output for the parent
process and one child.
Comment 1 David Brodbeck 2004-12-16 13:39:37 UTC
Created attachment 2567 [details]
spamd -D log
Comment 2 David Brodbeck 2004-12-16 13:40:28 UTC
Created attachment 2568 [details]
truss output for parent process

gzipped for length
Comment 3 David Brodbeck 2004-12-16 13:41:03 UTC
Created attachment 2569 [details]
truss output for child process
Comment 4 David Brodbeck 2004-12-16 13:43:09 UTC
The attached files were created by starting spamd with --max-conn-per-child=1,
then sending a single message, causing one of the children to become a zombie. 
spamd was then manually shut down with SIGTERM.
Comment 5 Justin Mason 2004-12-16 14:40:22 UTC
hmm, no sign of the child exiting in that truss output.  in fact, the child
truss output looks very incomplete -- it reads the passwd and spwd files, then
does no more system calls?

ideally there'd be a SIGCHLD in one or an _exit() in the child ;)
Comment 6 David Brodbeck 2004-12-16 15:37:21 UTC
I know what you're saying, but that's where truss exited.  The process was a
zombie after that.
Comment 7 Justin Mason 2004-12-16 16:25:12 UTC
??

so it became a zombie without exiting?  I don't know *that* much about BSD on
Alpha, but surely that's impossible ;)   any chance you can get more data from
truss?
Comment 8 David Brodbeck 2004-12-17 05:48:35 UTC
I'm not sure how.  I'm not terribly familiar with it, I'm just going by the
manpage.  I tried attaching it to the child processes twice and both times truss
exited with the same results.  I'm probably doing something wrong, but there
aren't a lot of options associated with truss.  I have no clue why it's exiting
before it logs the child's exit.

The command line I used was "truss -o child-truss.txt -p <pid of child>".  I'm
open to suggestions.
Comment 9 Tom Schulz 2004-12-20 06:41:57 UTC
I believe that the definition of zombie (as far as computers are concerned)
is that the process is dead in that it can no longer execute any code and
should be exiting, but it is undead in that the final exit can not happen.
If I remember correctly, the child process is waiting (or the operating
system is waiting) for the parrent to reap the child.
Comment 10 Tom Schulz 2004-12-20 07:11:46 UTC
The point of my last comment is that you can not truss a process that is a
zombie because it really does not exist.  If you truss it before it becomes
a zombie, I would expect that you would see every thing that it did before
becomming a zombie.  You will not see an exit as the process did not exit.
I expect that this is a Perl bug, possibly with child/parrent communication
when running on FreeBSD/Alpha.  Hopefully a newer version of Perl will fix
this.
Comment 11 David Brodbeck 2004-12-20 08:43:07 UTC
I may have to wait for them to fix perl 5.8, then.  Currently it will compile on
Alpha, but pack() and unpack() fail testing, so it's not usable on that platform.
Comment 12 Bob Menschel 2005-05-24 21:17:05 UTC
David -- just checking -- does this problem still exist for you? 
Comment 13 David Brodbeck 2005-05-25 06:28:00 UTC
I've upgraded to FreeBSD 4.11-RELEASE since then, and rebuilt Perl.  The
children no longer become zombies, but they still don't respawn.  Eventually I'm
left with just the one original spamd process running, and no children.  If I
kill -HUP the process, the children are spawned.

I really suspect some kind of process handling bug in Perl on the Alpha platform.

It's not really a problem for me now...I just set --max-conn-per-child to a high
number, and since I'm now running rules du jour the process gets restarted every
so often anyway.
Comment 14 David Brodbeck 2005-07-07 08:34:10 UTC
I'm now running 3.1.0-pre3 and it doesn't exhibit the problem.  Something in the
new forking algorithm must have fixed it.