You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Varlamov (JIRA)" <ji...@apache.org> on 2007/03/01 14:49:51 UTC

[jira] Resolved: (HARMONY-2644) [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable

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

Alexey Varlamov resolved HARMONY-2644.
--------------------------------------

    Resolution: Fixed

Vera,
the patch you suggested broke few pre-commit tests, due to the following:
1) in vm/vmcore/src/kernel_classes/javasrc/java/lang/ClassLoader.java
-                try {
-                    clazz = parentClassLoader.loadClass(name);
-                } catch (ClassNotFoundException e) {
-                }
+                clazz = parentClassLoader.loadClass(name);
This violates delegation model, "this" classloader never got a chance to findClass until parent is bootstrap loader;
2) The TLS flag is only reset if class is actually found and successfully defined. So if e.g. it's classdata is corrupt the flag still indicates that classloading should continue and ClassFormatError is reset, this is invalid behavior.

I fixed all of the above problems and brushed related api2vm functions, integrated to SVN at r513313.
Please verify.

> [drlvm][kernel natives] bootclasspath's class loading failure produces wrong throwable
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2644
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2644
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Beliaev
>         Assigned To: Alexey Varlamov
>            Priority: Minor
>         Attachments: add_thread_local_flag_20070222.patch, cloading.diff, H2846.patch, Test.java
>
>
> DRLVM throws ClassNotFoundException instead of NoClassDefFoundError if it fails to load class from bootclasspath.
> I did not find the exact place in specification saying it is wrong behavior, still 
> 1. JVMS operates with NoClassDefFoundError only in case the loading process failed. 
> 2. both Sun & JRockit java throws NoClassDefFoundError from the test below.
> To reproduce the issue, please do the following:
> a) compile attached Test.java (this produces Test.class, SubClass.class and SuperClass.class)
> b) remove SuperClass.class 
> c) run test with SubClass in bootclasspath, e.g.
>   
>     $ ls -1 *.class
>     Test.class SubClass.class
>     $ java -Xbootclasspath/a:. Test
> The output on Reference Implementation:
>     PASSED: got NoClassDefFoundError...
>     Note: run Test with SubClass in bootclasspath...
> The output on Harmony DRLVM (with -showversion key):
>     Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
>     java version "1.5.0" 
>     pre-alpha : not complete or compatible
>     svn = r486063, (Dec 12 2006), Windows/ia32/msvc 1310, debug build
>     http://incubator.apache.org/harmony
>     FAILED: got ClassNotFoundException...
> Thanks
> Vladimir

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