JDK-8067876 : demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java fails due to 112(JVMTI_ERROR_WRONG_PHASE)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • Submitted: 2014-12-18
  • Updated: 2016-05-26
  • Resolved: 2016-05-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
#section:main
----------messages:(3/143)----------
command: main CompiledMethodLoadTest Hello
reason: User specified action: run main CompiledMethodLoadTest Hello 
elapsed time (seconds): 9.107
----------System.out:(46/3832)----------
Starting: /export/local/aurora/CommonData/jdk/bin/java -cp /export/local/aurora/sandbox/results/workDir/classes/demo/jvmti/compiledMethodLoad -Dtest.classes=/export/local/aurora/sandbox/results/workDir/classes/demo/jvmti/compiledMethodLoad -Xcheck:jni -Xverify:all -agentpath:/export/local/aurora/CommonData/jdk/demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so Hello
WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethod
Warning: SIGINT handler expected:libjvm.so+0xd93960  found:0x00000001
Running in non-interactive shell, SIGINT handler is replaced by shell
Signal Handlers:
SIGSEGV: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR2: [libjvm.so+0xd93a70], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: [libjvm.so+0xd93960], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGINT: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: [libjvm.so+0xd93960], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGQUIT: [libjvm.so+0xd93960], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethod
Hello
ERROR: JVMTI: 112(JVMTI_ERROR_WRONG_PHASE): get method name
Exit code is 3
<beginning of Error Stream buffer>
ERROR: JVMTI: 112(JVMTI_ERROR_WRONG_PHASE): get method name

<end of buffer>
<beginning of Input Stream buffer>
WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethod
Warning: SIGINT handler expected:libjvm.so+0xd93960  found:0x00000001
Running in non-interactive shell, SIGINT handler is replaced by shell
Signal Handlers:
SIGSEGV: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.so+0xd93810], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR2: [libjvm.so+0xd93a70], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: [libjvm.so+0xd93960], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGINT: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: [libjvm.so+0xd93960], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGQUIT: [libjvm.so+0xd93960], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethod
Hello

<end of buffer>
----------System.err:(15/913)----------
java.lang.RuntimeException: Test failed - exit return code non-zero (exitStatus==3)
	at DemoRun.runit(DemoRun.java:207)
	at DemoRun.runit(DemoRun.java:109)
	at CompiledMethodLoadTest.main(CompiledMethodLoadTest.java:41)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:745)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed - exit return code non-zero (exitStatus==3)
JavaTest Message: shutting down test
Comments
The Jigsaw M3 changes fixed some issues and lowered the probability of this failure mode. David Holmes observed this failure mode a week ago. This is a fragment from his email: Starting: /export/users/dh198349/jdk9-hs/build/linux-x64/images/jdk/bin/java -cp /export/users/dh198349/jdk9-hs/jdk/test/JTw ork/classes/demo/jvmti/compiledMethodLoad -Dtest.classes=/export/users/dh198349/jdk9-hs/jdk/test/JTwork/classes/demo/jvmti/c ompiledMethodLoad -Xcheck:jni -Xverify:all -agentpath:/export/users/dh198349/jdk9-hs/build/linux-x64/images/jdk/demo/jvmti/c ompiledMethodLoad/lib/libcompiledMethodLoad.so Hello WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethod Hello ERROR: JVMTI: 112(JVMTI_ERROR_WRONG_PHASE): get method name Exit code is 3 <beginning of Error Stream buffer> ERROR: JVMTI: 112(JVMTI_ERROR_WRONG_PHASE): get method name )
26-05-2016

This was addressed by the jigsaw M3 changes, closing as CNR.
26-05-2016

Removing the label "modularization". This issue must be a placeholder for the non-jigsaw-repo jdk 9 builds. Also, Alan has just filed another jigsaw-repo related bug on this problem. This bug has to be closed after the related jake m3 fixes are integrated with the jdk 9.
15-03-2016

I've added the label "modularization" as this issue is important to fix for Jake because it is related to the work that was done for module aware agents. However, this test was failing in jdk 9 before without the related Jake fixes. I'm not sure if the label m3 has to be added as well. I'd prefer to fix this in m3 if there is time for it.
15-03-2016

I was able to reproduce this issue on Linux-x64 and fastdebug build. The problem is that the test is ended and switches to the shutdown sequence. The phase becomes the JVMTI_PHASE_DEAD. It seems, most of the events miss the check of the JVMTI_PHASE_DEAD. The same happens for the CompiledMethodLoad event. Adding the checks into the JvmtiExport::post_compiled_method_load improves things a lot. However, it was observed that the JVMTI_PHASE_DEAD may come in the middle of the CompiledMethodLoad event handler execution. I'm not sure yet if there is a good way to fix this secondary issue. Most likely, the agents have to be careful and check the return code from the JVMTI functions that a re called in the event handler. Another approach is to register the VMDeath event handler and use to get involved into a cooperative VM shutdown. The same is true about the CompiledMethodLoadTest agent. After fixing both issues (primary one in JVMTI and secondary one in the test agent) the test does not fail in 1000 runs.
15-03-2016