On Fri, Jul 22, 2005 at 10:04:34AM -0400, Brian A. Reiter said:
> > I am experiencing a problem with clamd crashing shortly after 
> > a scan using the STREAM protocol. This affects recent 
> > versions of clamd including 0.86.1 and clamav-devel in CVS 
> > running on Interix.
> 
> I have spent a little time looking into this. The segv happens when the
> thread pool spins down the worker threads after the idle timeout for the
> thread has elapsed. However it only segvs if all of the following are true:
> 
> scanstream() was queued to the worker thread
> cfgopt(copt, "TCPSocket"))->enabled) == TRUE 
> cfgopt(copt, "TCPAddr"))->enabled) == TRUE 
> 
> That pretty much says to me that the code that causes the instability is the
> call to gethostbyname(3) to get the sin_addr for binding the STREAM socket
> because the alternate execution path of binding to INADDR_ANY is
> trouble-free.
> 
> I'm trying to decide if I should replace gethostbyname(3) and the pthread
> locks with gethostbyname_r/lwres_gethostbyname_r(3) (reentrant) or if there
> is something in BIND9 on Interix that is broken.
> 
> It would help if I knew if this is a problem that can be reproduced on other
> platforms than Interix. 

It does not appear to be reproducible on linux, either with a 2.4 or
2.6 kernel.  I usually bind to 127.0.0.1, but have several machines
that bind to one of the public interfaces.  I have never experienced
this crash on reload.  It does sound like perhaps the implementation of
gethostbyname is not reeentrant.

Take care,
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | "Ask not what A Group of Employees can  |
|  [EMAIL PROTECTED]             | do for you.  But ask what can  All      |
|  http://www.lobefin.net/~steve | Employees do for A Group of Employees." |
|                                | -- Mike Dennison                        |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to