JDK-7047954 : VM crashes with assert(is_Mem()) failed: invalid node class
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs21
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-05-24
  • Updated: 2011-11-25
  • Resolved: 2011-09-30
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
7u2Fixed 8Fixed hs22Fixed
Related Reports
Relates :  
Relates :  
Description
VM crashes with 
;; Using jvm: "/export/local/common/jdk/baseline/linux-i586/jre/lib/i386/server/libjvm.so"
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/tmp/jprt/P1/B/122931.et151817/source/src/share/vm/opto/node.hpp:749), pid=1881, tid=2401237872
#  assert(is_Mem()) failed: invalid node class
#
# JRE version: 7.0-b142
# Java VM: Java HotSpot(TM) Server VM (21.0-b14-internal-201105201229.et151817.hs21-b14-snapshot-fastdebug mixed mode linux-x86 )
# Core dump written. Default location: /export/local/50717.HSX.PIT.VM+linux-i586_javase__client_mixed_JT_HS/results/workDir/closed/runtime/4827353/ReadAfterWrite/core or core.1881
#
# 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 (0x8f259800):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=1889, stack(0x8f17f000,0x8f200000)]

Stack: [0x8f17f000,0x8f200000],  sp=0x8f1fd0b0,  free space=504k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xab1af1]  VMError::report_and_die()+0x1a1;;  VMError::report_and_die()+0x1a1
V  [libjvm.so+0x4cd1a8]  report_vm_error(char const*, int, char const*, char const*)+0x68;;  report_vm_error(char const*, int, char const*, char const*)+0x68
V  [libjvm.so+0x7e99fe]  Node::as_Mem() const+0x3e;;  Node::as_Mem() const+0x3e
V  [libjvm.so+0xa0843e]  SuperWord::co_locate_pack(Node_List*)+0xce;;  SuperWord::co_locate_pack(Node_List*)+0xce
V  [libjvm.so+0xa0db0b]  SuperWord::SLP_extract()+0x16b;;  SuperWord::SLP_extract()+0x16b
V  [libjvm.so+0x7fc9b1]  PhaseIdealLoop::build_and_optimize(bool)+0x10a1;;  PhaseIdealLoop::build_and_optimize(bool)+0x10a1
V  [libjvm.so+0x45cc4a]  Compile::Optimize()+0xd5a;;  Compile::Optimize()+0xd5a
V  [libjvm.so+0x460444]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool)+0x1114;;  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool)+0x1114
V  [libjvm.so+0x374f39]  C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0x229;;  C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0x229
V  [libjvm.so+0x46a3a8]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x548;;  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x548
V  [libjvm.so+0x46b09b]  CompileBroker::compiler_thread_loop()+0x5bb;;  CompileBroker::compiler_thread_loop()+0x5bb
V  [libjvm.so+0xa4bc6f]  compiler_thread_entry(JavaThread*, Thread*)+0x4f;;  compiler_thread_entry(JavaThread*, Thread*)+0x4f
V  [libjvm.so+0xa5a254]  JavaThread::thread_main_inner()+0xf4;;  JavaThread::thread_main_inner()+0xf4
V  [libjvm.so+0x8e2d61]  java_start(Thread*)+0x111;;  java_start(Thread*)+0x111
C  [libpthread.so.0+0x596e]  start_thread+0xbe


Current CompileTask:
C2:    551    4 %           ReadAfterWrite::main @ 5 (79 bytes)

Comments
EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/7889bbcc7f88
08-07-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/7889bbcc7f88
07-07-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/7889bbcc7f88
01-07-2011

EVALUATION The loop has 2 MergeMem nodes. Why?
27-05-2011

SUGGESTED FIX src/share/vm/opto/compile.cpp Thu May 26 18:19:10 2011 -0700 @@ -1206,11 +1206,7 @@ // Make sure the Bottom and NotNull variants alias the same. // Also, make sure exact and non-exact variants alias the same. if( ptr == TypePtr::NotNull || ta->klass_is_exact() ) { - if (ta->const_oop()) { - tj = ta = TypeAryPtr::make(TypePtr::Constant,ta->const_oop(),ta->ary(),ta->klass(),false,offset); - } else { - tj = ta = TypeAryPtr::make(TypePtr::BotPTR,ta->ary(),ta->klass(),false,offset); - } + tj = ta = TypeAryPtr::make(TypePtr::BotPTR,ta->ary(),ta->klass(),false,offset); } }
27-05-2011

EVALUATION I traced this problem to the 7041789 push, the same as for 7048030. The test has two static final arrays and the loop which initialize them: public class ReadAfterWrite { static final int n = 1000000; static final int[] AA = new int[n]; static final int[] BB = new int[n]; for(int i = 0; i < n; i++) { AA[i] = 0; BB[i] = 0; } And we totally lost memory Phi in the loop so the stores only depend on nonmutable memory. After 16 unrolls instead of 32 stores the loop has only 4 stores. I was able to reproduce the problem on Solaris after I set -Xms10m so the arrays are allocated in Old gen. With 7048030 fix the test passed.
25-05-2011