GNU bug report logs -
#28590
Weak tables in 2.2.2 grow indefinitely
Previous Next
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 #13 received at 28590 <at> debbugs.gnu.org (full text, mbox):
ludo <at> gnu.org (Ludovic Courtès) skribis:
> On 2.2.2, the heap grows indefinitely (though logarithmically). It’s
> not deterministic though: sometimes the heap size stabilizes in the
> 140–300 MiB range, and sometimes it keeps growing endlessly even though
> the table size reaches a maxium at 7,190,537 entries.
Below is a simple reproducer in C that I’ve also reported at
<https://github.com/ivmai/bdwgc/issues/182>:
--8<---------------cut here---------------start------------->8---
#define GC_DEBUG 1
#include <gc.h>
#include <stdlib.h>
#include <stdio.h>
int
main ()
{
GC_INIT ();
while (1)
{
unsigned int count = 777 * (random () % 1000);
void **p = GC_MALLOC_ATOMIC (count * sizeof *p);
for (unsigned int i = 0; i < count; i++)
{
void *key = GC_MALLOC_ATOMIC (10);
p[i] = key;
GC_GENERAL_REGISTER_DISAPPEARING_LINK (&p[i], key); /* <- !!! */
}
static unsigned int loops = 0;
if (loops++ % 10 == 0)
printf ("iteration %4u, heap size = %li MiB\n",
loops, GC_get_heap_size () / (1024 * 1024));
}
}
--8<---------------cut here---------------end--------------->8---
Ludo’.
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.