harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruslan Scherbakov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2541) [drlvm][jvmti] VM in OPT mode returns NULL values by GetThreadInfo if java.lang.Thread is instrumented by profiler
Date Fri, 08 Dec 2006 12:13:21 GMT
[drlvm][jvmti] VM in OPT mode returns NULL values by GetThreadInfo if java.lang.Thread is instrumented
by profiler

                 Key: HARMONY-2541
                 URL: http://issues.apache.org/jira/browse/HARMONY-2541
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Windows/ia32, Linux/ia32
            Reporter: Ruslan Scherbakov

TPTP profiler crashes if it is run under DRLVM with -Xem:opt parameter. Debug shows that in

JVMTI Thread Start callback()
    if (phase is not LIVE) return;
    jvmtiThreadInfo threadInfo;
    result = pJvmtiEnv->GetThreadInfo(thread, &threadInfo);

result is OK (=JVMTI_ERROR_NONE) but all values in threadInfo are NULL which causes crash
in the profiler which relies upon threadInfo.name, etc.

The attached test case simulates simplified profiler's behavior: ThreadStart->GetThreadInfo.
The instrumented Thread class (taken from the test case in HARMONY-2306) replaces existing
one in class file load hook.

Below is an output from the test. It shows that there is a problem with linking VM in OPT
mode with CGProxy. Note that the native methods of CGProxy were registered and called several
times before failure. The same test works fine when DRLVM is in Xint or JET modes.

4. run with class instrumented by JVMTI agent (-Xem:opt)
Agent_OnLoad: pVM=010020A0, options=proxy
Agent_OnLoad: OK
ClassFileLoadHookHandler: Replacing class: java/lang/Thread
Loaded instrumented bytecode from file: 19119 bytes
ThreadStart: thread=0253C578, pJniEnv=0253D900
VMInit: register native callbacks
RegisterNativeCallbacks: register for class: org/eclipse/tptp/martini/CGProxy
RegisterNativeCallbacks: done
ThreadStart: thread=02527DB8, pJniEnv=01057C48
MethodEnterHandler: Invoked=0, id=65794
MethodLeaveHandler: id=65794
MethodEnterHandler: Invoked=0, id=65795
MethodLeaveHandler: id=65795
MethodEnterHandler: Invoked=0, id=65801
MethodLeaveHandler: id=65801
MethodEnterHandler: Invoked=0, id=65797
MethodLeaveHandler: id=65797
MethodEnterHandler: Invoked=0, id=65793
MethodLeaveHandler: id=65793
    Thread: 'main', pri=5, daemon=0, group=025418A4
MethodEnterHandler: Invoked=0, id=65814
MethodEnterHandler: Invoked=0, id=65822
MethodEnterHandler: Invoked=1, id=65797
MethodLeaveHandler: id=65797
MethodLeaveHandler: id=65822
MethodEnterHandler: Invoked=0, id=65820
MethodLeaveHandler: id=65820
MethodEnterHandler: Invoked=1, id=65794
MethodLeaveHandler: id=65794
Uncaught exception in main:
java.lang.UnsatisfiedLinkError: org/eclipse/tptp/martini/CGProxy.MethodEnter(ZI)V
        at org.eclipse.tptp.martini.CGProxy.EarlyMethodEnter(CGProxy.java)
        at java.lang.Thread.currentThread(Unknown Source)
        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)
MethodLeaveHandler: id=65814
FAILED to invoke JVM.

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


View raw message