JDK-7035515 : JSR 292: livelock after "init_AdapterMethodHandle should not issue this" message
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs21
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2011-04-11
  • Updated: 2011-05-13
  • Resolved: 2011-05-13
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 7
7Resolved
Related Reports
Duplicate :  
Description
In jdk7 b136 a sequence of method handles sometimes hangs eating 99% of CPU after the following message:

=============== DEBUG MESSAGE: init_AdapterMethodHandle should not issue this ================

"jstack -F <pid>" reports:

Thread 18694: (state = IN_VM)
 - java.lang.Throwable.fillInStackTrace() @bci=0 (Interpreted frame)
 - java.lang.Throwable.<init>() @bci=17, line=260 (Interpreted frame)
 - java.lang.Exception.<init>() @bci=1, line=54 (Interpreted frame)
 - java.lang.RuntimeException.<init>() @bci=1, line=51 (Interpreted frame)
 - java.lang.NullPointerException.<init>() @bci=1, line=55 (Interpreted frame)
Error occurred during stack walking:
java.lang.RuntimeException: Couldn't deduce type of CodeBlob @0xb3a06b48 for PC=0xb3a07254
        at sun.jvm.hotspot.code.CodeCache.findBlobUnsafe(CodeCache.java:117)
        at sun.jvm.hotspot.code.CodeCache.findBlob(CodeCache.java:83)
        at sun.jvm.hotspot.runtime.x86.X86Frame.adjustForDeopt(X86Frame.java:102)
        at sun.jvm.hotspot.runtime.x86.X86Frame.<init>(X86Frame.java:124)
        at sun.jvm.hotspot.runtime.x86.X86Frame.senderForCompiledFrame(X86Frame.java:373)
        at sun.jvm.hotspot.runtime.x86.X86Frame.sender(X86Frame.java:283)
        at sun.jvm.hotspot.runtime.Frame.sender(Frame.java:194)
        at sun.jvm.hotspot.runtime.Frame.realSender(Frame.java:201)
        at sun.jvm.hotspot.runtime.VFrame.sender(VFrame.java:119)
        at sun.jvm.hotspot.runtime.VFrame.javaSender(VFrame.java:151)
        at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:76)
        at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:45)
        at sun.jvm.hotspot.tools.JStack.run(JStack.java:60)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
        at sun.jvm.hotspot.tools.JStack.main(JStack.java:86)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:613)
        at sun.tools.jstack.JStack.runJStackTool(JStack.java:136)
        at sun.tools.jstack.JStack.main(JStack.java:102)
Caused by: sun.jvm.hotspot.types.WrongTypeException: No suitable match for type of address 0xb3a06b48 (nearest symbol is _ZTV24MethodHandlesAdapterBlob)
        at sun.jvm.hotspot.runtime.VirtualConstructor.instantiateWrapperFor(VirtualConstructor.java:95)
        at sun.jvm.hotspot.code.CodeCache.findBlobUnsafe(CodeCache.java:100)
        ... 20 more


stack reported by gdb:

#0  0xb6e44c8a in CodeHeap::find_start(void*) const () from jdk7b136/jre/lib/i386/server/libjvm.so
#1  0xb6df6252 in frame::sender_for_compiled_frame(RegisterMap*) const () from jdk7b136/jre/lib/i386/server/libjvm.so
#2  0xb6df6549 in frame::sender(RegisterMap*) const () from jre/lib/i386/server/libjvm.so
#3  0xb6e9e49c in java_lang_Throwable::fill_in_stack_trace(Handle, Thread*) () from jdk7b136/jre/lib/i386/server/libjvm.so
#4  0xb6e9e8fb in java_lang_Throwable::fill_in_stack_trace(Handle) () from jdk7b136/jre/lib/i386/server/libjvm.so
#5  0xb6edb3e8 in JVM_FillInStackTrace () from jdk7b136/jre/lib/i386/server/libjvm.so
#6  0xb6a20559 in Java_java_lang_Throwable_fillInStackTrace () from jdk7b136/jre/lib/i386/libjava.so
#7  0xb39ca013 in ?? ()
#8  0x08859d20 in ?? ()
#9  0xb6a8cbb0 in ?? ()
#10 0xb6a8cb88 in ?? ()
#11 0xb71287cc in AbstractInterpreter::can_be_compiled(methodHandle) () from jdk7b136/jre/lib/i386/server/libjvm.so
#12 0xb39c215a in ?? ()
#13 0x00000000 in ?? ()

