You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrey Pavlenko (JIRA)" <ji...@apache.org> on 2007/10/17 10:51:50 UTC

[jira] Assigned: (HARMONY-4867) [drlvm][gc] System.runFinalization() returns before finishing finalization

     [ https://issues.apache.org/jira/browse/HARMONY-4867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrey Pavlenko reassigned HARMONY-4867:
----------------------------------------

    Assignee: Andrey Pavlenko

> [drlvm][gc] System.runFinalization() returns before finishing finalization
> --------------------------------------------------------------------------
>
>                 Key: HARMONY-4867
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4867
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Andrey Pavlenko
>            Assignee: Andrey Pavlenko
>
> I'm not sure if it's a bug or incorrect test, but it causes an intermittent failure of the functional test functional.org.apache.harmony.test.func.reg.vm.btest6572. As I can see GC invokes the method Finalizator.finalize(), but it returns control before the method is finished.
> See the following reproducer:
> public class Test {
> 	public static void main(String[] args) throws Exception {
> 		new Finalizator();
> 		System.gc();
> 		System.runFinalization();
> 		synchronized (Finalizator.LockObj) {
> 			if (Finalizator.finalized) {
> 				System.out.println("PASSED");
> 			} else {
> 				System.out.println("FAILED: " + Finalizator.b);
> 			}
> 		}
> 	}
> 	static class Finalizator {
> 		static Object LockObj = new Object();
> 		static boolean finalized = false;
> 		static boolean b;
> 		protected void finalize() throws Throwable {
> 			b = true;
> 			System.runFinalization();
> 			synchronized (LockObj) {
> 				finalized = true;
> 			}
> 		}
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.