guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/01: Keep trucking on weak table corruption


From: Andy Wingo
Subject: [Guile-commits] 01/01: Keep trucking on weak table corruption
Date: Tue, 12 Jul 2016 07:31:50 +0000 (UTC)

wingo pushed a commit to branch stable-2.0
in repository guile.

commit e1cb762c9aaff98dbb2634f2265923b3358809d5
Author: Andy Wingo <address@hidden>
Date:   Tue Jul 12 09:30:10 2016 +0200

    Keep trucking on weak table corruption
    
    * libguile/hashtab.c (vacuum_weak_hash_table): Don't abort if we
      apparently remove more items than are in the table; instead print a
      warning.  "Fixes" #19180.
---
 libguile/hashtab.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index 44db051..93975bb 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -134,8 +134,20 @@ vacuum_weak_hash_table (SCM table)
       size_t removed;
       SCM alist = SCM_SIMPLE_VECTOR_REF (buckets, k);
       alist = scm_fixup_weak_alist (alist, &removed);
-      assert (removed <= len);
-      len -= removed;
+      if (removed <= len)
+        len -= removed;
+      else
+        {
+          /* The move to BDW-GC with Guile 2.0 introduced some bugs
+             related to weak hash tables, threads, memory usage, and the
+             alloc lock.  We were unable to fix these issues
+             satisfactorily in 2.0 but have addressed them via a rewrite
+             in 2.2.  If you see this message often, you probably want
+             to upgrade to 2.2.  */
+          fprintf (stderr, "guile: warning: weak hash table corruption "
+                   "(https://bugs.gnu.org/19180)");
+          len = 0;
+        }
       SCM_SIMPLE_VECTOR_SET (buckets, k, alist);
     }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]