JDK-8059621 : JVM crashes with "unexpected index type" assert in LIRGenerator::do_UnsafeGetRaw
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8u40
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris
  • CPU: sparc
  • Submitted: 2014-10-02
  • Updated: 2015-06-03
  • Resolved: 2014-10-03
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.
8u40Fixed 9 b36Fixed
Related Reports
Relates :  
Test compiler/uncommontrap/StackOverflowGuardPagesOff.java crashes with following assert on solaris-sparc w/ "-Xcomp -XX:+DeoptimizeALot" flags:

# A fatal error has been detected by the Java Runtime Environment:
#  Internal Error (/HUDSON/workspace/8-2-build-solaris-sparcv9/jdk8u40/1614/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp:2111), pid=12766, tid=10
#  assert(!x->has_index() || (index_op->type() == T_INT && index_op->is_constant()) || (index_op->type() == T_LONG && !index_op->is_constant())) failed: unexpected index type
# JRE version: Java(TM) SE Runtime Environment (8.0_40-b08) (build 1.8.0_40-ea-fastdebug-b08)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b12-fastdebug compiled mode solaris-sparc )
# Core dump written. Default location: /export/local/aurora/sandbox/results/workDir/compiler/uncommontrap/StackOverflowGuardPagesOff/core or core.12766
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp

---------------  T H R E A D  ---------------

Current thread (0x000000010049e800):  JavaThread "C1 CompilerThread3" daemon [_thread_in_native, id=10, stack(0xffffffff7ae00000,0xffffffff7af00000)]

Stack: [0xffffffff7ae00000,0xffffffff7af00000],  sp=0xffffffff7aefe300,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x12e4fb8]  void VMError::report_and_die()+0x588
V  [libjvm.so+0x762720]  void report_vm_error(const char*,int,const char*,const char*)+0x78
V  [libjvm.so+0x4d29f8]  void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw*)+0x418
V  [libjvm.so+0x4c46f4]  void LIRGenerator::block_do(BlockBegin*)+0x144
V  [libjvm.so+0x483c6c]  void BlockList::iterate_forward(BlockClosure*)+0x94
V  [libjvm.so+0x436048]  void Compilation::emit_lir()+0x468
V  [libjvm.so+0x436e60]  int Compilation::compile_java_method()+0x5b8
V  [libjvm.so+0x4372f8]  void Compilation::compile_method()+0xb0
V  [libjvm.so+0x437e94]  Compilation::Compilation(AbstractCompiler*,ciEnv*,ciMethod*,int,BufferBlob*)+0x2ec
V  [libjvm.so+0x43adcc]  void Compiler::compile_method(ciEnv*,ciMethod*,int)+0x12c
V  [libjvm.so+0x6d1e84]  void CompileBroker::invoke_compiler_on_method(CompileTask*)+0x594
V  [libjvm.so+0x6d12dc]  void CompileBroker::compiler_thread_loop()+0x4cc
V  [libjvm.so+0x1226ed8]  void JavaThread::thread_main_inner()+0x268
V  [libjvm.so+0x1226bf0]  void JavaThread::run()+0x408
V  [libjvm.so+0xf90100]  java_start+0x258
C  [libc.so.1+0xe25fc]  _lwp_start+0x8

Current CompileTask:
C1:   5232 1447 %  b  1       StackOverflowGuardPagesOff::m1 @ 12 (22 bytes)

Issue could be reproduced starting from 8u40b08.
I was not able to reproduce it with latest jdk 9 build.
LIRItem::load_nonconstant() loads constant into a register on SPARC if the constant is too large. I cannot assume that a constant HIR node will produce a constant in LIR after that call.