JDK-8229701 : aarch64: C2 OSR compilation fails with "shouldn't process one node several times" in final graph reshaping
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • CPU: aarch64
  • Submitted: 2019-08-14
  • Updated: 2022-06-27
  • Resolved: 2019-09-12
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 11 JDK 13 JDK 14
11.0.11-oracleFixed 13.0.4Fixed 14 b15Fixed
Related Reports
Relates :  
Description
(synopsis is provisional, please change as you see fit)

Found with fuzzing. Reliably reproduces on aarch64, but not on x86_64, although it is probably not architecture-specific.
Test bundle is attached, along with sample hs_errs.

$ ~/jdk-jdk/build/linux-aarch64-server-fastdebug/images/jdk/bin/java Test

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/shade/jdk-jdk/src/hotspot/share/opto/compile.cpp:3489), pid=3503, tid=3514
#  assert(!wq.contains(u)) failed: shouldn't process one node several times
#
# JRE version: OpenJDK Runtime Environment (14.0) (fastdebug build 14-internal+0-adhoc.shade.jdk-jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 14-internal+0-adhoc.shade.jdk-jdk, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-aarch64)
# Problematic frame:
# V  [libjvm.so+0x7a0f58]  Compile::final_graph_reshaping_main_switch(Node*, Final_Reshape_Counts&, unsigned int)+0x1268
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e %P %I %h" (or dumping to /home/shade/tests/05015/core.3503)
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  S U M M A R Y ------------

Command Line: Test

Host: merino.lab2.eng.bos.redhat.com, AArch64, 46 cores, 95G, Red Hat Enterprise Linux Server release 7.6 (Maipo)
Time: Wed Aug 14 06:39:26 2019 EDT elapsed time: 1 seconds (0d 0h 0m 1s)

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

Current thread (0x0000ffff905ab000):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=3514, stack(0x0000ffff2cf90000,0x0000ffff2d190000)]


Current CompileTask:
C2:   1335   88 % !   4       Test::vMeth @ 72 (368 bytes)

Stack: [0x0000ffff2cf90000,0x0000ffff2d190000],  sp=0x0000ffff2d18aae0,  free space=2026k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x7a0f58]  Compile::final_graph_reshaping_main_switch(Node*, Final_Reshape_Counts&, unsigned int)+0x1268
V  [libjvm.so+0x7a1d04]  Compile::final_graph_reshaping_impl(Node*, Final_Reshape_Counts&)+0x1a4
V  [libjvm.so+0x7a227c]  Compile::final_graph_reshaping_walk(Node_Stack&, Node*, Final_Reshape_Counts&)+0xcc
V  [libjvm.so+0x7abc40]  Compile::final_graph_reshaping()+0x3f8
V  [libjvm.so+0x7adee4]  Compile::Optimize()+0xdfc
V  [libjvm.so+0x7af014]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x10a0
V  [libjvm.so+0x61d428]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x114

Comments
Fix Request (13u) The patch is a part of the backport train. It applies cleanly, fastdebug was tested with new patch. Regular tier1 is OK as well
27-05-2020

Checked compiler/loopopts/superword/AlignmentOnePack.java passes in jdk14 atr and latest CI.
30-01-2020

Fix Request (11u) This fixes superfluous compiler failure when fuzzing. Patch applies cleanly to 11u, new test without the patch and passes with it (on aarch64; x86_64 is fine both ways). Passes tier1 on x86_64 and aarch64.
16-09-2019

There seem to be no change related to JDK-8154943 in 8u aarch64-port, so neither 8u nor 8u-aarch64 is affected by this.
16-09-2019

Affected block added by JDK-8154943 in 9.
16-09-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/b2a4b22f8cf2 User: roland Date: 2019-09-12 09:55:43 +0000
12-09-2019

I'm unable to reproduce this on x86. Roland, could you please have a look?
19-08-2019