You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by sf...@apache.org on 2013/05/10 22:58:54 UTC

svn commit: r1481186 - /apr/apr/trunk/memory/unix/apr_pools.c

Author: sf
Date: Fri May 10 20:58:54 2013
New Revision: 1481186

URL: http://svn.apache.org/r1481186
Log:
Pool debugging fixes

- avoid using a destroyed mutex in apr_pool_clear()
- if we create a sub-pool, we don't need to own the pool.

Modified:
    apr/apr/trunk/memory/unix/apr_pools.c

Modified: apr/apr/trunk/memory/unix/apr_pools.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memory/unix/apr_pools.c?rev=1481186&r1=1481185&r2=1481186&view=diff
==============================================================================
--- apr/apr/trunk/memory/unix/apr_pools.c (original)
+++ apr/apr/trunk/memory/unix/apr_pools.c Fri May 10 20:58:54 2013
@@ -1742,6 +1742,11 @@ APR_DECLARE(void) apr_pool_clear_debug(a
      * the mutex we obtained above.
      */
     if (mutex != pool->mutex) {
+        /*
+         * Prevent apr_palloc() in apr_thread_mutex_create() from trying to
+         * use the destroyed mutex.
+         */
+        pool->mutex = NULL;
         (void)apr_thread_mutex_create(&pool->mutex,
                                       APR_THREAD_MUTEX_NESTED, pool);
 
@@ -1818,7 +1823,7 @@ APR_DECLARE(apr_status_t) apr_pool_creat
         parent = global_pool;
     }
     else {
-       apr_pool_check_integrity(parent);
+       apr_pool_check_lifetime(parent);
 
        if (!allocator)
            allocator = parent->allocator;