JDK-8276392 : ciReplay: Internal error in javaClasses.inline.hpp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-11-02
  • Updated: 2022-01-21
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.
Other
tbdUnresolved
Description
java/lang/invoke/MethodHandlesGeneralTest.java crashes with 
#  Internal Error (/home/katya/work/JavaSE/Hotspot/ws/git/jdk.jdk.master/open/src/hotspot/share/classfile/javaClasses.inline.hpp:267), pid=2866, tid=2873
#  assert(size > 0) failed: Oop size must be greater than zero, not 0

when running with ReplayCompiles using replay file previously generated by the test.


Steps to reproduce:
> ${JT_HOME}/bin/jtreg -retain:all -va -jdk:build/linux-x64/images/jdk 
    -vmoptions:"-XX:CompileCommand=option,test.java.lang.invoke.*::*,DumpReplay" 
    -dir:open/test/jdk java/lang/invoke/MethodHandlesGeneralTest.java


> export CLASSPATH as it is set in JTwork/java/lang/invoke/MethodHandlesGeneralTest.jtr

> ./build/linux-x64/images/jdk/bin/java -cp $CLASSPATH -XX:+ReplayCompiles 
   -XX:ReplayDataFile=JTwork/scratch/ONE-OF-REPLAY-FILES 
   org.junit.runner.JUnitCore test.java.lang.invoke.MethodHandlesGeneralTest
Comments
Workaround: -XX:ReplaySuppressInitializers=0
10-11-2021

The "Oop size must be greater than zero" asserts seems to be because replay creates empty java.lang.Class objects for static Class fields.
09-11-2021

[~epavlova] could you create a separate bug for the "must be whitelisted for replay compilation" issue? Also, please provide details on how to reproduce it.
09-11-2021

Another error received by running the same test wit ciReplay is: # Internal Error (/home/katya/work/JavaSE/Hotspot/ws/git/jdk.jdk.master/open/src/hotspot/share/ci/ciObjectFactory.cpp:381), pid=9376, tid=9389 # assert(!ReplayCompiles || ciReplay::no_replay_state() || !ciReplay::is_klass_unresolved((InstanceKlass*)k)) failed: must be whitelisted for replay compilation # # JRE version: Java(TM) SE Runtime Environment (18.0) (fastdebug build 18-internal+0-2021-11-02-1729208.katya...) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-internal+0-2021-11-02-1729208.katya..., mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x904d51] ciObjectFactory::create_new_metadata(Metadata*)+0x701 See replay_bug8276392_02.log and hs_err_bug8276392_02.log attached
02-11-2021

The crash is reproduced is just by running java with bad replay file: > /build/linux-x64/images/jdk/bin/java -cp $CLASSPATH -XX:+ReplayCompiles -XX:ReplayDataFile=JTwork/scratch/ONE-OF-REPLAY-FILES
02-11-2021

ILW = replay failure = MMH = P3
02-11-2021