GNU bug report logs - #28590
Weak tables in 2.2.2 grow indefinitely

Previous Next

Package: guile;

Reported by: ludo <at> gnu.org (Ludovic Courtès)

Date: Mon, 25 Sep 2017 08:50:01 UTC

Severity: serious

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


Message #19 received at 28590 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: wingo <at> igalia.com
Cc: Ludovic Courtès <ludo <at> gnu.org>, 28590 <at> debbugs.gnu.org
Subject: [PATCH 1/7] weak-table: Fix unbounded growth of the disappearing link
 table.
Date: Tue,  3 Oct 2017 13:43:46 +0200
Partly fixes <https://bugs.gnu.org/28590>.

* libguile/weak-table.c (resize_table): Remove all disappearing links on
OLD_ENTRIES, and reset all of OLD_ENTRIES.
---
 libguile/weak-table.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/libguile/weak-table.c b/libguile/weak-table.c
index 599c4cf0e..a0bebca5e 100644
--- a/libguile/weak-table.c
+++ b/libguile/weak-table.c
@@ -498,11 +498,19 @@ resize_table (scm_t_weak_table *table)
       scm_t_weak_entry copy;
       unsigned long new_k, distance;
 
+      /* Make sure we don't leave a disappearing link behind us.
+	 See <https://github.com/ivmai/bdwgc/issues/182>.  */
+      unregister_disappearing_links (&old_entries[old_k], table->kind);
+
       if (!old_entries[old_k].hash)
-        continue;
-      
+	{
+	  old_entries[old_k].key = old_entries[old_k].value = 0;
+	  continue;
+	}
+
       copy_weak_entry (&old_entries[old_k], &copy);
-      
+      old_entries[old_k].key = old_entries[old_k].value = 0;
+
       if (!copy.key || !copy.value)
         continue;
       
-- 
2.14.2





This bug report was last modified 7 years and 202 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.