perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@ectoplasm.org>
Subject Re: [mp2] protocol/echo_bbs2 on Win32
Date Thu, 01 Jul 2004 23:52:50 GMT


Stas Bekman wrote:
> Philippe M. Chiasson wrote:
> 
>>
>>Stas Bekman wrote:
>>
>>
>>>Joe Orton wrote:
>>>
>>>
>>>>On Thu, Jul 01, 2004 at 02:06:33PM -0700, Stas Bekman wrote:
>>>>...
>>>>
>>>>
>>>>
>>>>>$7 = (struct apr_bucket *) 0x1011007
>>>>>(gdb) print *((*b)->list->prev)
>>>>>Cannot access memory at address 0x1011007
>>>>>
>>>>>I don't understand why it doesn't happen on my setup which seems to 
>>>>>be pretty close to philippe's one. I suppose it just so happens that 
>>>>>the freed memory is still valid on my machine, due to different 
>>>>>compilations.
>>>>>
>>>>>The problem appears to be in Apache, where some downstream filter 
>>>>>decides to free the brigade, rendering $bb->cleanup useless, since

>>>>>you can't rely on $bb to be valid at all. That just sucks.
>>>>
>>>>
>>>>
>>>>Right; the thing is that currently, there really is no way to actually
>>>>"free the brigade"; apr_brigade_destroy() just does an
>>>>apr_brigade_cleanup() and unregisters the pool cleanup.  The brigade
>>>>structure remains valid until the pool it's allocated from gets
>>>>destroyed.
>>>>
>>>>To help track down the bug:
>>>>
>>>>1) build httpd/apr* with -DAPR_BUCKET_DEBUG to enable the brigade
>>>>consistency checks; this may show very quickly the problem
>>>
>>>
>>>
>>>Philippe, can you please do that? I don't get this problem so it's 
>>>probably the best that you do that.
>>
>>
>>Just updated to httpd 2.0.50-dev latest and recompiled with all the 
>>APR_DEBUG_*
>>I could fine, still same exact core dump ;(
> 
> 
> I've never used that flag. I suppose it doesn't prevent segfaults but probably 
> generates a copious diagnostics output.

Nah, in the case of APR_BUCKET_DEBUG, it only makes one little extra check when
deleting buckets in apr_bucket_free :

#ifdef APR_BUCKET_DEBUG
[...]
static void check_not_already_free(node_header_t *node)
{
     apr_bucket_alloc_t *list = node->alloc;
     node_header_t *curr = list->freelist;

     while (curr) {
         if (node == curr) {
             abort();
         }
         curr = curr->next;
     }
}
#else
#define check_not_already_free(node)
#endif

So nothing more usefull from it.


-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Mime
View raw message