harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Choonghwan Lee (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6523) [jvmti] GetTag() on the return_value of MethodExit handler returns JVMTI_ERROR_INVALID_OBJECT
Date Mon, 24 May 2010 21:14:23 GMT
[jvmti] GetTag() on the return_value of MethodExit handler returns JVMTI_ERROR_INVALID_OBJECT
---------------------------------------------------------------------------------------------

                 Key: HARMONY-6523
                 URL: https://issues.apache.org/jira/browse/HARMONY-6523
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
    Affects Versions: 5.0M13, 6.0M1
         Environment: Microsoft Windows Server 2008 (32bit) [Version 6.0.6001]
            Reporter: Choonghwan Lee


GetTag(), a JVMTI function, returns JVMTI_ERROR_INVALID_OBJECT when it is invoked for the
return_value of MethodExit handler. I'm sorry not to provide a short program that reproduces
this problem, but here's the description. My program, so-called an agent, attached to java.exe
through JVMTI listens to MethodExit (and several other) events. The MethodExit handler looks
like the following:

static void JNICALL
handle_methodexit(jvmtiEnv *jvmti, JNIEnv *env, jthread thread, jmethodID method, jboolean
was_popped_by_exception, jvalue return_value)
{
  if (!was_popped_by_exception) {
    // analyze the signature of the "method" to figure out the type of the returning value
    if the returning value is of Object type {
      if (return_value.l) {
        dump "return_value.l" (see below)
        jlong tag;
        jvmti->GetTag(obj, &tag); // this returns JVMTI_ERROR_INVALID_OBJECT
      }
    }
  }
}

GetTag() works fine for the first event, but it returns an error at the second event. One
thing I am little bit suspicious is that "return_value.l" of the second event is totally different
than that of the first event.

 * 1st event: 0012F3AC
 * 2nd event: 13AA05F0

Given that jobject is a pointer, that huge difference may mean that one of them may point
a wrong address, although I'm not sure. The second event was raised when loadClass (Ljava/lang/String;Z)Ljava/lang/Class;
of Ljava/lang/ClassLoader; returns. This problem occurs both in 5 and 6.

My agent was compiled using Microsoft Visual Studio 2010 in C++. For this kind of error, I
know that the first thing I need to suspect is my own program, as my program can corrupt the
heap and cause DRLVM to fail. I cannot guarantee that my program is memory error-free, but
it seems fine because my agent didn't introduce any memory-related errors when it was attached
to Sun Java 6. Currently, I stopped using Sun Java 6 because its JVMTI has another problem.


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


Mime
View raw message