Community
Participate
Working Groups
Build ID: M20060921-0945 Steps To Reproduce: 1. Install TPTP profiler 4.3.0 and New Java Profiler 2. Get Harmony JRE snapshot from http://harmony.apache.org 3. Set up New Agent Controller to use Harmony JRE 4. Run Eclipse and create HelloWorld application 5. Start profiling HelloWorld and choose Execution Time Analysis 6. See VerifyError exception dump appeared in output console More information: Harmony JVM rejects HelloWorld class instrumented by TPTP JVMTI profiler and throws VerifyError exception: Uncaught exception in main: java.lang.VerifyError: (class: HelloWorld, method: <init>()V) Uninitialized reference usage at java.lang.VMClassRegistry.defineClass(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:70) at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1137) at java.net.URLClassLoader$4.run(URLClassLoader.java:619) at java.net.URLClassLoader$4.run(URLClassLoader.java:1) at java.security.AccessController.doPrivilegedImpl(Unknown Source) at java.security.AccessController.doPrivileged(Unknown Source) at java.net.URLClassLoader.findClass(URLClassLoader.java:621) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader$SystemClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) FAILED to invoke JVM. It looks like that Martini CG instrumentation is incorrect, though it is accepted by Sun and JRockit JRE. Below is explanation from Harmony developers. ----------------------------------------------------- According Java Specification 1.5 Chapter 4.11.1.1: “There is never an uninitialized class instance in a local variable in code protected by an exception handler.” There is a disassembler of instrumented class: Method name:"<init>" public Signature: 6=()void Attribute "Code", length:95, max_stack:2, max_locals:1, code_length:45 0: getstatic #41=<Field mytests.HelloWorld.sm_bAlreadyInvoked70056 boolean> 3: ldc_w #62=<Integer 70056> 6: invokestatic #53=<Method org.eclipse.tptp.martini.CGProxy.MethodEnter (boolean,int)void> 9: getstatic #41=<Field mytests.HelloWorld.sm_bAlreadyInvoked70056 boolean> 12: ifne 19 15: iconst_1 16: putstatic #41=<Field mytests.HelloWorld.sm_bAlreadyInvoked70056 boolean> 19: aload_0 20: invokespecial #8=<Method java.lang.Object.<init> ()void> 23: goto_w 28 28: nop 29: ldc_w #62=<Integer 70056> 32: invokestatic #57=<Method org.eclipse.tptp.martini.CGProxy.MethodLeave (int)void> 35: nop 36: return 37: ldc_w #62=<Integer 70056> 40: invokestatic #57=<Method org.eclipse.tptp.martini.CGProxy.MethodLeave (int)void> 43: nop 44: athrow Exceptions (count: 1): start: 19, end: 29, handler: 37, type: 0 /* finally */ Attribute "LineNumberTable", length:6, count: 1 line: 3 at pc: 19 Attribute "LocalVariableTable", length:12, count: 1 slot#0: name: 12=this, type: 13=mytests.HelloWorld (pc: 19 length: 26) As you can see try block protects a class constructor. Uninitialized reference of class is contained in local variables on this basic block. Why reference VM doesn’t reject such class, this is a question of investigation. And I could take some time. I suggest several ways to complete test run: 1. Change classes instrumentation to correct one. 2. Disable verifier and repeat TPTP tests run. To disable verifier VM need to give an option in command line: -XDvm.use_verifier=false. -----------------------------------------------------
I have confirmed this to be an issue with the Martini Call Graph instrumentation adaptor.
Verifier in Harmony JVM was updated to follow RI behavior and don't reject those classes which are accepted by RI. Now, the current implementation of TPTP JVMTI profiler works with Harmony as well.
Based on the latest Harmony test results, I recommend to lower the priority of this bug. Retargetting to future.
We found that this issue must be resolved, otherwise the Java 6 verifier will reject instrumented constructors. Adding dependency on the Java 6 support enhancement and targeting for 4.5.i7
In plan for 4.5.i7, pending check-in of Java 6 support (bug 148629)
Created attachment 98566 [details] Test Case
Deferral to future with PMC approval
cleaning up assignees
Mass update of P1 enhancements and defects targetted to future to P2.
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. Since this defect is more than 2 years old, it may be no longer relevant. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this defect is resolved as WONTFIX. If this defect is still relevant and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.