[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR 8135188: RunFinalizationTest.java Exception java.lang.Error: Test failure: Object was not fi
From:       "Daniel D. Daugherty" <daniel.daugherty () oracle ! com>
Date:       2015-10-15 13:12:24
Message-ID: 561FA638.3080309 () oracle ! com
[Download RAW message or body]

On 10/15/15, 12:12 AM, Jaroslav Bachorik wrote:
> On 15.10.2015 00:24, Martin Buchholz wrote:
>> Looks good, but cant-stop-nitpicking Martin feels compelled to point out
>> the typo here:
>>
>>    71     // his instance will be used to perform the 
>> GC.run_finalization test
>
> Hopefully, it is not necessary to repost the updated webrev. Or is it?

Not necessary for me.

Dan


>
> -JB-
>
>>
>>
>>
>> On Tue, Oct 13, 2015 at 11:47 PM, Jaroslav Bachorik
>> <jaroslav.bachorik@oracle.com <mailto:jaroslav.bachorik@oracle.com>> 
>> wrote:
>>
>>     On 13.10.2015 <tel:13.10.2015> 20:12, Martin Buchholz wrote:
>>
>>         blockFinalizerThread looks buggy to me.
>>
>>            103     private static void blockFinalizerThread() throws
>>         InterruptedException {
>>            104         System.out.println("trying to block the finalizer
>>         thread");
>>            105         o1 = new MyObject();
>>            106         o1 = null;
>>            107         System.gc();
>>            108         System.runFinalization();
>>            109         finRunLatch.await();
>>            110     }
>>         Why are you calling System.runFinalization() ?  You are trying
>>         to block
>>         the primary finalizer thread; you definitely don't want the
>>         object to be
>>         handled by the secondary finalizer thread.
>>
>>
>>     Indeed. Even though this seems unlikely (didn't hit the problem in
>>     500 repetitions) it will be better not to call
>>     System.runFinalization() and just let System.gc() do its job
>>     finalizing the collected instance.
>>
>>
>>         ---
>>
>>             51             } else {
>>             52                 System.out.println("finalizing the test
>>         instance");
>>         I would check :
>>
>>         else if (Thread.currentThread().getName().equals("Secondary
>>         finalizer")) {
>>             ....
>>         else fail(unexpected finalizer thread name)
>>
>>
>>     If this ever happens it would mean that the finalizer logic has been
>>     changed. Adding this check will make the test fail in such case and
>>     force re-examination of the test logic. Sounds fair.
>>
>>     http://cr.openjdk.java.net/~jbachorik/8135188/webrev.04
>>
>>     Thanks!
>>
>>     -JB-
>>
>>
>>
>>
>>
>
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic