Fajar A. Nugraha wrote:

Tomasz Kojm wrote:

On Mon, 08 Nov 2004 09:08:30 -0500
Joe Maimon <[EMAIL PROTECTED]> wrote:



Perhaps this should be configurable for the folk who want clamd to
exit on memory alloc failure and those who do not?


No problem:

Mon Nov  8 15:24:18 CET 2004 (tk)
---------------------------------
 * clamd: new directive ExitOnOOM (stop deamon when libclamav reports
          out of memory condition)

(disabled by default)



OK, I downloaded the new code from CVS, make, make install, activate ExitOnOOM,
reduce memory ulimits to 64 MBs, and now I have this


Tue Nov 9 10:28:54 2004 -> /var/spool/exim/scan/1CRMgW-0004yX-Mv/1CRMgW-0004yX-Mv.eml: Worm.Bagle.AU FOUND
Tue Nov 9 10:28:55 2004 -> ERROR: pthread_create failed
Tue Nov 9 10:28:55 2004 -> ERROR: pthread_create failed
Tue Nov 9 10:28:55 2004 -> ERROR: pthread_create failed
Tue Nov 9 10:28:55 2004 -> ERROR: pthread_create failed
Tue Nov 9 10:28:55 2004 -> ERROR: pthread_create failed
Tue Nov 9 10:28:55 2004 -> ERROR: pthread_create failed
Tue Nov 9 10:28:55 2004 -> ERROR: pthread_create failed
Tue Nov 9 10:28:56 2004 -> ERROR: pthread_create failed
Tue Nov 9 10:28:56 2004 -> ERROR: pthread_create failed


I suspect this is also memory related since if I increase ulimits to ... say ... 256M, it didn't happen.
Again, clamd didn't die on this error :)


On the side note, if the error is "calloc_problem: Cannot allocate memory",
I see clamd now gracefuly dies and daemontools kick in immediately. Which is good.
Now, shouldn't the same behaviour also happen on pthread errors?
Or can clamd really continue despite of the error (e.g. using some existing thread or something)?

Sounds like you are asking for too many threads than your ulimit allows. As long as there is at least one working clam worker thread, clamd can in theory keep working.


Probably ExitOnOOM if set should exit for this as well.
OTOH if clamd cant intialize the startup amount of threads indicated by configuration, maybe it should bail regardless of ExitOnOOM?


(on a redhat7.2 kernel 2.4 box each thread instance took a fairly large chunk of vsz as opposed to a debian 2.6 box)
Are you ulimiting vsz or rss?



Regards,

Fajar
_______________________________________________
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-users


_______________________________________________
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-users

Reply via email to