httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Plüm, Rüdiger, VF-Group <ruediger.pl...@vodafone.com>
Subject Re: abort inside ap_internal_fast_redirect()
Date Thu, 08 May 2008 16:52:31 GMT
 

> -----Ursprüngliche Nachricht-----
> Von: Graham Leggett  
> Gesendet: Donnerstag, 8. Mai 2008 15:29
> An: dev@httpd.apache.org
> Betreff: abort inside ap_internal_fast_redirect()
> 
> Hi all,
> 
> While debugging something else entirely I have tripped over 
> an abort() 
> triggered from inside mod_dir when POOL_DEBUG is enabled.
> 
> It seems within ap_internal_fast_redirect(), an attempt is 
> made to do this:
> 
>      r->notes = apr_table_overlay(r->pool, rr->notes, r->notes);
> 
> The abort occurs because "apr_table_overlay: overlay's pool is not an 
> ancestor of p".
> 
> The subrequest rr is created inside make_sub_request() like this:
> 
>      apr_pool_create(&rrp, r->pool);
>      apr_pool_tag(rrp, "subrequest");
>      rnew = apr_pcalloc(rrp, sizeof(request_rec));
>      rnew->pool = rrp;
> 
> I am confused - rr->pool was created as an ancestor of 
> r->pool, so why 
> should it abort?

IMHO the code in apr_table_overlay is wrong:

#if APR_POOL_DEBUG
    /* we don't copy keys and values, so it's necessary that
     * overlay->a.pool and base->a.pool have a life span at least
     * as long as p
     */
    if (!apr_pool_is_ancestor(overlay->a.pool, p)) {
        fprintf(stderr,
        "apr_table_overlay: overlay's pool is not an ancestor of p\n");
        abort();
    }
    if (!apr_pool_is_ancestor(base->a.pool, p)) {
        fprintf(stderr,
        "apr_table_overlay: base's pool is not an ancestor of p\n");
        abort();
    }
#endif

I guess it should be

apr_pool_is_ancestor(p, overlay->a.pool)

and 

apr_pool_is_ancestor(p, base->a.pool)

instead.

Regards

Rüdiger


Mime
View raw message