JDK-8063114 : [TESTBUG] Need a test to cover JDK-8032247
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 8u40,9
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2014-11-06
  • Updated: 2016-04-06
  • Resolved: 2016-04-06
Related Reports
Blocks :  
Relates :  
Comments
Since class dumping functionality is still broken (JDK-8015848) I'd like to wait until JDK-8015848 fixed and only then add a new test[s] to cover both issues.
15-12-2014

(1) seems pretty simple: we just need to force JVM's crash (using Unsafe, for example), attach CLHSDB to generated core and then just dump the class with invokedynamic via "dumpclass" cmd. Before fix dumpclass will be failed with Error: java.lang.RuntimeException: javax.script.ScriptException: javax.script.ScriptException: java.lang.reflect.InvocationTargetException in sa.js at line number 179 at column number 20 which is caused (according to TraceExceptions) by original issue: Exception <a 'java/lang/InternalError'> (0x00000000d8c57e30) thrown in interpreter method <{method} {0x00007f53a6cd43c8} 'getConstantPoolIndex' '(II)S' in 'sun/jvm/hotspot/tools/jcore/ByteCo> at bci 138 for thread 0x00007f53c800c000 Exception <a 'java/lang/InternalError'> (0x00000000d8c57e30) thrown in interpreter method <{method} {0x00007f53a6cd48c0} 'rewrite' '()V' in 'sun/jvm/hotspot/tools/jcore/ByteCodeRewriter'> at bci 297 for thread 0x00007f53c800c000 Exception <a 'java/lang/InternalError'> (0x00000000d8c57e30) thrown in interpreter method <{method} {0x00007f53a6cb2d70} 'rewriteByteCode' '(Lsun/jvm/hotspot/oops/Method;[B)V' in 'sun/jvm/ho> at bci 15 for thread 0x00007f53c800c000 Exception <a 'java/lang/InternalError'> (0x00000000d8c57e30) thrown in interpreter method <{method} {0x00007f53a6cb2c00} 'writeMethod' '(Lsun/jvm/hotspot/oops/Method;)V' in 'sun/jvm/hotspot/> at bci 361 for thread 0x00007f53c800c000 Exception <a 'java/lang/InternalError'> (0x00000000d8c57e30) thrown in interpreter method <{method} {0x00007f53a6cb2638} 'writeMethods' '()V' in 'sun/jvm/hotspot/tools/jcore/ClassWriter'> at bci 35 for thread 0x00007f53c800c000 Exception <a 'java/lang/InternalError'> (0x00000000d8c57e30) thrown in interpreter method <{method} {0x00007f53a6cb0fe0} 'write' '()V' in 'sun/jvm/hotspot/tools/jcore/ClassWriter'> at bci 38 for thread 0x00007f53c800c000 Exception <a 'java/lang/InternalError'> (0x00000000d8c57e30) thrown in interpreter method <{method} {0x00007f53af83ba38} 'dumpClass' '([Ljava/lang/Object;)Ljava/lang/Object;' in 'sun/jvm/hot> at bci 318 for thread 0x00007f53c800c000 So the most unpleasant thing is that we need to find out core file after the crash (like ciReplay tests do).
06-11-2014

There are two options: 1) use CLHSDB; 2) directly create HotSpotAgent, attach to debugee and try to dump a class whose methods use invokedynamic bc.
06-11-2014