harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregory Shimansky (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-2200) [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler
Date Fri, 22 Jun 2007 13:05:26 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gregory Shimansky closed HARMONY-2200.
--------------------------------------


No response, assuming ok.

> [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2200
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2200
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, DRLVM
>         Environment: Windows/ia32, Linux ia/32
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: H-2200-RegisterNatives-partial-fix.patch, ThreadEventsTest.zip
>
>
> TPTP profiler cannot profile Java applications running on DRLVM in JIT mode (r474672+
HARMONY-2172). VM is crashed while executing dynamically instrumented class. Here is typical
stack trace of the crash on Windows:
> 	0001f8a4()	
>  	ntdll.dll!7c91056d() 	
> >	harmonyvm.dll!free(void * pBlock=0x025ba3f0)  Line 103	C
>  	harmonyvm.dll!GcFrame::~GcFrame()  Line 98 + 0x6	C++
>  	harmonyvm.dll!compile_jit_a_method(Method * method=0x20770fd0)  Line 854 + 0x11	C++
>  	harmonyvm.dll!vm_invoke_native_array_stub(unsigned int * args=, int sz=, void * f=)
 Line 77	C++
> If VM is started in -Xint mode with profiling agent, then it successfully run instrumented
class. Also, if statically instrumented class is loaded into VM in JIT mode without profiling
agent, it works fine. With RI this also works fine in all modes. The crash occurs only in
DRLVM in JIT mode if class is dynamically instrumented by JVMTI agent in CLASS_FILE_LOAD_HOOK.
> Here is test output:
> =========================================================================================
> 1. run initial class
> HELLO.world
> =========================================================================================
> 2. run instrumented class
> HELLO.world
> DLL MethodEnterHandler: Invoked=0, id=70057
> DLL MethodEnterHandler: Invoked=0, id=70056
> DLL MethodLeaveHandler: id=70056
> DLL MethodEnterHandler: Invoked=0, id=70058
> DLL MethodLeaveHandler: id=70058
> DLL MethodLeaveHandler: id=70057
> =========================================================================================
> 3. run initial class WITH agent in -Xint mode
> HELLO.world
> Agent_OnLoad: proxy
> RegisterNativeCallbacks done
> Replacing class: mytests/HelloWorld
> Loaded class from file: 1075
> MethodEnterHandler: Invoked=0, id=70057
> MethodEnterHandler: Invoked=0, id=70056
> MethodLeaveHandler: id=70056
> MethodEnterHandler: Invoked=0, id=70058
> MethodLeaveHandler: id=70058
> MethodLeaveHandler: id=70057
> =========================================================================================
> 4. run initial class WITH agent
> Agent_OnLoad: proxy
> RegisterNativeCallbacks done
> Replacing class: mytests/HelloWorld
> Loaded class from file: 1075
> MethodEnterHandler: Invoked=184, id=0
> MethodEnterHandler: Invoked=72, id=1308544
> MethodLeaveHandler: id=544673756
> An unhandled error (4) has occurred.
> HyGeneric_Signal_Number=00000004
> ExceptionCode=c0000005
> ExceptionAddress=0001F8A4
> ContextFlags=0001003f
> Handler1=00401010
> Handler2=11105CE0
> InaccessibleAddress=0001F8A4
> EDI=0013F99C
> ESI=00000000
> EAX=00000021
> EBX=00000056
> ECX=01F91695
> EDX=01F9BD48
> EIP=0001F8A4
> ESP=0013F894
> EBP=03DB0000
> Module=
> Module_base_address=00010000
> Offset_in_DLL=0000f8a4
> =========================================================================================
> While instrumenting class profiler adds static fields to this class and calls to native
methods of the proxy class which gathers statistics. I included disassembled (javap) sources
to test archive to see the difference. Here is typical instrumentation of each method entry:
>    0:	getstatic	#41; //Field sm_bAlreadyInvoked70056:Z
>    3:	ldc_w	#62; //int 70056
>    6:	invokestatic	#53; //Method org/eclipse/tptp/martini/CGProxy.MethodEnter:(ZI)V
> Instrumented class invokes proxy method MethodEnter:() passing value of a static boolean
field and integer constant, which is used as method ID for this method. Test output shows
that in JIT+agent mode these arguments are passed incorrectly:
> JIT mode (no agent):
> DLL MethodEnterHandler: Invoked=0, id=70057
> DLL MethodEnterHandler: Invoked=0, id=70056
> DLL MethodLeaveHandler: id=70056
> -Xint+agent mode:
> MethodEnterHandler: Invoked=0, id=70057
> MethodEnterHandler: Invoked=0, id=70056
> MethodLeaveHandler: id=70056
> JIT+agent mode:
> MethodEnterHandler: Invoked=184, id=0
> MethodEnterHandler: Invoked=72, id=1308544
> MethodLeaveHandler: id=544673756
> It looks like M2N frame is formed incorrectly. This may be root cause of the crash.

-- 
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