You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vasily Zakharov (JIRA)" <ji...@apache.org> on 2007/04/12 21:12:15 UTC

[jira] Commented: (HARMONY-3601) [classlib][awt][drlvm][netbeans] ToolkitImpl.createImage() throws RTE: Not owner can't unlock resource

    [ https://issues.apache.org/jira/browse/HARMONY-3601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488478 ] 

Vasily Zakharov commented on HARMONY-3601:
------------------------------------------

Thanks Andrey, the patch resolves the problem.

However, I receive somewhat 80 test failures and 500 errors on IBM VM with this patch applied. It looks like the problem is the patch uses Concurrent package, that doesn't work with IBM VM. I've started a discussion on this topic in the dev list: http://thread.gmane.org/gmane.comp.java.harmony.devel/25776

Also there's a suspicion that AWT code is in fact correct and the problem lies completely in DRL VM, see HARMONY-3641.

Let's wait until the discussion comes to some conclusion and HARMONY-3641 is resolved, and then decide how to deal with this issue.

Thank you!


> [classlib][awt][drlvm][netbeans] ToolkitImpl.createImage() throws RTE: Not owner can't unlock resource
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3601
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3601
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib, DRLVM
>            Reporter: Vasily Zakharov
>         Attachments: HARMONY-3601-Synchronizer.patch, HARMONY-3601-SynchronizerTest.patch
>
>
> The following test calls java.awt.Toolkit.getDefaultToolkit().createImage() simultaneously from multiple threads:
> public class Test {
>     static final int NUM_THREADS = 5;
>     static boolean success = true;
>     public static void main(String args[]) throws Exception {
>         Thread[] threads = new Thread[NUM_THREADS];
>         for (int i = 0; i < NUM_THREADS; i++) {
>             threads[i] = new Thread() {
>                 public void run() {
>                     try {
>                         java.awt.Toolkit.getDefaultToolkit().createImage(new java.net.URL("file://any/thing"));
>                     } catch (Exception e) {
>                         System.out.print("ERROR at " + Thread.currentThread() + ": ");
>                         e.printStackTrace();
>                         success = false;
>                     }
>                 }
>             };
>         }
>         for (int i = 0; i < NUM_THREADS; i++) {
>             threads[i].start();
>         }
>         for (int i = 0; i < NUM_THREADS; i++) {
>             while (true) {
>                 try {
>                     threads[i].join();
>                     break;
>                 } catch (InterruptedException e) {
>                     // Ignore.
>                 }
>             }
>         }
>         System.out.println(success ? "SUCCESS" : "FAIL");
>     }
> }
> Output on RI:
> SUCCESS
> Output on Harmony/IBM VM:
> SUCCESS:
> Output on Harmony/DRL VM (both Jit and Interpreter):
> ERROR at Thread[Thread-8,5,main]: java.lang.RuntimeException: Not owner can't unlock resource
>         at org.apache.harmony.awt.wtk.Synchronizer.unlock(Synchronizer.java:120)
>         at java.awt.Toolkit.unlockAWT(Toolkit.java:399)
>         at java.awt.ToolkitImpl.createImage(ToolkitImpl.java:104)
>         at TestUnlock$1.run(TestUnlock.java:14)
> ERROR at Thread[Thread-7,5,main]: java.lang.RuntimeException: Not owner can't unlock resource
>         at org.apache.harmony.awt.wtk.Synchronizer.unlock(Synchronizer.java:120)
>         at java.awt.Toolkit.unlockAWT(Toolkit.java:399)
>         at java.awt.ToolkitImpl.createImage(ToolkitImpl.java:104)
>         at TestUnlock$1.run(TestUnlock.java:14)
> ERROR at Thread[Thread-6,5,main]: java.lang.RuntimeException: Not owner can't unlock resource
>         at org.apache.harmony.awt.wtk.Synchronizer.unlock(Synchronizer.java:120)
>         at java.awt.Toolkit.unlockAWT(Toolkit.java:399)
>         at java.awt.ToolkitImpl.createImage(ToolkitImpl.java:104)
>         at TestUnlock$1.run(TestUnlock.java:14)
> FAIL
> The problem only occurs on DRL VM, but I'm not sure whether this is a DRL VM or AWT issue, and I have no idea how to fix it.
> The problem was discovered while trying to run Netbeans on Harmony.

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