harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene S. Ostrovsky (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3532) [drlvm][jvmti] wrong METHOD_EXIT events are generated before VM_DEATH
Date Fri, 20 Apr 2007 10:24:16 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490312

Eugene S. Ostrovsky commented on HARMONY-3532:

The main reason of the bug is that launcher detaches main thread before calling DestroyJavaVM()
DestroyJavaVM() attaches current thread back. First it creates new java.lang.Thread object
and calls its constructor. Constructor execution produces TI events (such as MethodExit) while
current thread is not attached yet. Thus event callbacks are called with incorrect 'thread'

Also There is a bug in getCurrentThread() function (jvmti_stack.cpp). It creates incorrect
local handle in case of null reference.

> [drlvm][jvmti] wrong METHOD_EXIT events are generated before VM_DEATH
> ---------------------------------------------------------------------
>                 Key: HARMONY-3532
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3532
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, DRLVM
>         Environment: Windows/x86, Linux/x86, Harmony-jdk-r524025, Eclipse 3.2
>            Reporter: Ivan Popov
> When debugging HelloWorld application in Eclipse debugger including stopping at method
enter/exit, I noticed error message from JDWP agent printed to Eclipse console:
> Hello
>  INFO: [RequestManager.cpp:1123] JDWP error in METHOD_EXIT: AgentException [10]
>  INFO: [RequestManager.cpp:1123] JDWP error in METHOD_EXIT: AgentException [10]
>  INFO: [RequestManager.cpp:1123] JDWP error in METHOD_EXIT: AgentException [10]
> <...>
> The problem is that JVMTI generates a seria of extra METHOD_EXIT events before VM_DEATH
> I added trace messages to JDWP agent and got the following data for these events:
>  INFO: [RequestManager.cpp:1123] JDWP error in METHOD_EXIT: AgentException [10]
>  GetThreadInfo(): err=10, jthread=029EB710, name=(null)
>  GetMethodName(): err=0, jmethodID=01444688, name=<init>
>  GetMethodDeclaringClass(): err=0, jclass=0012EECC
>  GetClassSignature(): err=0, signature=Ljava/lang/Object;
>  GetFrameLocation(): err=10, jlocation=0
> It seems that METHOD_EXIT events are generated for constructor of j.l.Object in unknown
thread. Attempts to get thread info and stack frames lead to JVMTI error 10 (JVMTI_ERROR_INVALID_THREAD).
> To reproduce this bug, run Eclipse over Harmony JDK and create Java project with the
following class:
> public class HelloWorld {
> 	public static void main(String[] args) {
> 		printHello();
> 	}
> 	public static void printHello() {
> 		System.out.println("Hello");
> 	}
> }
> Then switch to Debug perspective and set Method breakpoint:
>   1. Set cursor to method printHello()
>   2. Click Run->Toggle Method Breakpoint
>   3. Go to Breakpoints view, right click on breakpoint to open popup menu
>   4. Check 'Exit' item to enable stopping at method exit
> Run application in debug mode:
>   1. Click Run->Debug As->Java Application
>   2. After stopped on entry for method printHello(), click 'Resume'
>   3. After stopped on exit for method printHello(), click 'Resume'
> When application finished, see error messages in console view.

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

View raw message