apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r239666 - /apr/apr/trunk/memory/unix/apr_pools.c
Date Wed, 24 Aug 2005 14:13:32 GMT
Author: jorton
Date: Wed Aug 24 07:13:29 2005
New Revision: 239666

URL: http://svn.apache.org/viewcvs?rev=239666&view=rev
Log:
* memory/unix/apr_pools.c (apr_pool_cleanup_kill) [APR_POOL_DEBUG]:
Add some cheap loop detection to abort if the cleanup list is corrupt.

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?rev=239666&r1=239665&r2=239666&view=diff
==============================================================================
--- apr/apr/trunk/memory/unix/apr_pools.c (original)
+++ apr/apr/trunk/memory/unix/apr_pools.c Wed Aug 24 07:13:29 2005
@@ -1974,6 +1974,15 @@
     c = p->cleanups;
     lastp = &p->cleanups;
     while (c) {
+#if APR_POOL_DEBUG
+        /* Some cheap loop detection to catch a corrupt list: */
+        if (c == c->next
+            || (c->next && c == c->next->next)
+            || (c->next && c->next->next && c == c->next->next->next))
{
+            abort();
+        }
+#endif
+
         if (c->data == data && c->plain_cleanup_fn == cleanup_fn) {
             *lastp = c->next;
             /* move to freelist */



Mime
View raw message