Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 46600 invoked from network); 7 Feb 2007 13:31:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2007 13:31:37 -0000 Received: (qmail 61441 invoked by uid 500); 7 Feb 2007 13:31:31 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 61400 invoked by uid 500); 7 Feb 2007 13:31:31 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 61374 invoked by uid 99); 7 Feb 2007 13:31:31 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Feb 2007 05:31:31 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of gcjhd-harmony-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Feb 2007 05:31:18 -0800 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HEmsn-0006Va-4s for dev@harmony.apache.org; Wed, 07 Feb 2007 14:30:45 +0100 Received: from msfwpr01.ims.intel.com ([62.118.80.132]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Feb 2007 14:30:45 +0100 Received: from Salikh.Zakirov by msfwpr01.ims.intel.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Feb 2007 14:30:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: dev@harmony.apache.org From: Salikh Zakirov Subject: Re: [testing][drlvm] smoke test gc.WeakReferenceTest failed today on winXP Date: Wed, 07 Feb 2007 16:30:17 +0300 Lines: 36 Message-ID: References: <7273946b0701290108o28a4dbd2vfe3d5b2b669b82d7@mail.gmail.com> <7273946b0701300034jda18a70me6fafc1be08a6118@mail.gmail.com> <783bf8b0701300658u641bdf60vda87194b53c45119@mail.gmail.com> <783bf8b0701300729i5cb5f306x80eb49c9c64cf6df@mail.gmail.com> <7273946b0701310321w5ae5579fib5fbcfab009f2275@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: msfwpr01.ims.intel.com User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) In-Reply-To: Sender: news X-Virus-Checked: Checked by ClamAV on apache.org 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.