On Wed, 24 Sep 2003, Stas Bekman wrote:

> Sander says that this shouldn't be an issue, however try
> this patch. It assigns a unique key based on the pool
> address without hardcoding anything at all:
>
> Index: xs/APR/Pool/APR__Pool.h
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/xs/APR/Pool/APR__Pool.h,v
> retrieving revision 1.6
> diff -u -r1.6 APR__Pool.h
> --- xs/APR/Pool/APR__Pool.h     9 Sep 2003 17:22:39 -0000       1.6
> +++ xs/APR/Pool/APR__Pool.h     25 Sep 2003 06:55:57 -0000
> @@ -9,12 +9,15 @@
>   {
>       apr_pool_t *parent = mpxs_sv_object_deref(obj, apr_pool_t);
>       apr_pool_t *newpool = NULL;
> +    char *key;
> +
>       (void)apr_pool_create(&newpool, parent);
>
>       /* mark the pool as being created via APR::Pool->new()
>        * see mpxs_apr_pool_DESTROY */
> -    apr_pool_userdata_set((const void *)1, MP_APR_POOL_NEW,
> -                          apr_pool_cleanup_null, newpool);
> +    key = apr_psprintf(newpool, "0x%lx", (unsigned long)newpool);
> +    fprintf(stderr, "CREATE  key: %s\n", key);
> +    apr_pool_userdata_set((const void *)1, key, NULL, newpool);
>
>       return newpool;
>   }
> @@ -119,7 +122,8 @@
>
>       void *flag;
>       apr_pool_t *p;
> -
> +    char *key;
> +
>       /* APR::Pool::DESTROY
>        * we only want to call DESTROY on objects created by
>        * APR::Pool->new(), not objects representing native pools
> @@ -128,7 +132,9 @@
>
>       p = mpxs_sv_object_deref(obj, apr_pool_t);
>
> -    apr_pool_userdata_get(&flag, MP_APR_POOL_NEW, p);
> +    key = apr_psprintf(p, "0x%lx", (unsigned long)p);
> +    fprintf(stderr, "DESTROY key: %s\n", key);
> +    apr_pool_userdata_get(&flag, key, p);
>
>       if (flag) {
>            apr_pool_destroy(p);

Unfortunately, I get back the t/filter/ crash with this
patch ...

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to