On Mon, 8 Apr 2002, Cliff Woolley wrote:
> > ...looks like a problem with cleaning up an mmap bucket. This is from
> > /usr/local/apache2.0.35/corefiles/httpd.core.3 ; .4 and .5 are the same
> > problem.
In this function:
APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap,
apr_mmap_t *old_mmap,
apr_pool_t *p,
int transfer_ownership)
{
*new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t));
(*new_mmap)->cntxt = p;
/* The old_mmap can transfer ownership only if the old_mmap itself
* is an owner of the mmap'ed segment.
*/
if (old_mmap->is_owner) {
if (transfer_ownership) {
(*new_mmap)->is_owner = 1;
old_mmap->is_owner = 0;
apr_pool_cleanup_kill(old_mmap->cntxt, old_mmap, mmap_cleanup);
}
else {
(*new_mmap)->is_owner = 0;
}
apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup,
apr_pool_cleanup_null);
}
return APR_SUCCESS;
}
Why is apr_pool_cleanup_register() called regardless of whether we're
transferring ownership or not? Shouldn't it only be called if
(transfer_ownership), same as the apr_pool_cleanup_kill() call?
--Cliff
--------------------------------------------------------------
Cliff Woolley
[EMAIL PROTECTED]
Charlottesville, VA