apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject [PATCH] necessary fix to APR_POOL_DEBUG?
Date Thu, 10 Jan 2002 18:39:02 GMT
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