Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 24149 invoked from network); 31 May 2005 11:42:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 May 2005 11:42:54 -0000 Received: (qmail 46607 invoked by uid 500); 31 May 2005 11:42:54 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 46554 invoked by uid 500); 31 May 2005 11:42:53 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 46525 invoked by uid 99); 31 May 2005 11:42:53 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 31 May 2005 04:42:52 -0700 Received: (qmail 24086 invoked by uid 65534); 31 May 2005 11:42:42 -0000 Message-ID: <20050531114242.24085.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r179208 - /apr/apr/trunk/memory/unix/apr_pools.c Date: Tue, 31 May 2005 11:42:42 -0000 To: commits@apr.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jorton Date: Tue May 31 04:42:40 2005 New Revision: 179208 URL: http://svn.apache.org/viewcvs?rev=3D179208&view=3Drev Log: Abort if the caller violates a joined-pool guarantee and explicitly destroys a joined pool: (catches the mod_include pool lifetime issues described in PR 12655) * memory/unix/apr_pools.c (pool_destroy_debug): Renamed from apr_pool_destroy_debug; made static. (apr_pool_destroy_debug): New function, wrapper for pool_destroy_debug; abort if called on a joined pool. (pool_clear_debug): Use pool_destroy_debug rather than the wrapper to destroy subpools. Modified: apr/apr/trunk/memory/unix/apr_pools.c Modified: apr/apr/trunk/memory/unix/apr_pools.c URL: http://svn.apache.org/viewcvs/apr/apr/trunk/memory/unix/apr_pools.c?re= v=3D179208&r1=3D179207&r2=3D179208&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- apr/apr/trunk/memory/unix/apr_pools.c (original) +++ apr/apr/trunk/memory/unix/apr_pools.c Tue May 31 04:42:40 2005 @@ -500,6 +500,9 @@ static void run_child_cleanups(cleanup_t **c); static void free_proc_chain(struct process_chain *procs); =20 +#if APR_POOL_DEBUG +static void pool_destroy_debug(apr_pool_t *pool, const char *file_line); +#endif =20 #if !APR_POOL_DEBUG /* @@ -1361,7 +1364,7 @@ * this pool thus this loop is safe and easy. */ while (pool->child) - apr_pool_destroy_debug(pool->child, file_line); + pool_destroy_debug(pool->child, file_line); =20 /* Run cleanups */ run_cleanups(&pool->cleanups); @@ -1436,8 +1439,7 @@ #endif /* APR_HAS_THREADS */ } =20 -APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, - const char *file_line) +static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) { apr_pool_check_integrity(pool); =20 @@ -1472,6 +1474,22 @@ =20 /* Free the pool itself */ free(pool); +} + +APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, + const char *file_line) +{ + if (pool->joined) { + /* Joined pools must not be explicitly destroyed; the caller + * has broken the guarantee. */ +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) + apr_pool_log_event(pool, "LIFE", + __FILE__ ":apr_pool_destroy abort on joined", 0= ); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ + + abort(); + } + pool_destroy_debug(pool, file_line); } =20 APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool,