You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ivan Popov (JIRA)" <ji...@apache.org> on 2006/11/15 15:20:38 UTC

[jira] Created: (HARMONY-2200) [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler

[drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler
------------------------------------------------------------------------

                 Key: HARMONY-2200
                 URL: http://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


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

        

[jira] Commented: (HARMONY-2200) [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler

Posted by "Ivan Popov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2200?page=comments#action_12450038 ] 
            
Ivan Popov commented on HARMONY-2200:
-------------------------------------

I've looked at the bytecode generated by javac for similar native method call:

   0:	getstatic	#2; //Field sm_bAlreadyInvoked70057:Z
   3:	ldc	#3; //int 70057
   5:	invokestatic	#4; //Method org/eclipse/tptp/martini/CGProxy.MethodEnter:(ZI)V

I noticed that javac uses "ldc" command, instead of "ldc_w" used by instrumenter. However, "ldc_w" is still valid command. Using "ldc" in instrumented code does not change anything and VM still crashes. So this difference does not matter.


> [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2200
>                 URL: http://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
>
> 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.
-
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

        

[jira] Updated: (HARMONY-2200) [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler

Posted by "Ivan Popov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2200?page=all ]

Ivan Popov updated HARMONY-2200:
--------------------------------

    Attachment: ThreadEventsTest.zip

Test for reproducing this bug is attached.


> [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2200
>                 URL: http://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
>         Attachments: 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.
-
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

        

[jira] Commented: (HARMONY-2200) [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler

Posted by "Ivan Popov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2200?page=comments#action_12450332 ] 
            
Ivan Popov commented on HARMONY-2200:
-------------------------------------

Running test in -Xint mode against _debug_ build of DRLVM may lead to throwing assertion, I've submitted HARMONY-2206.


> [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2200
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2200
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM, App-Oriented Bug Reports
>         Environment: Windows/ia32, Linux ia/32
>            Reporter: Ivan Popov
>         Attachments: 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.
-
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

        

[jira] Updated: (HARMONY-2200) [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler

Posted by "Eugene S. Ostrovsky (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2200?page=all ]

Eugene S. Ostrovsky updated HARMONY-2200:
-----------------------------------------

    Attachment: H-2200-RegisterNatives-partial-fix.patch

Partial fix for JNI RegisterNatives function.

> [drlvm][jvmti] VM crashes running classes instrumented by JVMTI profiler
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2200
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2200
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM, App-Oriented Bug Reports
>         Environment: Windows/ia32, Linux ia/32
>            Reporter: Ivan Popov
>         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.
-
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