I've been trussing the freshclam process (from clamav-20030317) for a few
weeks now and I think I know (at least one cause of) what's going wrong -
it's leaking file descriptors and eventually it gets an EMFILE error
whenever it tries to make update the database or talk to clamd.  Is this
enough to go on to track down and fix the problem?  Here's a short truss
(Sol9, sparc) when the error first occurs:

...

8649:   read(254, " P 2 0 0 0 = c 4 2 4 8 5".., 8192)   = 8192
8649:   read(254, " 3 3 3 2 2 e 6 5 7 8 6 5".., 8192)   = 8192
8649:   read(254, " 2 1 3 5 c d 2 1 8 c\n Y".., 8192)   = 4075
8649:   read(254, 0x00230FF4, 8192)                     = 0
8649:   stat("viruses.db2", 0xFFBFF538)                 = 0
8649:   open("viruses.db2", O_RDONLY)                   = 255
8649:   fstat64(255, 0xFFBFE2A0)                        = 0
8649:   brk(0x00234DB0)                                 = 0
8649:   brk(0x00236DB0)                                 = 0
8649:   fstat64(255, 0xFFBFE148)                        = 0
8649:   ioctl(255, TCGETA, 0xFFBFE22C)                  Err#25 ENOTTY
8649:   read(255, " D O S . P h r o z e n L".., 8192)   = 5135
8649:   read(255, 0x0023383C, 8192)                     = 0
8649:   so_socket(PF_INET, SOCK_STREAM, IPPROTO_IP, "", 1) Err#24 EMFILE
8649:   door_info(3, 0xFFBFD380)                        = 0
8649:   door_call(3, 0xFFBFD368)                        = 0
8649:   connect(-1, 0xFFBFF5B0, 16, 1)                  Err#9 EBADF
8649:   write(4, " E R R O R :   C a n ' t".., 61)      = 61
8649:   close(-1)                                       Err#9 EBADF
8649:   write(4, " E R R O R :   C o n n e".., 52)      = 52
8649:   time()                                          = 1056176291
8649:   write(4, " C h e c k i n g   f o r".., 66)      = 66
8649:   stat("viruses.db", 0xFFBFF538)                  = 0
8649:   open("viruses.db", O_RDONLY)                    Err#24 EMFILE
8649:   write(2, " L i b C l a m A V   E r".., 17)      Err#9 EBADF
8649:   write(2, " m d 5 _ f i l e ( ) :  ".., 28)      Err#9 EBADF
8649:   write(4, " E R R O R :   C a n ' t".., 61)      = 61
8649:   open("mirror", O_RDONLY|O_CREAT|O_TRUNC, 0466700) Err#24 EMFILE
8649:   close(-1)                                       Err#9 EBADF
8649:   write(4, "\n - - - - - - - - - - -".., 40)      = 40
8649:   nanosleep(0xFFBFF738, 0xFFBFF730) (sleeping...)
8649:   nanosleep(0xFFBFF738, 0xFFBFF730)               = 0
8649:   stat("mirror", 0xFFBFF6A8)                      Err#2 ENOENT
8649:   time()                                          = 1056178054
8649:   write(4, " C h e c k i n g   f o r".., 66)      = 66

...

My best guess so far from looking at the truss output is that the open()
call for "viruses.db2" is returning a file descriptor that never gets
passed to a corresponding close() call.

        Ed

Ed Phillips <[EMAIL PROTECTED]> University of Delaware (302) 831-6082
Systems Programmer III, Network and Systems Services
finger -l [EMAIL PROTECTED] for PGP public key

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to