Jay Deiman wrote: > Török Edwin wrote: [snip] >> Does it get killed by a signal, or does it exit due to 'ExitOnOOM yes' >> in clamd.conf? >> malloc should return NULL when out of memory, and ClamAV should be able >> to handle it without crashing, if not its a bug. > > Sorry, I should have been more specific. It doesn't actually crash. > Here are the log messages I end up getting: > > ============================= > Apr 8 21:53:41 mpls-clamav-04 clamd[44009]: fds_add failed > Apr 8 21:53:41 mpls-clamav-04 clamd[44009]: add_fd: Memory allocation > failed for command buffer > ============================= > > At first glance, I thought I was running out of file descriptors, which > was not the case. I looked at memory usage after that and noticed that > I was sitting at 1.5GBs, my configured OS hard limit. > >> [snip] >> Usually I would say run it under valgrind, but with such a massive load >> that isn't practical. >> Try to get a stacktrace when clamd crashes, see "Backtrace of clamd" on >> clamav.net/bugs for instructions. >> >> Also there is some info here on how to trace leaks on FreeBSD: >> http://keramida.wordpress.com/2008/10/15/extracting-useful-info-from-freebsd-malloc-tracing/ >> Unfortunately that trace only gives you the timestamp when the memory >> was allocated, and not source lines. >> However if you turn on LogClean and LogTime in clamd, you may be able to >> match the leaks to files that were scanned at the time. >> >> Then you can try scanning only those files, and see if you can reproduce >> the leak. > > Cool, there's an addition to ktrace I didn't know about. I will set > this up on one of the hosts and see what I can figure out. Hopefully I > will be able to report back with some good information later on today.
Well, *I* couldn't find much of any use in the ktrace output. However, if someone else would like to take a look at the trace file, I've made it available at: http://janus.splitstreams.com/clamav-ktrace.out.bz2 It is about 91MB compressed. -- Jay Deiman \033:wq! _______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://www.clamav.net/support/ml