JDK-8266480 : Implicit null check optimization does not update control of hoisted memory operation
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-05-04
  • Updated: 2021-08-09
  • Resolved: 2021-05-19
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 17
11.0.13-oracleFixed 17 b23Fixed
Related Reports
Relates :  
Relates :  
Description
The attached fuzzer test fails with the following assert added by JDK-8263227.

To reproduce:
java Reduced.java
java Test.java
java -Xcomp -XX:CompileOnly=Test Test.java
java -Xcomp -XX:-TieredCompilation -XX:CompileOnly=Test Test.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/3c846bae-ce30-4a97-93ee-9fef4497ccb6-S78979/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/0f80cbd2-a728-42dc-9216-fe14980e7b24/runs/2a62fb6d-bc5a-4195-b939-5f5cb5c45844/workspace/open/src/hotspot/share/opto/block.cpp:1252), pid=13693, tid=13712
#  assert(n->is_Root() || n->is_Region() || n->is_Phi() || n->is_MachMerge() || def_block->dominates(block)) failed: uses must be dominated by definitions
#
# JRE version: Java(TM) SE Runtime Environment (17.0+20) (fastdebug build 17-ea+20-LTS-1743)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-ea+20-LTS-1743, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x6c9939]  PhaseCFG::verify() const+0x1e9
............
Command Line: -Xmx1G Test
............
Current thread (0x00007fb620089d20):  JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=13712, stack(0x00007fb651cf4000,0x00007fb651df5000)]


Current CompileTask:
C2:    435   40 % !   4       Test::mainTest @ 229 (504 bytes)

Stack: [0x00007fb651cf4000,0x00007fb651df5000],  sp=0x00007fb651df0250,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x6c9939]  PhaseCFG::verify() const+0x1e9
V  [libjvm.so+0xa315bf]  Compile::Code_Gen()+0x2af
V  [libjvm.so+0xa3d727]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x2337
V  [libjvm.so+0x85f6ea]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1ea
V  [libjvm.so+0xa4d7f9]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xfb9
V  [libjvm.so+0xa4e568]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x18b5021]  JavaThread::thread_main_inner()+0x271
V  [libjvm.so+0x18bc950]  Thread::call_run()+0x100
V  [libjvm.so+0x159388e]  thread_native_entry(Thread*)+0x10e
Comments
Regression test compiler/c2/TestImplicitNullCheckDominance.java passed in JDK17 ATR
09-08-2021

Fix Request (11u) Should get backported for parity with 11.0.13-oracle. Applies cleanly.
24-06-2021

Changeset: c2b50f93 Author: Tobias Hartmann <thartmann@openjdk.org> Date: 2021-05-19 07:27:30 +0000 URL: https://git.openjdk.java.net/jdk/commit/c2b50f93ac36cdfd96d3ed09ec80ee5255a10200
19-05-2021

Attached another test (MainClass.java) that reproduces this issue.
07-05-2021