JDK-8061953 : LambdaForm retransformation via j.l.i.Instrumentation::retransformClasses leads to JVM crash
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 8u40,9
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2014-10-23
  • Updated: 2014-11-17
  • Resolved: 2014-11-17
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 8
8u40Resolved
Related Reports
Duplicate :  
Description
Retransformation of j.l.i.LambdaForm using j.l.i.Instrumentation::retransformClasses and any registered ClassFileTranformer leads to following assertion:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/HUDSON/workspace/9-2-build-linux-amd64/jdk9/1503/hotspot/src/share/vm/oops/constantPool.cpp:2050), pid=23388, tid=139660894672640
#  assert(sym != NULL) failed: SymbolHashMap::find_entry - symbol is NULL
#
# JRE version: Java(TM) SE Runtime Environment (9.0-b35) (build 1.9.0-ea-fastdebug-b35)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.9.0-ea-fastdebug-b35 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

Stack: [0x00007f0555f41000,0x00007f0556042000],  sp=0x00007f055603f180,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1087731]  VMError::report_and_die()+0x151
V  [libjvm.so+0x73d6fb]  report_vm_error(char const*, int, char const*, char const*)+0x7b
V  [libjvm.so+0x726974]  SymbolHashMap::find_entry(Symbol*)+0x114
V  [libjvm.so+0x72a40b]  ConstantPool::copy_cpool_bytes(int, SymbolHashMap*, unsigned char*)+0x2cb
V  [libjvm.so+0xb0dc5c]  JvmtiClassFileReconstituter::write_class_file_format()+0x10c
V  [libjvm.so+0xb8d33b]  JvmtiEnv::RetransformClasses(int, _jclass* const*)+0x4fb
V  [libjvm.so+0xb10ee1]  jvmti_RetransformClasses+0x141
C  [libinstrument.so+0x4543]  retransformClasses+0x1f3
j  sun.instrument.InstrumentationImpl.retransformClasses0(J[Ljava/lang/Class;)V+0
j  sun.instrument.InstrumentationImpl.retransformClasses([Ljava/lang/Class;)V+23
j  Agent.premain(Ljava/lang/String;Ljava/lang/instrument/Instrumentation;)V+135
...

With product builds such retransformation cause crash too.

Issue could be reproduced with both 8u and 9 using attached test.
Comments
Closing this bug as a dup of the 8008678. The 8008678 needs to be fixed in the 8u too, but first in the 9. Please, let me know if this is not a correct way to handle a bug in the 8u40 bucket. If so then I'll try to defer it from 8u40.
17-11-2014

Hi Olivier, Removed the link. Now I know for sure the root cause of this bug.
17-11-2014

This bug looks like a dup of the RFE: https://bugs.openjdk.java.net/browse/JDK-8008678
12-11-2014

Thanks, Filipp!
11-11-2014

Sorry that I didn't write it previously. com.oracle.java.testlibrary should come from hotspot/test/testlibrary To compile & run the test case following commands could be used: $JAVA_HOME/bin/javac -d . -cp .:$JDK_WS/hotspot/test/testlibrary TestLambdaFormRetransformation.java $JAVA_HOME/bin/java -cp . -Dtest.jdk=$JAVA_HOME -Dtest.classes=. TestLambdaFormRetransformation
11-11-2014

Filipp, Could you, please, provide more details on how to run the TestLambdaFormRetransformation.java ? In particular, where the package should come from: com.oracle.java.testlibrary ? Are any additional options needed?
11-11-2014

Hi Olivier, Thank you for sharing the information! I'm not convinced yet that this issue is related to the JDK-8061177. At least, this one seems to be a JSR-292 specific as the LambdaForm's are involved. Suspecting, there can be some wholes of the JSR-292 support in the Class Redefinition/Retransformation. It can be also a dup of one of the known JSR-292 related bugs. I need to reproduce it myself to gain more confidence though. :)
11-11-2014

memory allocation problem in running context similar to JDK-8061177
07-11-2014

Fllipp, Thank you for the test TestLambdaFormRetransformation.java !
27-10-2014