JDK-8284301 : C2: assert(found_opaque == res) failed: wrong pattern
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19,repo-loom
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2022-04-04
  • Updated: 2022-12-12
  • Resolved: 2022-04-05
Related Reports
Duplicate :  
Description
Please find Test.java and FuzzerUtils.java attached. The test have been compiled like this:

$JAVA_HOME/bin/javac --enable-preview --release 19 FuzzerUtils.java Test.java

Only reproduces in Loom debug builds so far. Run requires usage of stress options:

$JAVA_HOME/bin/java -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions \
                    -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM -XX:+StressGCM \
                    -XX:+StressIGVN -XX:+StressCCP -XX:StressSeed=366611729 \
                    -XX:CompileOnly=Test -XX:CompileCommand=quiet -Xmx1G \
                    -Xcomp -Xbatch \
                    Test

It crashes under `CountedLoopNode::is_canonical_loop_entry`. Linux and Windows stack traces are a bit different.

Here's the Linux one:

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

Current thread (0x00007fa10c48e610):
[error occurred during error reporting (printing current thread), id 0xe0000000, Internal Error (/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14585/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/1361aa34-6bbb-4643-8328-9362c5609bdd/runs/ebd544ef-c30e-4148-b2ca-3f787527d6c0/workspace/open/src/hotspot/share/oops/accessBackend.cpp:217)]


Current CompileTask:
C2:    278   21 %  b        Test::mainTest @ 286 (676 bytes)

Stack: [0x00007fa0e39fa000,0x00007fa0e3afb000],  sp=0x00007fa0e3af48d0,  free space=1002k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1458695]  CountedLoopNode::is_canonical_loop_entry()+0x1e5
V  [libjvm.so+0x1989a05]  SuperWord::find_pre_loop_end(CountedLoopNode*) const+0x15
V  [libjvm.so+0x19a1df3]  SuperWord::transform_loop(IdealLoopTree*, bool)+0x563
V  [libjvm.so+0x142301f]  IdealLoopTree::policy_unroll_slp_analysis(CountedLoopNode*, PhaseIdealLoop*, int) [clone .part.0]+0x9f
V  [libjvm.so+0x1428bba]  IdealLoopTree::policy_unroll(PhaseIdealLoop*)+0x7da
V  [libjvm.so+0x1439a1f]  IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x31f
V  [libjvm.so+0x1439da7]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x117
V  [libjvm.so+0x1439ccc]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x3c
V  [libjvm.so+0x1439ccc]  IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x3c
V  [libjvm.so+0x146909f]  PhaseIdealLoop::build_and_optimize()+0xc6f
V  [libjvm.so+0xabd6ba]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x27a
V  [libjvm.so+0xab9e2e]  Compile::Optimize()+0x103e
V  [libjvm.so+0xabc070]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1590
V  [libjvm.so+0x8d2e63]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x683
V  [libjvm.so+0xacb3b7]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xcf7
V  [libjvm.so+0xacc268]  CompileBroker::compiler_thread_loop()+0x6e8
V  [libjvm.so+0x1a3278a]  JavaThread::thread_main_inner()+0x21a
V  [libjvm.so+0x1a3c690]  Thread::call_run()+0x100
V  [libjvm.so+0x16ef784]  thread_native_entry(Thread*)+0x104


Windows adds some more stack frames:

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

Current thread (0x000001d0d0e39940):
[error occurred during error reporting (printing current thread), id 0xe0000000, Internal Error (t:\workspace\open\src\hotspot\share\oops\accessBackend.cpp:218)]


Current CompileTask:
C2:    350   21 %  b        Test::mainTest @ 286 (676 bytes)

