You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Werner Froidevaux (JIRA)" <ji...@apache.org> on 2010/08/19 16:40:19 UTC

[jira] Created: (HARMONY-6628) Deadlock in getProxyClass()

Deadlock in getProxyClass()
---------------------------

                 Key: HARMONY-6628
                 URL: https://issues.apache.org/jira/browse/HARMONY-6628
             Project: Harmony
          Issue Type: Bug
          Components: JDK
    Affects Versions: 5.0M14
         Environment: harmony-5.0-jdk-946978/
harmony-6.0-jdk-946981/
Linux-32
Eclipse 3.5
            Reporter: Werner Froidevaux
            Priority: Blocker


In certain situations the method java.lang.reflect.Proxy.getProxyClass() produces a deadlock. This seems always to be the case when getProxyClass() is called recursively by defineClassImpl().

public static Class<?> getProxyClass(
  ClassLoader loader,
  Class<?>[] interfaces
) throws IllegalArgumentException {
    ...
    synchronized (loaderCache) {
        ...
        newClass = defineClassImpl(loader, ...);
        ...
    }
}

When the native method recursively invokes getClassImpl() (via newProxyInstance()) the VM is locked at synchronized (loaderCache). Because I only have one thread (Main) a deadlock must never occur. 

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


[jira] Updated: (HARMONY-6628) Deadlock in getProxyClass()

Posted by "Werner Froidevaux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Werner Froidevaux updated HARMONY-6628:
---------------------------------------

    Attachment: TestProxy.java

I have attached a JUnit which blocks at in Proxy.getProxyClass() at line 'synchronized (loaderCache)'.

> Deadlock in getProxyClass()
> ---------------------------
>
>                 Key: HARMONY-6628
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6628
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>    Affects Versions: 5.0M14
>         Environment: harmony-5.0-jdk-946978/
> harmony-6.0-jdk-946981/
> Linux-32
> Eclipse 3.5
>            Reporter: Werner Froidevaux
>            Priority: Blocker
>         Attachments: TestProxy.java
>
>
> In certain situations the method java.lang.reflect.Proxy.getProxyClass() produces a deadlock. This seems always to be the case when getProxyClass() is called recursively by defineClassImpl().
> public static Class<?> getProxyClass(
>   ClassLoader loader,
>   Class<?>[] interfaces
> ) throws IllegalArgumentException {
>     ...
>     synchronized (loaderCache) {
>         ...
>         newClass = defineClassImpl(loader, ...);
>         ...
>     }
> }
> When the native method recursively invokes getClassImpl() (via newProxyInstance()) the VM is locked at synchronized (loaderCache). Because I only have one thread (Main) a deadlock must never occur. 

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


[jira] Commented: (HARMONY-6628) Deadlock in getProxyClass()

Posted by "Jonathan Lu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12901772#action_12901772 ] 

Jonathan Lu commented on HARMONY-6628:
--------------------------------------

Hi Werner,
I think a test case would better depict your issue. Can you recreate the problem?

> Deadlock in getProxyClass()
> ---------------------------
>
>                 Key: HARMONY-6628
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6628
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>    Affects Versions: 5.0M14
>         Environment: harmony-5.0-jdk-946978/
> harmony-6.0-jdk-946981/
> Linux-32
> Eclipse 3.5
>            Reporter: Werner Froidevaux
>            Priority: Blocker
>
> In certain situations the method java.lang.reflect.Proxy.getProxyClass() produces a deadlock. This seems always to be the case when getProxyClass() is called recursively by defineClassImpl().
> public static Class<?> getProxyClass(
>   ClassLoader loader,
>   Class<?>[] interfaces
> ) throws IllegalArgumentException {
>     ...
>     synchronized (loaderCache) {
>         ...
>         newClass = defineClassImpl(loader, ...);
>         ...
>     }
> }
> When the native method recursively invokes getClassImpl() (via newProxyInstance()) the VM is locked at synchronized (loaderCache). Because I only have one thread (Main) a deadlock must never occur. 

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