JDK-8297264 : C2: Cast node is not processed again in CCP and keeps a wrong too narrow type which is later replaced by top
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18,19,20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2022-11-18
  • Updated: 2022-12-05
  • Resolved: 2022-12-05
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 20
20 masterFixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The following test failed in the JDK20 CI:

applications/javafuzzer/MediumTest.java

Here's a snippet from the log file:

Summary of the JavaFuzzer run:
------------------------------
Host:     ol8-x64-123246
Tests:    12 x 50
Args:     -conf config.yml

Started  at: Fri Nov 18 02:23:43 UTC 2022


r4- 50: 33 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 17 Reference Java failures
r3- 50: 38 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 12 Reference Java failures
r11- 50: 27 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 23 Reference Java failures
r8- 50: 36 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 14 Reference Java failures
r12- 50: 28 passed, 2 crashes, 0 fails, 0 hangs, 0 incorrect tests, 21 Reference Java failures
r1- 50: 34 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 16 Reference Java failures
r7- 50: 36 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 14 Reference Java failures
r2- 50: 33 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 17 Reference Java failures
r10- 50: 29 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 21 Reference Java failures
r6- 50: 29 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 21 Reference Java failures
r9- 50: 31 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 19 Reference Java failures
r5- 50: 28 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 22 Reference Java failures

Finished at: Fri Nov 18 03:51:22 UTC 2022


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S122514/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ccc22c45-6ee4-44e3-a220-fcb16ee5313c/runs/d541d200-a135-4df8-9627-2aff32b06bf0/workspace/open/src/hotspot/share/opto/block.cpp:1357), pid=1409813, tid=1409840
#  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 (20.0+24) (fastdebug build 20-ea+24-1796)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+24-1796, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x76ba81]  PhaseCFG::verify() const+0x1d1
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /tmp/fuzzer.tmp.BfribQfP9J/core.1409813)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S122514/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ccc22c45-6ee4-44e3-a220-fcb16ee5313c/runs/d541d200-a135-4df8-9627-2aff32b06bf0/workspace/open/src/hotspot/share/opto/block.cpp:1357), pid=1410177, tid=1410192
#  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 (20.0+24) (fastdebug build 20-ea+24-1796)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+24-1796, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x76ba81]  PhaseCFG::verify() const+0x1d1
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /tmp/fuzzer.tmp.BfribQfP9J/core.1410177)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

[2022-11-18T03:51:22.333950639Z] Waiting for completion for process 1404536
[2022-11-18T03:51:22.334143063Z] Waiting for completion finished for process 1404536
----------System.err:(13/728)----------
java.lang.RuntimeException: assertEquals: expected 1 to equal 2
	at jdk.test.lib.Asserts.fail(Asserts.java:594)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:189)
	at applications.javafuzzer.JavaFuzzerRunner.main(JavaFuzzerRunner.java:245)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:1591)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: assertEquals: expected 1 to equal 2


Here's the crashing thread's stack from hs_err_pid1409813.log:

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

Current thread (0x00007f1d3433d2a0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=1409840, stack(0x00007f1d0b726000,0x00007f1d0b827000)]


Current CompileTask:
C2:    377   12    b  4       Test::vMeth1 (274 bytes)

Stack: [0x00007f1d0b726000,0x00007f1d0b827000],  sp=0x00007f1d0b821fa0,  free space=1007k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x76ba81]  PhaseCFG::verify() const+0x1d1  (block.cpp:1357)
V  [libjvm.so+0xaf4d84]  Compile::Code_Gen()+0x2d4  (compile.cpp:2949)
V  [libjvm.so+0xafad6d]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x19ad  (compile.cpp:864)
V  [libjvm.so+0x90b167]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4e7  (c2compiler.cpp:113)
V  [libjvm.so+0xb07d7c]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa7c  (compileBroker.cpp:2237)
V  [libjvm.so+0xb08b88]  CompileBroker::compiler_thread_loop()+0x608  (compileBroker.cpp:1916)
V  [libjvm.so+0x107b776]  JavaThread::thread_main_inner()+0x206  (javaThread.cpp:699)
V  [libjvm.so+0x1a7afc0]  Thread::call_run()+0x100  (thread.cpp:224)
V  [libjvm.so+0x1712143]  thread_native_entry(Thread*)+0x103  (os_linux.cpp:710)
Comments
Changeset: a5739239 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2022-12-05 07:09:04 +0000 URL: https://git.openjdk.org/jdk/commit/a57392390b0abe5db496775efcc369bafdf420f1
05-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11448 Date: 2022-12-01 09:37:57 +0000
01-12-2022

Starts to fail after JDK-8269752.
30-11-2022

Most likely unrelated to JDK-8288981, as it also triggers with -XX:-UseLoopPredicate and we are not applying RangeCheckElimination.
21-11-2022

Might be related to JDK-8288981 as well. I'll have a look. ILW = C2 assertion due to broken graph, single fuzzer test, disable compilation of affected method = HLM = P3
18-11-2022

The same assert failure is mentioned in the following bug: JDK-8291025 Jtreg compiler/loopopts/TestUnreachableInnerLoop.java fails with MaxVectorSize=8 but it is for a different test with different options so I didn't add this sighting to that bug.
18-11-2022