JDK-8224538 : LoadBarrierNode::common_barrier must check address
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-05-21
  • Updated: 2019-09-04
  • Resolved: 2019-05-31
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.6-oracleFixed 13 b24Fixed 14Fixed
Description
Test failed with:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (open/src/hotspot/share/opto/loopnode.cpp:4290), pid=14679, tid=14702
#  assert(false) failed: Bad graph detected in build_loop_late
#
# JRE version: Java(TM) SE Runtime Environment (13.0) (fastdebug build 13-ea+0-1087)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 13-ea+0-1087, mixed mode, tiered, z gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x11cd35e]  PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x1ae
#
# Core dump will be written. Default location: /scratch/opt/mach5/mesos/work_dir/slaves/df27b84d-b5c1-4760-9e48-df95fd33274c-S335/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/24d17770-13ae-4f2d-b678-d8b690c77017/runs/6f93ecf9-e93d-4388-aec3-8ca98f4e2994/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_runthese_RunThese30M_java/scratch/0/core.14679
#
# 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: -XX:MaxRAMPercentage=6 -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/java.net=ALL-UNNAMED -Dseed=1930280158556725 -XX:MaxRAMPercentage=50 applications.runthese.Runner -duration 30 -runlist /scratch/opt/mach5/mesos/work_dir/slaves/df27b84d-b5c1-4760-9e48-df95fd33274c-S335/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/24d17770-13ae-4f2d-b678-d8b690c77017/runs/6f93ecf9-e93d-4388-aec3-8ca98f4e2994/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_runthese_RunThese30M_java/scratch/0/./RunTheseTestList.dat

Host: Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz, 8 cores, 59G, Oracle Linux Server release 7.1
Time: Tue May 21 14:21:37 2019 UTC elapsed time: 1620 seconds (0d 0h 27m 0s)

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

Current thread (0x00007fd468299500):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=14702, stack(0x00007fd239bfc000,0x00007fd239cfd000)]


Current CompileTask:
C2:1620242 233514   !   4       javasoft.sqe.tests.api.java.util.concurrent.TreeMapTest::check (406 bytes)

Stack: [0x00007fd239bfc000,0x00007fd239cfd000],  sp=0x00007fd239cf7340,  free space=1004k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x11cd35e]  PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x1ae
V  [libjvm.so+0x11cda65]  PhaseIdealLoop::build_loop_late(VectorSet&, Node_List&, Node_Stack&)+0xd5
V  [libjvm.so+0x11d27e1]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x771
V  [libjvm.so+0x9c1642]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x2a2
V  [libjvm.so+0x9be831]  Compile::Optimize()+0xb11
V  [libjvm.so+0x9c004a]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x119a
V  [libjvm.so+0x8018bd]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x10d
V  [libjvm.so+0x9cca1d]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x46d
V  [libjvm.so+0x9cda18]  CompileBroker::compiler_thread_loop()+0x3b8
V  [libjvm.so+0x16be6aa]  JavaThread::thread_main_inner()+0x26a
V  [libjvm.so+0x16c6cd7]  JavaThread::run()+0x227
V  [libjvm.so+0x16c3e06]  Thread::call_run()+0xf6
V  [libjvm.so+0x13df1ae]  thread_native_entry(Thread*)+0x10e

Comments
Fix Request (11u) This fixes the ZGC failure. Patch applies cleanly to 11u, passes tier1 and hotspot_gc (with ZGC).
04-09-2019

Should we file a new bug for the non-ZGC failure then? Update: I've filed JDK-8224957 for the non-ZGC related failures.
29-05-2019

http://cr.openjdk.java.net/~neliasso/8224538/webrev.01
28-05-2019

Common_barriers is horribly broken. It tries to find a dominating point for two barriers and common them to that point. But it doesn't check that the address edge can float up to that point. It the crashing IR the address is pinned further down leading to a use before def. I am considering to remove this code. That should be enough for a backport.
27-05-2019

Its "common_barriers(PhaseIdealLoop* phase, LoadBarrierNode* lb)" called from void "ZBarrierSetC2::loop_optimize_gc_barrier(PhaseIdealLoop* phase, Node* node, bool last_round)" that causes the bad IR.
27-05-2019

The first crash in this report repros with ZGC but not without. My late barrier insertion patch, that is out on review, fixes the problem.
27-05-2019

Okay, this does not seem to be ZGC specific then. Removing the label.
27-05-2019

I see a very similar failure without ZGC: # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (open/src/hotspot/share/opto/loopnode.cpp:4290), pid=25095, tid=25126 # assert(false) failed: Bad graph detected in build_loop_late # # JRE version: Java(TM) SE Runtime Environment (13.0) (fastdebug build 13-ea+0-1128) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 13-ea+0-1128, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x11d0ece] PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x1ae # # Core dump will be written. Default location: scratch/0/core.25095 # ... Stack: [0x00007fc96006f000,0x00007fc960170000], sp=0x00007fc96016a340, free space=1004k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x11d0ece] PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x1ae V [libjvm.so+0x11d15d5] PhaseIdealLoop::build_loop_late(VectorSet&, Node_List&, Node_Stack&)+0xd5 V [libjvm.so+0x11d6351] PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x771 V [libjvm.so+0x9c3112] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x2a2 V [libjvm.so+0x9bfcff] Compile::Optimize()+0x3cf V [libjvm.so+0x9c1b6a] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x11ba V [libjvm.so+0x802c4d] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x10d V [libjvm.so+0x9ce4ed] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x46d V [libjvm.so+0x9cf4e8] CompileBroker::compiler_thread_loop()+0x3b8 V [libjvm.so+0x16c2dba] JavaThread::thread_main_inner()+0x26a V [libjvm.so+0x16cb367] JavaThread::run()+0x227 V [libjvm.so+0x16c8496] Thread::call_run()+0xf6 V [libjvm.so+0x13e38be] thread_native_entry(Thread*)+0x10e
24-05-2019

Sure. This one looks familiar.
23-05-2019

Nils, could you please have a look?
22-05-2019

ILW = Assert during C2 compilation (loop opts), intermittent with ZGC, use different GC (assuming the bug is ZGC specific) = HLM = P3
22-05-2019