Subject: parent router leaks file descriptors

From: Eugene Crosser <[email-masked]>
Date: 04 Oct 2002 15:47:39 +0400

[I sent this a few days ago but apparently it got lost]
[Failed second time, possibly example message triggered spam filter?]

I was bitten by a problem: when child routers die (with segfault, I am
attaching a message that triggers this) the parent preocess forks a new
child but in process of that, it eventually runs out of file descriptors
and fails to start any more children.  Then it starts to just busyloop
on pipe() call (if memory serves; anyway on some call that fails with
indication of no more descriptors).

This is a header of a message causing segfault:

[not including the message this time]

-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to [email-masked]

---

From: Matti Aarnio <[email-masked]>
Date: Fri, 4 Oct 2002 16:14:51 +0300

> [Failed second time, possibly example message triggered spam filter?]

  Yes it did.  m/[\200-\377]{5}/  -pattern rule..  E.g. 5 or more
  consequtive chars with high bit set..  Bites on russian, and
  chinese/korean spams.  I found the "BOUNCE" from among the flood
  of "genuine spam" in my trash-pile (some call it: inbox)...

> [not including the message this time]

  Hmm.. seg-faults should not happen, neither leaks...
  I have things to debug, thanks for the experiment case.

-- 
/Matti Aarnio	<[email-masked]>
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to [email-masked]

---

From: Matti Aarnio <[email-masked]>
Date: Fri, 4 Oct 2002 17:56:59 +0300

>   I have things to debug, thanks for the experiment case.

  The leakage has been arrested (easy to simulate with  kill -9
  at Solaris, and look what  lsof  tells of the parent process..)

  Those bad headers then...

---

From: Eugene Crosser <[email-masked]>
Date: 04 Oct 2002 19:14:51 +0400

>   at Solaris, and look what  lsof  tells of the parent process..)

The problem was observed on Linux.
Now, daemonsub.c does not compile (on Linux):

/usr/local/src/zmailer/zmailer/router/daemonsub.c: In function
`sig_chld':
/usr/local/src/zmailer/zmailer/router/daemonsub.c:320: warning: implicit
declaration of function `wait3'
/usr/local/src/zmailer/zmailer/router/daemonsub.c:320: `WNOHANG'
undeclared (first use in this function)
/usr/local/src/zmailer/zmailer/router/daemonsub.c:320: (Each undeclared
identifier is reported only once
/usr/local/src/zmailer/zmailer/router/daemonsub.c:320: for each function
it appears in.)
/usr/local/src/zmailer/zmailer/router/daemonsub.c: In function
`reader_getc':
/usr/local/src/zmailer/zmailer/router/daemonsub.c:373: warning: implicit
declaration of function `WIFSIGNALED'
/usr/local/src/zmailer/zmailer/router/daemonsub.c:374: warning: implicit
declaration of function `WSIGNALSTATUS'
/usr/local/src/zmailer/zmailer/router/daemonsub.c:375: warning: implicit
declaration of function `WIFEXITED'
/usr/local/src/zmailer/zmailer/router/daemonsub.c:376: warning: implicit
declaration of function `WEXITSTATUS'
make: *** [daemonsub.o] Error 1

-