JDK-7010180 : JSR 292 InvokeDynamicPrintArgs fails with: assert(_adapter == NULL) failed: init'd to NULL
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs20
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-01-04
  • Updated: 2012-02-01
  • Resolved: 2011-03-08
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 6 JDK 7 Other
6u25Fixed 7Fixed hs20Fixed
Related Reports
Duplicate :  
Relates :  
Description
InvokeDynamicPrintArgs fails on a 64-bit SPARC debug build with:

$ gamma -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp /java/devtools/share/junit/latest/junit.jar:test/java/dyn/ indify.Indify --verify-specifier-count=3 --transitionalJSR292=false --expand-properties --classpath test/java/dyn/ --java InvokeDynamicPrintArgs --check-output 
VM option '+UnlockExperimentalVMOptions'
VM option '+EnableInvokeDynamic'
patching InvokeDynamicPrintArgs.main(L)V
16:invokestatic 6 INDY_nothing()L;...; 19:invokevirtual 7 => invokedynamic 376:InvokeDynamic[0, 374]
22:invokestatic 8 INDY_bar()L;...; 28:invokevirtual 10 => invokedynamic 383:InvokeDynamic[1, 381]
31:invokestatic 11 INDY_bar2()L;...; 39:invokevirtual 10 => invokedynamic 385:InvokeDynamic[1, 384]
42:invokestatic 13 INDY_baz()L;...; 51:invokevirtual 17 => invokedynamic 388:InvokeDynamic[2, 387]
54:invokestatic 18 INDY_foo()L;...; 59:invokevirtual 20 => invokedynamic 379:InvokeDynamic[0, 378]
patching InvokeDynamicPrintArgs.bsm(LLL)L
24:invokestatic 66 MH_printArgs()L => ldc 366:MethodHandle[6, 365]
patching InvokeDynamicPrintArgs.bsm2(LLLL)L
69:invokestatic 66 MH_printArgs()L => ldc 366:MethodHandle[6, 365]
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/methodOop.cpp:691
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/twisti/hotspot-comp/hotspot/src/share/vm/oops/methodOop.cpp:691), pid=2007, tid=2
#  assert(_adapter == NULL) failed: init'd to NULL
#
# JRE version: 7.0-b123
# Java VM: OpenJDK 64-Bit Server VM (20.0-b04-internal-jvmg mixed mode solaris-sparc compressed oops)

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/d810e9a3fc33
10-01-2011

SUGGESTED FIX Link sun.dyn.MethodHandleImpl class before generating the method handle adapters. This ensures that the required c2i-adapter exists.
04-01-2011

EVALUATION Part of the backtrace is: [7] report_vm_error(file = 0xffffffff7ed770f8 "/home/twisti/hotspot-comp/hotspot/src/share/vm/oops/methodOop.cpp", line = 691, error_msg = 0xffffffff7ed7713c "assert(_adapter == NULL) failed", detail_msg = 0xffffffff7ed7715c "init'd to NULL"), line 216 in "debug.cpp" [8] methodOopDesc::link_method(this = 0xfffffffe700984e8, h_method = CLASS, __the_thread__ = 0x100138800), line 691 in "methodOop.cpp" [9] Rewriter::Rewriter(this = 0xffffffff7c2fb808, klass = CLASS, cpool = CLASS, methods = CLASS, __the_thread__ = 0x100138800), line 376 in "rewriter.cpp" [10] Rewriter::rewrite(klass = CLASS, __the_thread__ = 0x100138800), line 316 in "rewriter.cpp" [11] instanceKlass::rewrite_class(this = 0xfffffffe700989b0, __the_thread__ = 0x100138800), line 385 in "instanceKlass.cpp" <snip> The failing methodOop is: sun.dyn.MethodHandleImpl::raiseException Since 7007377 during method handles adapter generation the adapters for sun.dyn.MethodHandleImpl::raiseException are also generated. Later when the Rewriter wants to link the method the adapter entry already exists and the assert triggers. *** (#1 of 1): [ UNSAVED ] ###@###.###
04-01-2011