apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <stri...@apache.org>
Subject RE: [PATCH] necessary fix to APR_POOL_DEBUG?
Date Thu, 10 Jan 2002 18:57:43 GMT
Hi,

Yeah, looks about right.  Thanks.
I took it a step further and eliminated the explicit
NULL after the memset.  Fixed an unprotected pool->mutex
instance aswell.

Sander

> -----Original Message-----
> From: trawick@rdu163-40-092.nc.rr.com
> [mailto:trawick@rdu163-40-092.nc.rr.com]On Behalf Of Jeff Trawick
> Sent: 10 January 2002 19:39
> To: dev@apr.apache.org
> Subject: [PATCH] necessary fix to APR_POOL_DEBUG?
> 
> 
> While trying to run with APR_POOL_DEBUG I hit a segfault almost
> immediately trying to dereference pool->mutex, which wasn't a valid
> pointer.  I see a path where pool->mutex isn't initialized.  This
> seems to fix it, though perhaps one of the pool guys wants to just set
> the mutex field?
> 
> Index: srclib/apr/memory/unix/apr_pools.c
> ===================================================================
> RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
> retrieving revision 1.126
> diff -u -r1.126 apr_pools.c
> --- srclib/apr/memory/unix/apr_pools.c	1 Jan 2002 23:49:23 -0000	1.126
> +++ srclib/apr/memory/unix/apr_pools.c	10 Jan 2002 18:38:57 -0000
> @@ -1,3 +1,4 @@
> +#define APR_POOL_DEBUG
>  /* ====================================================================
>   * The Apache Software License, Version 1.1
>   *
> @@ -982,6 +983,8 @@
>  
>           return APR_ENOMEM;
>      }
> +
> +    memset(pool, 0, SIZEOF_POOL_T);
>  
>      pool->abort_fn = abort_fn;
>      pool->child = NULL;
> 
> -- 
> Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
>        http://www.geocities.com/SiliconValley/Park/9289/
>              Born in Roswell... married an alien...
> 
> 

Mime
View raw message