Stack: [0x0000003906b00000,0x0000003906c00000]
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0xc4b0c1]  os::platform_print_native_stack+0xf1  (os_windows_x86.cpp:235)
V  [jvm.dll+0xeaf744]  VMError::report+0x1024  (vmError.cpp:828)
V  [jvm.dll+0xeb121e]  VMError::report_and_die+0x7fe  (vmError.cpp:1657)
V  [jvm.dll+0xeb19a4]  VMError::report_and_die+0x64  (vmError.cpp:1438)
V  [jvm.dll+0x5823e7]  report_vm_error+0xb7  (debug.cpp:283)
V  [jvm.dll+0x1fa71]  AccessInternal::check_access_thread_state+0xd1  (accessBackend.cpp:219)
V  [jvm.dll+0x1ef0f]  OopHandle::resolve+0x4f  (oopHandle.inline.hpp:34)
V  [jvm.dll+0xe25f4a]  JavaThread::get_thread_name_string+0x2a  (thread.cpp:2293)
V  [jvm.dll+0xe29cc9]  JavaThread::print_on_error+0x29  (thread.cpp:2230)
V  [jvm.dll+0xeaf4c0]  VMError::report+0xda0  (vmError.cpp:775)
V  [jvm.dll+0xeb121e]  VMError::report_and_die+0x7fe  (vmError.cpp:1657)
V  [jvm.dll+0xeb19a4]  VMError::report_and_die+0x64  (vmError.cpp:1438)
V  [jvm.dll+0x5823e7]  report_vm_error+0xb7  (debug.cpp:283)
V  [jvm.dll+0xabb113]  CountedLoopNode::is_canonical_loop_entry+0x243  (loopnode.cpp:5440)
V  [jvm.dll+0xdbd6ec]  SuperWord::find_pre_loop_end+0x1c  (superword.cpp:3633)
V  [jvm.dll+0xdc9361]  SuperWord::transform_loop+0x301  (superword.cpp:159)
V  [jvm.dll+0xaa209d]  IdealLoopTree::policy_unroll_slp_analysis+0x15d  (loopTransform.cpp:1061)
V  [jvm.dll+0xaa1d4a]  IdealLoopTree::policy_unroll+0x6fa  (loopTransform.cpp:1016)
V  [jvm.dll+0xa9d703]  IdealLoopTree::iteration_split_impl+0x403  (loopTransform.cpp:3632)
V  [jvm.dll+0xa9d1c0]  IdealLoopTree::iteration_split+0x160  (loopTransform.cpp:3722)
V  [jvm.dll+0xa9d08f]  IdealLoopTree::iteration_split+0x2f  (loopTransform.cpp:3706)
V  [jvm.dll+0xa9d08f]  IdealLoopTree::iteration_split+0x2f  (loopTransform.cpp:3706)
V  [jvm.dll+0xaab4c7]  PhaseIdealLoop::build_and_optimize+0x10e7  (loopnode.cpp:4497)
V  [jvm.dll+0x51090a]  Compile::Optimize+0x114a  (compile.cpp:2267)
V  [jvm.dll+0x50d737]  Compile::Compile+0x14b7  (compile.cpp:810)
V  [jvm.dll+0x433605]  C2Compiler::compile_method+0x145  (c2compiler.cpp:115)
V  [jvm.dll+0x526ee4]  CompileBroker::invoke_compiler_on_method+0x784  (compileBroker.cpp:2294)
V  [jvm.dll+0x524486]  CompileBroker::compiler_thread_loop+0x276  (compileBroker.cpp:1968)
V  [jvm.dll+0xe2ccff]  JavaThread::thread_main_inner+0x29f  (thread.cpp:1329)
V  [jvm.dll+0xe22024]  Thread::call_run+0x1b4  (thread.cpp:362)
V  [jvm.dll+0xc49929]  thread_native_entry+0xb9  (os_windows.cpp:544)
C  [ucrtbase.dll+0x1fb80]
C  [KERNEL32.DLL+0x84d4]
C  [ntdll.dll+0x51791]
Comments
Same exact backtrace as JDK-8269820, closing as duplicate.
05-04-2022

Same assert as JDK-8269820
05-04-2022