JDK-8223581 : C2 compilation failed with assert(!q->is_MergeMem())
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 13
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-05-08
  • Updated: 2019-08-15
  • Resolved: 2019-05-23
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 13
13 b23Fixed
Related Reports
Relates :  
Relates :  
Description
Fastdebug:
make test TEST=jck-runtime:api >&out.api&
Leaves some hs_err_pid* files (attached).  I haven't narrowed down the specific tests but it looks like the tck harness is asserting during compilation.  I tried running subsets but they didn't fail.

Snippets:

#  Internal Error (open/src/hotspot/share/opto/parse1.cpp:1835), pid=6862, tid=6889
#  Error: assert(!q->is_MergeMem()) failed
#
# JRE version: Java(TM) SE Runtime Environment (13.0) (fastdebug build 13-internal+0-2019-05-07-1841236.coleen.null)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 13-internal+0-2019-05-07-1841236.coleen.null, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x140bc54]  Parse::merge_memory_edges(MergeMemNode*, int, bool)+0x524
#

Current CompileTask:
C2: 129796 7365       4       com.sun.tck.lib.tgf.TransformingIterator::next (5 bytes)

Stack: [0x00002ac2d2ce0000,0x00002ac2d2de1000],  sp=0x00002ac2d2ddb9c0,  free space=1006k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x140bc54]  Parse::merge_memory_edges(MergeMemNode*, int, bool)+0x524
V  [libjvm.so+0x140c26e]  Parse::merge_common(Parse::Block*, int)+0x2fe

Comments
We hit an assert during parsing with incremental inlining when merging memory edges into a target block because of a MergeMem that has another MergeMem as input. The root cause is the same as with JDK-8221592: After the fix for JDK-8059241, we don't always execute a round of PhaseRemoveUseless / IGVN after incremental inlining and as a result, MergeMems that feed into other MergeMems are not cleaned immediately (but they are on the IGVN worklist and will be cleaned up eventually). To not confuse the parser, we need to remove them eagerly. This is already done in GraphKit::replace_call() for the non-exceptional memory edge but the implementation misses to also handle the exceptional case. Instead of a Node_List, I'm now using a Unique_Node_List to avoid the costly contains() call that has O(n) complexity. http://cr.openjdk.java.net/~thartmann/8223581/webrev.00/
22-05-2019

ILW = Same as 8221592 = P2
09-05-2019

Similar to JDK-8221592 !
09-05-2019