Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 72055 invoked from network); 8 Dec 2006 12:15:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2006 12:15:45 -0000 Received: (qmail 40720 invoked by uid 500); 8 Dec 2006 12:15:53 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 40693 invoked by uid 500); 8 Dec 2006 12:15:53 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 40684 invoked by uid 99); 8 Dec 2006 12:15:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Dec 2006 04:15:53 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Dec 2006 04:15:43 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BAA117142FD for ; Fri, 8 Dec 2006 04:15:23 -0800 (PST) Message-ID: <32694769.1165580123761.JavaMail.jira@brutus> Date: Fri, 8 Dec 2006 04:15:23 -0800 (PST) From: "Ruslan Scherbakov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2541) [drlvm][jvmti] VM in OPT mode returns NULL values by GetThreadInfo if java.lang.Thread is instrumented by profiler In-Reply-To: <12044834.1165580001067.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/HARMONY-2541?page=all ] Ruslan Scherbakov updated HARMONY-2541: --------------------------------------- Attachment: JVMTI_GetThreadInfoTest.zip The test case to reproduce has been attached. > [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 > Attachments: JVMTI_GetThreadInfoTest.zip > > > 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 > GetThreadInfo... > 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