On Mar 8, 2004, at 13:18, Doug Hardie wrote:



After a review of clamd/session.c and the developers forum archives I know what the cause of my problem is, but not necessarily why. The version that works (clamd / ClamAV version devel-20040209', clamav-milter version '0.66m) does not use either poll or select. At least neither is called directly. All of the later versions use select and they fail - when calling poll. So I suspect that on my system select is calling poll. However, the time field is getting set to zero when the source code clearly indicates that it should be non-zero. The time field is reset to a constant after each select call. Recompiling with no optimization does not change the outcome so its not likely to be an overlay either. I am guessing that haveing quite a number of threads active may be too much for select which may be getting them confused. However, thats a wild guess. I have no idea how to check that out.


Granted I am only working with one OS type/version, but it appears to me that neither the poll or select is reuqired. The accept seems to handle the situation fine by itself.

The above should have included both session.c and scanner.c.

I have been playing with .70rc and have finally found a way to create the problems above on a test system. Its bizarre, but what I do is feed all the source to FreeBSD to clamdscan and wait until top shows virtually no idle time. Stopping the feed leaves clamd running and eating up all the processor. Then I can run gdb on it. It shows some (but not all) of the threads are hung around line 282 of cl_rndnum in others.c. It is trying to read /dev/urandom and appears to be getting back zero bytes (or possibly a -1) and just sits in that loop forever. I can't imagine why urandom is failing as it doesn't seem to fail in any other application. Unfortunately, I was not able on the first try to figure out how to print out bread. gdb kept saying it didn't exist. I am tempted to insert the statement:


if (bread <= 0) break;

after the read statement but down't know what side affects that might cause. I'll probably give it a try and see what breaks.



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to