JDK-8293531 : C2: some vectorapi tests fail assert "Not monotonic" with flag -XX:TypeProfileLevel=222
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18,19,20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-09-08
  • Updated: 2023-01-02
  • Resolved: 2022-10-14
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 17 JDK 20
17.0.7-oracleFixed 20 b20Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
On Platforms: windows-x64, macosx-aarch64, macosx-x64, linux-aarch64

Tests:
compiler/vectorapi/TestMaskedMacroLogicVector.java
compiler/vectorapi/VectorLogicalOpIdentityTest.java
compiler/vectorapi/VectorReplicateLongSpecialImmTest.java
compiler/vectorapi/AllBitsSetVectorMatchRuleTest.java

Using extra flag: -XX:TypeProfileLevel=222

This bug is probably intermittent.

Example assert failure:
Platform: macosx-x64
Test: compiler/vectorapi/TestMaskedMacroLogicVector.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (.../open/src/hotspot/share/opto/phaseX.cpp:1741), pid=28525, tid=42755
#  assert(t->meet(t0) == t) failed: Not monotonic
#
# JRE version: Java(TM) SE Runtime Environment (20.0) (fastdebug build 20-internal-2022-09-07-1816024.emanuel.peter.fork3-jdk)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-internal-2022-09-07-1816024.emanuel.peter.fork3-jdk, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Core dump will be written. Default location: core.28525
#


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

Current thread (0x00007fa0e5826c10):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=42755, stack(0x000070000b087000,0x000070000b187000)]


Current CompileTask:
C2:   2896  490    b        jdk.internal.vm.vector.VectorSupport$VectorPayload::getPayload (8 bytes)

Stack: [0x000070000b087000,0x000070000b187000],  sp=0x000070000b183100,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x12b90a9]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6e9  (phaseX.cpp:1741)
V  [libjvm.dylib+0x12b972b]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x3b
V  [libjvm.dylib+0x6cda5d]  report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
V  [libjvm.dylib+0xfe0ff4]  PhaseCCP::analyze()+0x304
V  [libjvm.dylib+0x6368cb]  Compile::Optimize()+0xe6b
V  [libjvm.dylib+0x634316]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1786
V  [libjvm.dylib+0x51f3f7]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x167
V  [libjvm.dylib+0x651b22]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x702
V  [libjvm.dylib+0x651218]  CompileBroker::compiler_thread_loop()+0x288
V  [libjvm.dylib+0xa1927e]  JavaThread::thread_main_inner()+0x2be
V  [libjvm.dylib+0x120a8e7]  Thread::call_run()+0x177
V  [libjvm.dylib+0xf853af]  thread_native_entry(Thread*)+0x14f
C  [libsystem_pthread.dylib+0x6109]  _pthread_start+0x94
C  [libsystem_pthread.dylib+0x1b8b]  thread_start+0xf
Comments
Fix request [17u] I backport this for parity with 17.0.7-oracle. No risk, changes assertions in C2. Clean backport. SAP nightly testing passed.
31-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1009 Date: 2022-12-30 18:22:42 +0000
30-12-2022

This fix is integrated in jdk-20+20-1404.
15-10-2022

Here's a log file snippet for the jdk-20+20-1384-tier8 sighting: sun/util/calendar/CalendarSystemDeadLockTest.java ----------System.out:(30/2449)---------- # To suppress the following error report, specify this argument # after -XX: or in .hotspotrc: SuppressErrorAt=/phaseX.cpp:1751 # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S94981/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/2eda829a-f85f-45b4-b01c-4a699a3b5266/runs/1e00aff6-1da9-4f23-815e-a776be954226/workspace/open/src/hotspot/share/opto/phaseX.cpp:1751), pid=1647, tid=2001 # assert(t->meet(t0) == t) failed: Not monotonic # # JRE version: Java(TM) SE Runtime Environment (20.0+20) (fastdebug build 20-ea+20-1384) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+20-1384, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x1779b0c] PhaseCCP::analyze()+0x21c # # Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S94880/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f2d5dde7-5d92-4c1c-8d73-649753629249/runs/fecff099-8cfe-4b34-b997-e552360b9713/testoutput/test-support/jtreg_open_test_jdk_jdk_util/scratch/4/core.1647) # # An error report file with more information is saved as: # /opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S94880/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f2d5dde7-5d92-4c1c-8d73-649753629249/runs/fecff099-8cfe-4b34-b997-e552360b9713/testoutput/test-support/jtreg_open_test_jdk_jdk_util/scratch/4/hs_err_pid1647.log pool-1-thread-6 calling sun.util.calendar.CalendarSystem#getGregorianCalendar() pool-1-thread-1 loading sun.util.calendar.Gregorian pool-1-thread-2 loading sun.util.calendar.CalendarSystem pool-1-thread-3 loading java.util.GregorianCalendar pool-1-thread-4 loading java.util.Date pool-1-thread-5 loading java.util.JapaneseImperialCalendar # # Compiler replay data is saved as: # /opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S94880/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f2d5dde7-5d92-4c1c-8d73-649753629249/runs/fecff099-8cfe-4b34-b997-e552360b9713/testoutput/test-support/jtreg_open_test_jdk_jdk_util/scratch/4/replay_pid1647.log # # If you would like to submit a bug report, please visit: # https://bugreport.java.com/bugreport/crash.jsp # ----------System.err:(0/0)---------- Here's the crashing thread's stack: --------------- T H R E A D --------------- Current thread (0x00007fab6f5d7aa0): JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=2001, stack(0x00007fab90186000,0x00007fab90287000)] Current CompileTask: C2: 16847 3398 b java.lang.invoke.StringConcatFactory::generateMHInlineCopy (511 bytes) Stack: [0x00007fab90186000,0x00007fab90287000], sp=0x00007fab90282110, free space=1008k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x1779b0c] PhaseCCP::analyze()+0x21c (phaseX.cpp:1751) V [libjvm.so+0xaee5c1] Compile::Optimize()+0x701 (compile.cpp:2393) V [libjvm.so+0xaf101d] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x15ed (compile.cpp:831) V [libjvm.so+0x909077] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x687 (c2compiler.cpp:113) V [libjvm.so+0xafdcdc] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa9c (compileBroker.cpp:2240) V [libjvm.so+0xafeb08] CompileBroker::compiler_thread_loop()+0x608 (compileBroker.cpp:1916) V [libjvm.so+0x1061da6] JavaThread::thread_main_inner()+0x206 (javaThread.cpp:699) V [libjvm.so+0x1a54f90] Thread::call_run()+0x100 (thread.cpp:224) V [libjvm.so+0x16f1443] thread_native_entry(Thread*)+0x103 (os_linux.cpp:710)
15-10-2022

