harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Salikh Zakirov <Salikh.Zaki...@Intel.com>
Subject Re: [testing][drlvm] smoke test gc.WeakReferenceTest failed today on winXP
Date Wed, 07 Feb 2007 13:30:17 GMT
Gregory Shimansky wrote:
> Elena Semukhina wrote:
>> I managed to reproduce the failure on my Windows XP laptop. W'd
>> suggest that
>> we change the test so that it waits a little after gc() as Pavel pointed
>> out.
> 
> Spec says in [1] that
> 
> -------------------
> Some time after the garbage collector determines that the reachability
> of the referent has changed to the value corresponding to the type of
> the reference, it will add the reference to the associated queue. At
> this point, the reference is considered to be enqueued.
> -------------------
> 
> The problem is with defining "some time". If spec says nothing about how
> much time later the reference is enqueued, then it is not possible to
> test such event consistently. I am afraid this test is simply incorrect
> and cannot be used.
> 
> [1]
> http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/package-summary.html

I would suggest defining "some time" as a call to System.runFinalization().
It's specification does not mention weak references at all, but it is highly
likely that finalization subsystem is coupled with weak references handling,
so expectation of references being enqueued together with finalization
is not ungrounded.
At least on DRLVM, this should work.

And again, if the references wasn't enqueued after

    System.gc(); System.runFinalization();

on DRLVM, then it would look like a real bug.


Mime
View raw message