You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vladimir Ivanov (JIRA)" <ji...@apache.org> on 2006/08/11 06:00:14 UTC

[jira] Created: (HARMONY-1147) [classlib][security] Harmony+j9 throws NPE while Harmony+drlvm and RI throws IndexOutOfBoundsException for SecureClassLoader.defineClass()

[classlib][security] Harmony+j9 throws NPE while Harmony+drlvm and RI throws IndexOutOfBoundsException  for SecureClassLoader.defineClass()
-------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1147
                 URL: http://issues.apache.org/jira/browse/HARMONY-1147
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Vladimir Ivanov


Harmony+j9 throws NPE for SecureClassLoader.defineClass(..) while Harmony+drlvm and RI throws IndexOutOfBoundsException.

==================== test.java =====================
import java.net.URL;
import java.security.*;

public class test {
    public static void main(String args[]) {
        try {
            CodeSource lcs = new CodeSource(new URL(new URL("http://www.intel.com"), "0"), new CodeSigner[192]);
            new CL().test1((String) null, new byte[]{2,2}, 0, 127, lcs);
        } catch (Exception e) {
            System.out.println("exception: " + e);
        }
    }
}
class CL extends SecureClassLoader {
    CL(){ super(); }
    public int test1 (String name, byte[] array, int off, int len, CodeSource cs) {
        try{
            defineClass(name, array, off, len, cs);
        } catch(Exception e) {
            e.printStackTrace();
        }
        return 0;
    }
}
================================================

Output:
C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp . -showversion test
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))

java.lang.ArrayIndexOutOfBoundsException
        at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at CL.test1(test.java:18)
        at test.main(test.java:8)

C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp . -showversion test
java version 1.5 (subset)

(c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
java.lang.NullPointerException
        at java.security.CodeSource.getCertificatesNoClone(CodeSource.java:170)
        at java.security.CodeSource.getCertificates(CodeSource.java:145)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:238)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:68)
        at CL.test1(test.java:18)
        at test.main(test.java:8)

C:\tmp\tmp17>C:\harmony\drlvm1.5\build\win_ia32_msvc_debug\deploy\jre\bin\java -Dvm.assert_dialog=false -cp . -showversion test
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r430209, (Aug 10 2006), Windows/ia32/msvc 1310, debug build
http://incubator.apache.org/harmony
java.lang.IndexOutOfBoundsException: Check your arguments
        at java.lang.ClassLoader.defineClass()
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:68)
        at CL.test1(test.java:18)
        at test.main(test.java:8)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1147) [classlib][security] Harmony+j9 throws NPE while Harmony+drlvm and RI throws IndexOutOfBoundsException for SecureClassLoader.defineClass()

Posted by "Boris Kuznetsov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1147?page=comments#action_12431862 ] 
            
Boris Kuznetsov commented on HARMONY-1147:
------------------------------------------

Looks like IBM VM's implementation of java.lang.ClassLoader.defineClass() behaves differently (see stack trace)

