United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7147744 CTW: assert(false) failed: infinite EA connection graph build
JDK-7147744 : CTW: assert(false) failed: infinite EA connection graph build

Details
Type:
Bug
Submit Date:
2012-02-22
Status:
Closed
Updated Date:
2013-07-18
Project Name:
JDK
Resolved Date:
2012-03-24
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs24 (b05)

Related Reports
Backport:
Backport:
Backport:
Duplicate:
Relates:
Relates:
Relates:

Sub Tasks

Description
CTW fails with crash. Reproduces starting HS 23 b16 (not with JDK 8 b26, HS 23 b15):

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/tmp/jprt/P1/230908.jcoomes/source/src/share/vm/opto/escape.cpp:1720), pid=27559, tid=3043085200
#  assert(false) failed: infinite EA connection graph build (86.155175 sec, 3 iterations) with 23111 nodes and worklist size 2211
#
# JRE version: 8.0-b26
# Java VM: Java HotSpot(TM) Server VM (23.0-b16-internal-201202172309.jcoomes.hs23-b16-snapshot-fastdebug mixed mode linux-x86 )
# Core dump written. Default location: /export/local/58270.HSX.PIT.VM_linux-i586_ctw__server_comp_ibiblio_6800_6900.testlist/results/ctw_maven2_com_yahoo_platform_yui_yuicompressor_2_3_6_yuicompressor-2_3_6_jar_classes_1_313/core or core.27559

Current thread (0x0826e000):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=27577, stack(0xb559c000,0xb561d000)]

Stack: [0xb559c000,0xb561d000],  sp=0xb561a2a0,  free space=504k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xb197b1]  VMError::report_and_die()+0x1a1;;  VMError::report_and_die()+0x1a1
V  [libjvm.so+0x4f0fd8]  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+0x57d7a4]  ConnectionGraph::compute_escape()+0xcc4;;  ConnectionGraph::compute_escape()+0xcc4
V  [libjvm.so+0x57f437]  ConnectionGraph::do_analysis(Compile*, PhaseIterGVN*)+0xb7;;  ConnectionGraph::do_analysis(Compile*, PhaseIterGVN*)+0xb7
V  [libjvm.so+0x47bdd3]  Compile::Optimize()+0xb63;;  Compile::Optimize()+0xb63
V  [libjvm.so+0x47fe3c]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool)+0x14bc;;  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool)+0x14bc
V  [libjvm.so+0x392729]  C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0x229;;  C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0x229
V  [libjvm.so+0x488888]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x598;;  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x598
V  [libjvm.so+0x48984b]  CompileBroker::compiler_thread_loop()+0x5bb;;  CompileBroker::compiler_thread_loop()+0x5bb
V  [libjvm.so+0xaafa2f]  compiler_thread_entry(JavaThread*, Thread*)+0x4f;;  compiler_thread_entry(JavaThread*, Thread*)+0x4f
V  [libjvm.so+0xabbbb9]  JavaThread::thread_main_inner()+0x1b9;;  JavaThread::thread_main_inner()+0x1b9
V  [libjvm.so+0xabc24e]  JavaThread::run()+0x26e;;  JavaThread::run()+0x26e
V  [libjvm.so+0x939871]  java_start(Thread*)+0x111;;  java_start(Thread*)+0x111
C  [libpthread.so.0+0x61b5]  start_thread+0xc5


Current CompileTask:
C2: 188792 1452   !b  4       org.mozilla.javascript.Interpreter::interpretLoop (7845 bytes)

                                    

Comments
EVALUATION

With new implementaion of EA Connection construction I am working on the time reduced from 44 sec to 0.3 sec:

   8027    9   !b        org.mozilla.javascript.Interpreter::interpretLoop (7845 bytes)
  12958    9   size: 243136 time: 4929 inlined: 135 bytes

<phase name='escapeAnalysis' nodes='24803' stamp='8.311'>
<phase name='buildConnectionGraph' nodes='24803' stamp='8.312'>
<phase_done nodes='24803' stamp='8.613'/>
</phase>
<phase_done nodes='24803' stamp='8.613'/>
</phase>
                                     
2012-02-23
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/ee138854b3a6
                                     
2012-03-12
EVALUATION

I rewrote Connection graph construction code in EA to reduce time spent there. In the bug's test time reduced by 100 (from about 50 to .5 sec on Nahalem-EX machine).

Connection graph now has specialized classes for nodes and additional use edges to put on worklist only uses of node which added new point edge. Field node has also bases edges. Edges never removed only added.
Instead of looking for Field's bases from the start create simple base edge to LocalVar during initial graph construction in build_connection_graph(). Late do several iteration to push all known JavaObject nodes references through graph. This phase has limits on number and time. Also on each iteration check if there are non globally escaped objects and bail out from code if not.
Added additional Arraycopy node to connect source and destination objects.
I removed uncast() calls so that all LocalVar nodes point to all related JavaObject nodes.
I combined record_for_escape_analysis() and build_connection_graph() into one method.
Added TracePhase around Connection graph build code to see how much time spent there.

This code need addition work since I still saw outlier (10 min in EA) in sje2010 on SPARC. But I will look on it after this one is done.

I added new GrowableArray method delete_at(i) to avoid shifting following elements which is done in remove_at(i) method. And changed GrowableArray::append_if_missing() to return true if a value was missed and was added into array.
                                     
2012-03-12
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/ee138854b3a6
                                     
2012-03-28



Hardware and Software, Engineered to Work Together