httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duane Buss" <>
Subject Improperly shared resources?
Date Thu, 23 Apr 2009 21:00:15 GMT
  While shutting down apache on a windows server with debug libraries,  the underlying os libraries
were complaining about the double free of a block of memory.   
  It appears that when ap_proxy_add_worker_to_balancer(apr_pool_t *pool, proxy_balancer *balancer,
proxy_worker *worker) is called it uses memcpy to duplicate the proxy worker but doesn't do
anything to change the cleanup routines or to make it's own copy of allocated resources like
the pool and possibly the semaphore.  This results in two proxy workers structures each pointing
to the same pool and semaphore.  
  During cleanup the original worker and the balancer worker each free their pool (which is
the same pool), resulting in the pool being placed in the pool free list twice, now when the
memory is freed there will be a double free of the memory representing the pool.
My patch for the issue is attached.

View raw message