You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2005/08/24 16:13:32 UTC

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

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 */