JDK-7174884 : C1: failures after 7171890: assert(cur_state != NULL) failed: state_before must be set
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs23
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-06-06
  • Updated: 2013-09-04
  • Resolved: 2012-06-16
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 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Related Reports
Relates :  
Description
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (C:\jprt\T\P1\092016.rwestrel\s\src\share\vm\c1\c1_GraphBuilder.cpp:2128), pid=9448, tid=4196
#  assert(cur_state != NULL) failed: state_before must be set
#
# JRE version: 7.0_04-b20
# Java VM: Java HotSpot(TM) Client VM (24.0-b12-internal-201206050920.rwestrel.hotspot-fastdebug compiled mode windows-x86 )
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

Comments
EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/e1635876b206
29-06-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/e1635876b206
07-06-2012

SUGGESTED FIX diff --git a/src/share/vm/c1/c1_Canonicalizer.cpp b/src/share/vm/c1/c1_Canonicalizer.cpp --- a/src/share/vm/c1/c1_Canonicalizer.cpp +++ b/src/share/vm/c1/c1_Canonicalizer.cpp @@ -466,7 +466,7 @@ if (t->is_klass()) { // substitute cls.isInstance(obj) of a constant Class into // an InstantOf instruction - InstanceOf* i = new InstanceOf(t->as_klass(), x->argument_at(1), x->state()); + InstanceOf* i = new InstanceOf(t->as_klass(), x->argument_at(1), x->state_before()); set_canonical(i); // and try to canonicalize even further do_InstanceOf(i);
06-06-2012

EVALUATION It's very easy to reproduce with the jruby.jar and CTW: cthaling@intelsdv01:~/mlvm/jruby$ java -client -XX:+CompileTheWorld -Xbootclasspath/p:lib/jruby.jar -XX:CompileTheWorldStartAt=458 -XX:+ShowMessageBoxOnError CompileTheWorld : Compiling all classes in /home/cthaling/mlvm/jruby/lib/jruby.jar Preloading failed for (380) com/martiansoftware/nailgun/builtins/NGVersion Preloading failed for (397) jline/AnsiWindowsTerminal CompileTheWorld (458) : jnr/constants/Constant CompileTheWorld (459) : jnr/constants/ConstantSet$ConstantIterator CompileTheWorld (460) : jnr/constants/ConstantSet # To suppress the following error report, specify this argument # after -XX: or in .hotspotrc: SuppressErrorAt=/c1_GraphBuilder.cpp:2128 ============================================================================== Unexpected Error ------------------------------------------------------------------------------ Internal Error at c1_GraphBuilder.cpp:2128, pid=6669, tid=7 assert(cur_state != NULL) failed: state_before must be set Do you want to debug the problem? To debug, run 'dbx - 6669'; then switch to thread 7 Enter 'yes' to launch dbx automatically (PATH must include dbx) Otherwise, press RETURN to abort... ============================================================================== The Canonicalizer in append_with_bci returns an InstanceOf node which doesn't have a state_before: (dbx) p instr->print() __bci__use__tid____instr____________________________________ . 6 0 i23 isInstance(a13, a15) instr->print() = (void) (dbx) p *instr *instr = { _id = 23 _printable_bci = 6 _use_count = 0 _pin_state = 8192 _type = 0x8578430 _next = (nil) _subst = (nil) _operand = 0xffffffff _flags = 515U _state_before = 0x859f7b8 _exception_state = (nil) _exception_handlers = (nil) } (dbx) p i1->print() __bci__use__tid____instr____________________________________ . 6 0 i24 instanceof(a15) jnr/constants/Constant i1->print() = (void) (dbx) p *i1 *i1 = { _id = 24 _printable_bci = 6 _use_count = 0 _pin_state = 8192 _type = 0x8578430 _next = (nil) _subst = (nil) _operand = 0xffffffff _flags = 131072U _state_before = (nil) _exception_state = (nil) _exception_handlers = (nil) } It seems we are passing the wrong state to InstanceOf. This line: InstanceOf* i = new InstanceOf(t->as_klass(), x->argument_at(1), x->state()); should be: InstanceOf* i = new InstanceOf(t->as_klass(), x->argument_at(1), x->state_before());
06-06-2012