mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
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.
This commit is contained in:
parent
9c783616cc
commit
e1cb762c9a
1 changed files with 14 additions and 2 deletions
|
@ -134,8 +134,20 @@ vacuum_weak_hash_table (SCM table)
|
||||||
size_t removed;
|
size_t removed;
|
||||||
SCM alist = SCM_SIMPLE_VECTOR_REF (buckets, k);
|
SCM alist = SCM_SIMPLE_VECTOR_REF (buckets, k);
|
||||||
alist = scm_fixup_weak_alist (alist, &removed);
|
alist = scm_fixup_weak_alist (alist, &removed);
|
||||||
assert (removed <= len);
|
if (removed <= len)
|
||||||
len -= removed;
|
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);
|
SCM_SIMPLE_VECTOR_SET (buckets, k, alist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue