[Gc] Segfault in GC_mark_from in libgc 7.1 (released tarball)

Klaus Treichel ktreichel at web.de
Sun Aug 17 04:22:48 PDT 2008


Am Mittwoch, den 13.08.2008, 09:39 +0200 schrieb Klaus Treichel:
> Am Mittwoch, den 13.08.2008, 10:17 +1200 schrieb Bruce Hoult:
> > 2008/8/13 Klaus Treichel <ktreichel at web.de>:
> > > Hi,
> > >
> > > what i found out until now is:
> > >
> > > 1. limit is an inaccessible address
> > > (gdb) print limit
> > > $26 = 0xb55010 <Address 0xb55010 out of bounds>
> > >
> > > where 0xb54fff is accessible.
> > >
> > > 2. limit is in the range between least_ha and greatest_ha so the check
> > > doesn't prevent the segfault.
> > 
> > Are least_ha and greatest_ha both accessible?
> > 
> > If so then I guess the OS has given the GC two chunks of memory (in a
> > heap expansion) with an inaccessible region in between.  I think that
> > would violate an assumption in the marking code.
> 
> least_ha == GC_least_plausible_heap_addr == 0x7acff8 here is accessible
> 
> greatest_ha == GC_greatest_plausible_heap_addr == 0x2b9dde8 is not
> accessible

It looks like GC_greatest_plausible_heap_addr is set to the inaccessible
memory location in alloc.c line 941.

Setting expansion_slop to 0 fixed my segfault but i'm not sure how this
affects overall GC performance.

One question came up by looking at the code (line 939 in alloc.c):

	word new_limit = (word)space + bytes + expansion_slop;
	if (new_limit > (word)space) {

new_limit should be greater than space except adding expansion_slop
causes an overflow.

In this case GC_greatest_plausible_heap_addr is not updated that might
cause allocated memory not being scanned.

Klaus


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://napali.hpl.hp.com/pipermail/gc/attachments/20080817/01584698/attachment.pgp


More information about the Gc mailing list