On 04/13/2010 03:53 PM, Andy Fiddaman wrote:

On Tue, 13 Apr 2010, scott.larn...@ed.ac.uk wrote:

; Hello,
;
; I tested ClamAV 0.96 on a relatively recent Solaris 10 / i86pc machine and all
; was well. Bringing it up on a production machine running a somewhat older
; version of Solaris 10 (also i86pc), clamd gives the warning:
;
; WARNING: Solaris only supports 256 open files for 32-bit processes, you need
; at least Solaris 10u4, or compile as 64-bit to support more!
; WARNING: MaxThreads * MaxRecursion is too high: 320, open file descriptor
; limit is: 255

Although you can increase the file descriptor limit for a 32-bit process
(in /etc/system and using ulimit) and then successfully open more than 256
files, this is not safe

It doesn't work with the FILE* functions, they fail.
See:
http://developers.sun.com/solaris/articles/stdio_256.html

We also had a ClamAV bug where this occured, hence the startup check and limiting to 255:
https://wwws.clamav.net/bugzilla/show_bug.cgi?id=1764#c10

and will often result in stack or heap corruption
depending on what parts of stdio you use. In general the 32-bit stdio
routines do not support file descriptors>  255.

With the release of Solaris 10 8/07 (often referred to as update 4), there
is a new interface to extend the FILE facility. Programming details are in
the man page enable_extended_FILE_stdio(3C), and if you don't want to make
any code changes, extendedFILE(5) describes how to do this for existing
applications and binaries.

That is exactly what ClamAV does when F_BADFD is defined (and hence enable_extended_FILE_stdio is available).


Binaries compiled as 64-bit do not have this constraint and can open up to
65536 files without problems.

Right, and ClamAV doesn't show a warning in this case.

Best regards,
--Edwin
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to