JDK-8305189 : C2 failed "assert(_outcnt==1) failed: not unique"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20,21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2023-03-29
  • Updated: 2023-07-10
  • Resolved: 2023-05-26
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 21
21 b25Fixed
Related Reports
Relates :  
Relates :  
Description
The following test failed in the JDK21 CI:

applications/javafuzzer/BigTest.java

Here's a snippet from the log file:

Summary of the JavaFuzzer run:
------------------------------
Host:     win2016-x64-318369
Tests:    12 x 300
Args:     -conf config.yml

Started  at: Wed Mar 29 00:39:56 GMT 2023


r2- 300: 195 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 105 Reference Java failures
r3- 300: 186 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 114 Reference Java failures
r8- 300: 193 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 107 Reference Java failures
r5- 300: 190 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 110 Reference Java failures
r7- 300: 190 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 110 Reference Java failures
r11- 300: 187 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 113 Reference Java failures
r9- 300: 195 passed, 2 crashes, 0 fails, 0 hangs, 0 incorrect tests, 104 Reference Java failures
r6- 300: 177 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 123 Reference Java failures
r10- 300: 193 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 107 Reference Java failures
r4- 300: 180 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 120 Reference Java failures
r12- 300: 189 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 111 Reference Java failures
r1- 300: 172 passed, 0 crashes, 0 fails, 0 hangs, 0 incorrect tests, 128 Reference Java failures

Finished at: Wed Mar 29 09:12:11 GMT 2023


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (c:\\sb\\prod\\1679905400\\workspace\\open\\src\\hotspot\\share\\opto/node.hpp:399), pid=25280, tid=33752
#  assert(_outcnt==1) failed: not unique
#
# JRE version: Java(TM) SE Runtime Environment (21.0+16) (fastdebug build 21-ea+16-LTS-1273)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 21-ea+16-LTS-1273, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Core dump will be written. Default location: C:\\sb\\prod\\1680050168\\testoutput\\test-support\\jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_BigTest_java\\tmp\\fuzzer.tmp.j9KE0q2XuQ\\hs_err_pid25280.mdmp
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

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


----------System.err:(51/4106)*----------
java.nio.charset.MalformedInputException: Input length = 1
	at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
	at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:388)
	at java.base/sun.nio.cs.StreamDecoder.lockedRead(StreamDecoder.java:219)
	at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:173)
	at java.base/java.io.InputStreamReader.read(InputStreamReader.java:189)
	at java.base/java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.base/java.io.BufferedReader.implReadLine(BufferedReader.java:371)
	at java.base/java.io.BufferedReader.readLine(BufferedReader.java:348)
	at java.base/java.io.BufferedReader.readLine(BufferedReader.java:437)
	at java.base/java.nio.file.Files.readAllLines(Files.java:3390)
	at java.base/java.nio.file.Files.readAllLines(Files.java:3428)
	at applications.javafuzzer.JavaFuzzerRunner.lambda$main$2(JavaFuzzerRunner.java:233)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1924)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at applications.javafuzzer.JavaFuzzerRunner.main(JavaFuzzerRunner.java:231)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	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:1623)
java.lang.RuntimeException: Failed to access C:\\sb\\prod\\1680050168\\testoutput\\test-support\\jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_BigTest_java\\scratch\\0\\crashes\\r9-250\\hs_err_pid25280.mdmp
	at applications.javafuzzer.JavaFuzzerRunner.lambda$main$2(JavaFuzzerRunner.java:237)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1924)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at applications.javafuzzer.JavaFuzzerRunner.main(JavaFuzzerRunner.java:231)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	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:1623)

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


Here's the crashing thread's stack:

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

Current thread (0x00000147cc6b1f40):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=33752, stack(0x0000001238400000,0x0000001238500000)]


Current CompileTask:
C2:    690   10   !b  4       Test::vMeth1 (207 bytes)

Stack: [0x0000001238400000,0x0000001238500000]
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0xbf4331]  os::win32::platform_print_native_stack+0xf1  (os_windows_x86.cpp:236)
V  [jvm.dll+0xe6f4b0]  VMError::report+0x10c0  (vmError.cpp:814)
V  [jvm.dll+0xe71065]  VMError::report_and_die+0x645  (vmError.cpp:1587)
V  [jvm.dll+0xe71774]  VMError::report_and_die+0x64  (vmError.cpp:1352)
V  [jvm.dll+0x578419]  report_vm_error+0x79  (debug.cpp:181)
V  [jvm.dll+0xc3c8be]  PhaseCCP::push_more_uses+0x5ee  (phaseX.cpp:2062)
V  [jvm.dll+0xc393dd]  PhaseCCP::analyze+0x75d  (phaseX.cpp:1991)
V  [jvm.dll+0xc35bff]  PhaseCCP::PhaseCCP+0x10f  (phaseX.cpp:1933)
V  [jvm.dll+0x50cb91]  Compile::Optimize+0xca1  (compile.cpp:2373)
V  [jvm.dll+0x509e4e]  Compile::Compile+0x174e  (compile.cpp:841)
V  [jvm.dll+0x427ec5]  C2Compiler::compile_method+0x145  (c2compiler.cpp:121)
V  [jvm.dll+0x524519]  CompileBroker::invoke_compiler_on_method+0x849  (compileBroker.cpp:2268)
V  [jvm.dll+0x521bdd]  CompileBroker::compiler_thread_loop+0x24d  (compileBroker.cpp:1945)
V  [jvm.dll+0x7ed072]  JavaThread::thread_main_inner+0x282  (javaThread.cpp:711)
V  [jvm.dll+0xde4453]  Thread::call_run+0x253  (thread.cpp:229)
V  [jvm.dll+0xbf2c28]  os::win32::thread_native_entry+0xb8  (os_windows.cpp:551)
C  [ucrtbase.dll+0x1fb80]
C  [KERNEL32.DLL+0x84d4]
C  [ntdll.dll+0x51791]
Comments
Changeset: bac02b6e Author: Roland Westrelin <roland@openjdk.org> Date: 2023-05-26 09:04:31 +0000 URL: https://git.openjdk.org/jdk/commit/bac02b6e9d9e1e93db27c7888188f29631e07f47
26-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13901 Date: 2023-05-10 11:27:06 +0000
10-05-2023

I've attached a reduced version Reduced.java of Test.java: $ java -Xcomp -XX:CompileOnly=Reduced Reduced.java
30-03-2023

The regression seems to have been introduced by this changeset: commit a0a09d56ba4fc6133b423ad29d86fc99dd6dc19b Author: Roland Westrelin <roland@openjdk.org> Date: Thu Dec 22 08:56:00 2022 +0000 8298176: remove OpaqueZeroTripGuardPostLoop once main-loop disappears Reviewed-by: thartmann, chagedorn, kvn [~roland], please take a look.
30-03-2023

ILW = C2 assertion; single Java Fuzzer test case, debug build; disable compilation of affected method = HLM = P3
30-03-2023

Reproduces in jdk-21+4-184 but not jdk-21+3-124, 20+36-2344 but not jdk-20+27-2213
30-03-2023