Changeset: 0043d58c Author: Jatin Bhateja <jbhateja@openjdk.org> Date: 2022-10-14 16:34:48 +0000 URL: https://git.openjdk.org/jdk/commit/0043d58c5d52c3b299a4b6dfcec34a7db5041aea
14-10-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10648 Date: 2022-10-11 12:19:05 +0000
11-10-2022

I was able to locally reproduce it on my linux-x86 machine. ~/Documents/jtreg/build/images/jtreg/bin/jtreg -va -s -jdk:/home/emanuel/Documents/fork-jdk/build/linux-x64-slowdebug/jdk/ -javaoptions:"-XX:TypeProfileLevel=222" /home/emanuel/Documents/fork-jdk/open/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java # Internal Error (/home/emanuel/Documents/fork-jdk/open/src/hotspot/share/opto/phaseX.cpp:1751), pid=1077868, tid=1077882 # assert(t->meet(t0) == t) failed: Not monotonic # # JRE version: Java(TM) SE Runtime Environment (20.0) (slowdebug build 20-internal-2022-10-04-0940200.emanuel...) # Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 20-internal-2022-10-04-0940200.emanuel..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x1140676] ccp_type_widens(Type const*, Type const*)+0x39 I attached the replay file, I can run it like this, and it reproduces: ./java -Xbatch -XX:+ReplayCompiles -XX:ReplayDataFile=replay_VectorLogicalOpIdentityTest.log -XX:+ReplayIgnoreInitErrors -XX:TypeProfileLevel=222
05-10-2022

[~jbhateja] I haven't started working on it yet. Feel free to pick it up.
13-09-2022

[~rcastanedalo], just noticed it after email from Emanuel, is it possible get a system notification over our openjdk emails (jbhateja@openjdk.org) when ever there is a mention on some bug-report. In general iterative DF walks converge if successive iteration are monotonically decreasing (GVN style optimizations) to TOP lattice or monotonically increasing (CCP optimization) towards BOTTOM lattice and such crashes are seen due to incorrect constant value range computations which results into a non-monotonic behavior. I can see its now assigned, please feel free to re-assign to me.
13-09-2022

[~jbhateja], I have asked around I don't think it it possible to change the notification email: mention notifications are always enabled and sent to the email address listed in your profile. Perhaps your email provider is filtering out these emails?
13-09-2022

Ah, turns out JDK-8288194 was not a duplicate of the other bug after all, but it is probably this bug here that has persisted.
12-09-2022

[~jbhateja] since you worked recently in this area (JDK-8287851), would you be willing to have a look at this one?
08-09-2022

The following tests fail intermittently in JDK 17-20 test runs. The Failures occur on all platforms (windows-x64,linux-x64,linux-aarch64,macosx-x64): JDK 17: TestLongVectorNeg.java JDK 18: TestLongVectorNeg.java VectorMemoryAlias.java JDK 19: TestMaskedMacroLogicVector.java VectorMemoryAlias.java VectorReplicateLongSpecialImmTest.java JDK 20: AllBitsSetVectorMatchRuleTest.java TestMaskedMacroLogicVector.java TestReverseByteTransforms.java VectorLogicalOpIdentityTest.java VectorReplicateLongSpecialImmTest.java
08-09-2022

ILW = assertion failure in incubator test code; seen only using full type profile (TypeProfileLevel=222); run default type profile level = MML = P4
08-09-2022