Comments
EVALUATION I just noticed that VerifyMethodHandles catches the problem: $ java -XX:+UnlockDiagnosticVMOptions -XX:+VerifyMethodHandles -cp vm7-jsr292-release-2011-04-14.jar vm.mlvm.meth.share.SimpleUnitTest java.lang.IllegalArgumentException: Can't create throw/catch TF at vm.mlvm.meth.share.transform.v2.MHThrowCatchTFPair$ThrowTF.computeInboundMH(MHThrowCatchTFPair.java:62) at vm.mlvm.meth.share.transform.v2.MHBasicUnaryTF.computeInboundMH(MHBasicUnaryTF.java:32) at vm.mlvm.meth.share.transform.v2.MHPrimitiveTF.computeInboundCall(MHPrimitiveTF.java:12) at vm.mlvm.meth.share.transform.v2.MHMacroTF.addTransformation(MHMacroTF.java:42) at vm.mlvm.meth.share.MHTransformationGen.createSequence(MHTransformationGen.java:327) at vm.mlvm.meth.share.MHTransformationGen.createAndCallSequence(MHTransformationGen.java:361) at vm.mlvm.meth.share.SimpleUnitTest.main(SimpleUnitTest.java:25) Caused by: java.lang.IllegalArgumentException: bad adapter (conversion=0xfffcb400): adapter pushes too many parameters at java.lang.invoke.MethodHandleNatives.init(Native Method) at java.lang.invoke.AdapterMethodHandle.<init>(AdapterMethodHandle.java:51) at java.lang.invoke.AdapterMethodHandle.makeUnboxArgument(AdapterMethodHandle.java:639) at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:177) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:677) at java.lang.invoke.MethodHandleImpl$GuardWithTest.make(MethodHandleImpl.java:812) at java.lang.invoke.MethodHandleImpl.makeGuardWithTest(MethodHandleImpl.java:918) at java.lang.invoke.MethodHandles.guardWithTest(MethodHandles.java:2039) at vm.mlvm.meth.share.transform.v2.MHThrowCatchTFPair$ThrowTF.computeInboundMH(MHThrowCatchTFPair.java:60) ... 6 more
14-04-2011

EVALUATION On Linux the livelock is also reproducible with the interpreter: $ java -Xint -cp vm7-jsr292-release-2011-04-14.jar vm.mlvm.meth.share.SimpleUnitTest =============== DEBUG MESSAGE: init_AdapterMethodHandle should not issue this ================
14-04-2011

EVALUATION It also happens with the interpreter: $ java -showversion -Xint -cp vm7-jsr292-release-2011-04-14.jar vm.mlvm.meth.share.SimpleUnitTest java version "1.7.0-ea" Java(TM) SE Runtime Environment (build 1.7.0-ea-b137) Java HotSpot(TM) Server VM (build 21.0-b07, interpreted mode) java.lang.ClassCastException: required class java.lang.Float but encountered class java.lang.Boolean
14-04-2011

EVALUATION I could reproduce it on intelsdv03 (Linux) with JDK7 b137. Interesting bit is that when the bug is not hit the test throws a ClassCastException but always with a different message at a different place, e.g.: java.lang.ClassCastException: required class java.lang.Float but encountered class java.lang.Short java.lang.ClassCastException: required class java.lang.Integer but encountered class java.lang.Float java.lang.ClassCastException: required class java.lang.Byte but encountered class java.lang.Double java.lang.ClassCastException: required class java.lang.Double but encountered class java.lang.Long java.lang.ClassCastException: required class java.lang.Boolean but encountered class java.lang.Short java.lang.ClassCastException: required class java.lang.Character but encountered class java.lang.Double This could be some kind of stack corruption or similar problem that leads to the exceptions and sometimes to the livelock because execution ends up in _adapter_prim_to_prim or _adapter_ref_to_prim (which issue the "init_AdapterMethodHandle should not issue this"). But this is just a wild guess. I could also reproduce the exceptions on intelsdv01 (Solaris) but not the livelock (yet).
14-04-2011