[Gc] Re[5]: [bdwgc] Add disclaim callback and a "finalized" object kind (#5)

Ivan Maidanski ivmai at mail.ru
Tue Apr 10 13:29:49 PDT 2012


Hi Petter,

Tue, 10 Apr 2012 19:31:43 +0200 Petter Urkedal <urkedal at nbi.dk>:
> On 2012-04-10, Ivan Maidanski wrote:
> > Hi Petter,
> > 
> > There's a bug in Disclaim functionality. I've improved disclaim_test to detect the bug. Please fix it.
> > I put it temporarily to another branch (to prevent master break) - https://github.com/ivmai/bdwgc/compare/disclaim-test-add
> > 
> > Thanks.
> 
> Hi Ivan,
> 
> I can't reproduce this.

I guess you tried on x64

>  I guess it's the new
> 
>     my_assert(log_size < sizeof(size_t) * 8);

yes.

> 
> which fails?  Which configure options to you use?

It fails with any option I tried.
Test environments: cygwin, ubuntu/x86, darwin/arm, android/arm.

In fact, arm targets fail even without the added assertion - because of different behavior of shift (the left operand is multiple to 32, x86 returns 1, arm return 0 in that case, thus size-1 is UINT_MAX). 

>  Also, could you check
> the GC_size and dump the first bytes from "obj" to see if the object is
> trashed or if it's just the first byte or word?

Brief debugging showed that GC_disclaim_and_reclaim_or_free_small_block -> GC_disclaim_and_reclaim calls (at some moment) (*disclaim)(p) with p not returned by GC_finalized_malloc.

> 
> Petter

Regards.



More information about the Gc mailing list