> [classlib][security] Harmony+j9 throws NPE while Harmony+drlvm and RI throws IndexOutOfBoundsException  for SecureClassLoader.defineClass()
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1147
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1147
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vladimir Ivanov
>
> Harmony+j9 throws NPE for SecureClassLoader.defineClass(..) while Harmony+drlvm and RI throws IndexOutOfBoundsException.
> ==================== test.java =====================
> import java.net.URL;
> import java.security.*;
> public class test {
>     public static void main(String args[]) {
>         try {
>             CodeSource lcs = new CodeSource(new URL(new URL("http://www.intel.com"), "0"), new CodeSigner[192]);
>             new CL().test1((String) null, new byte[]{2,2}, 0, 127, lcs);
>         } catch (Exception e) {
>             System.out.println("exception: " + e);
>         }
>     }
> }
> class CL extends SecureClassLoader {
>     CL(){ super(); }
>     public int test1 (String name, byte[] array, int off, int len, CodeSource cs) {
>         try{
>             defineClass(name, array, off, len, cs);
>         } catch(Exception e) {
>             e.printStackTrace();
>         }
>         return 0;
>     }
> }
> ================================================
> Output:
> C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp . -showversion test
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
> java.lang.ArrayIndexOutOfBoundsException
>         at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source)
>         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>         at CL.test1(test.java:18)
>         at test.main(test.java:8)
> C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp . -showversion test
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java.lang.NullPointerException
>         at java.security.CodeSource.getCertificatesNoClone(CodeSource.java:170)
>         at java.security.CodeSource.getCertificates(CodeSource.java:145)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:238)
>         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:68)
>         at CL.test1(test.java:18)
>         at test.main(test.java:8)
> C:\tmp\tmp17>C:\harmony\drlvm1.5\build\win_ia32_msvc_debug\deploy\jre\bin\java -Dvm.assert_dialog=false -cp . -showversion test
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r430209, (Aug 10 2006), Windows/ia32/msvc 1310, debug build
> http://incubator.apache.org/harmony
> java.lang.IndexOutOfBoundsException: Check your arguments
>         at java.lang.ClassLoader.defineClass()
>         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:68)
>         at CL.test1(test.java:18)
>         at test.main(test.java:8)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-1147) [classlib][kernel] Harmony+j9 throws NPE while Harmony+drlvm and RI throws IndexOutOfBoundsException for SecureClassLoader.defineClass()

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1147?page=all ]

Mikhail Loenko updated HARMONY-1147:
------------------------------------

    Summary: [classlib][kernel] Harmony+j9 throws NPE while Harmony+drlvm and RI throws IndexOutOfBoundsException  for SecureClassLoader.defineClass()  (was: [classlib][security] Harmony+j9 throws NPE while Harmony+drlvm and RI throws IndexOutOfBoundsException  for SecureClassLoader.defineClass())

changed name to reflect sub-component

> [classlib][kernel] Harmony+j9 throws NPE while Harmony+drlvm and RI throws IndexOutOfBoundsException  for SecureClassLoader.defineClass()
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1147
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1147
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vladimir Ivanov
>
> Harmony+j9 throws NPE for SecureClassLoader.defineClass(..) while Harmony+drlvm and RI throws IndexOutOfBoundsException.
> ==================== test.java =====================
> import java.net.URL;
> import java.security.*;
> public class test {
>     public static void main(String args[]) {
>         try {
>             CodeSource lcs = new CodeSource(new URL(new URL("http://www.intel.com"), "0"), new CodeSigner[192]);
>             new CL().test1((String) null, new byte[]{2,2}, 0, 127, lcs);
>         } catch (Exception e) {
>             System.out.println("exception: " + e);
>         }
>     }
> }
> class CL extends SecureClassLoader {
>     CL(){ super(); }
>     public int test1 (String name, byte[] array, int off, int len, CodeSource cs) {
>         try{
>             defineClass(name, array, off, len, cs);
>         } catch(Exception e) {
>             e.printStackTrace();
>         }
>         return 0;
>     }
> }
> ================================================
> Output:
> C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp . -showversion test
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
> java.lang.ArrayIndexOutOfBoundsException
>         at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source)
>         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>         at CL.test1(test.java:18)
>         at test.main(test.java:8)
> C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp . -showversion test
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java.lang.NullPointerException
>         at java.security.CodeSource.getCertificatesNoClone(CodeSource.java:170)
>         at java.security.CodeSource.getCertificates(CodeSource.java:145)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:238)
>         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:68)
>         at CL.test1(test.java:18)
>         at test.main(test.java:8)
> C:\tmp\tmp17>C:\harmony\drlvm1.5\build\win_ia32_msvc_debug\deploy\jre\bin\java -Dvm.assert_dialog=false -cp . -showversion test
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r430209, (Aug 10 2006), Windows/ia32/msvc 1310, debug build
> http://incubator.apache.org/harmony
> java.lang.IndexOutOfBoundsException: Check your arguments
>         at java.lang.ClassLoader.defineClass()
>         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:68)
>         at CL.test1(test.java:18)
>         at test.main(test.java:8)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira