[Gc] Uniq() test in gctest

Boehm, Hans hans.boehm at hp.com
Wed Nov 10 16:01:38 PST 2004


This is a serious problem that needs to be fixed.

It means that either GC_generic_push_regs itself is not saving the
effected registers on the stack (e.g. because setjmp doesn't save
them), or it means that GC_push_current_stack is not pushing the
result on the mark stack.  Certainly GC_stackbottom could also be an issue,
though that's unlikely if this is the only failure.  Does it run
much further if you comment out this test?  Does GC_stackbottom look
reasonable relative the stack pointer?

Hans


> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com]On Behalf Of Peter Colson
> Sent: Wednesday, November 10, 2004 3:37 PM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] Uniq() test in gctest
> 
> 
> I want to know if this test, when it emits "Apparently failed to mark 
> form some function arguments. Perhaps GC_push_regs was configured 
> incorrectly?" is really indicating an issue that needs to be fixed in 
> GC_(generic_)push_regs (I ask because the setjmp_t test is apparently 
> now out of data and unreliable, I've been told).
> 
> The test looks to be forcing a collect after 3, 4, 4, 4, 4 and 1 
> malloc's on one function call:
> 
> uniq(GC_malloc(12), GC_malloc(12), GC_malloc(12),
>           (GC_gcollect(),GC_malloc(12)),
>           GC_malloc(12), GC_malloc(12), GC_malloc(12),
>           (GC_gcollect(),GC_malloc(12)),
>           GC_malloc(12), GC_malloc(12), GC_malloc(12),
>           (GC_gcollect(),GC_malloc(12)),
>           GC_malloc(12), GC_malloc(12), GC_malloc(12),
>           (GC_gcollect(),GC_malloc(12)),
>           GC_malloc(12), GC_malloc(12), GC_malloc(12),
>           (GC_gcollect(),GC_malloc(12)),
>           (void *)0);
> 
> My debug results follow (see end) - I've inserted the '(collects)' 
> where I assumed they were occurring.
> 
> The same address appears at q[3] as was in q[1]. So presumably a 
> collect occurred allowing the same pointer that was 
> previously returned 
> for the q[1] malloc to be reclaimed and returned again to satisy the 
> q[3] malloc, correct?
> 
> What does this indicate in terms of GC_(generic_)push_regs not being 
> correctly configured given that, in this case, the generic 
> one is being 
> used? To me it says that the pointers malloc'ed and passed to a 
> function should not be collected until the function has been 
> called and 
> subsequently returned, so those pointers passed (potentially in 
> registers) need to be marked so as to prevent them being reclaimed.
> 
> Is this entirely the responsibility of GC_(generic_)push_regs or are 
> other parts of the GC involved (maybe related to GC_stackbottom)?
> 
> ===================
> Uniq() test output:
> 
> q[0] = 0x80040fdff0
> q[1] = 0x80040fdfe0
> q[2] = 0x80040fdfd0
> (collect)
> q[3] = 0x80040fdfe0
> q[4] = 0x80040fdfc0
> q[5] = 0x80040fdfb0
> q[6] = 0x80040fdfa0
> (collect)
> q[7] = 0x80040fdff0
> q[8] = 0x80040fdfd0
> q[9] = 0x80040fdfc0
> q[10] = 0x80040fdfb0
> (collect)
> q[11] = 0x80040fdfe0
> q[12] = 0x80040fdfd0
> q[13] = 0x80040fdfc0
> q[14] = 0x80040fdfa0
> (collect)
> q[15] = 0x80040fdff0
> q[16] = 0x80040fdfd0
> q[17] = 0x80040fdfc0
> q[18] = 0x80040fdfb0
> (collect)
> q[19] = 0x80040fdfe0
> n = 20
> 
> i = 0,
> 
> i = 1,
> j = 0, q[1] = 0x80040fdfe0, q[0] = 0x80040fdff0
> 
> i = 2,
> j = 0, q[2] = 0x80040fdfd0, q[0] = 0x80040fdff0
> j = 1, q[2] = 0x80040fdfd0, q[1] = 0x80040fdfe0
> 
> i = 3,
> j = 0, q[3] = 0x80040fdfe0, q[0] = 0x80040fdff0
> j = 1, q[3] = 0x80040fdfe0, q[1] = 0x80040fdfe0
> 
> Apparently failed to mark form some function arguments.
> Perhaps GC_push_regs was configured incorrectly?
> 
> 
> Regards,
> Peter Colson.
> 
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 


More information about the Gc mailing list