Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8284951

Compile::flatten_alias_type asserts with "indeterminate pointers come only from unsafe ops"

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b20

      Description

      Running the JVM with the combination of flags "-Xcomp -XX:-InlineUnsafeOps -XX:-ReduceInitialCardMarks -XX:+StressReflectiveCode" yields the following assertion failure:

      # A fatal error has been detected by the Java Runtime Environment:
      (...)
      # assert(InlineUnsafeOps) failed: indeterminate pointers come only from unsafe ops
      #
      # JRE version: Java(TM) SE Runtime Environment (19.0+18) (fastdebug build 19-ea+18-1211)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 19-ea+18-1211, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xa9b56c] Compile::flatten_alias_type(TypePtr const*) const+0xf2c
      (...)

      The failure is *not* specific for the attached code, it can be reproduced just by starting up the JVM.

      HOW TO REPRODUCE:

      - JDK 11 (fastdebug):

      $ java -Xcomp -XX:-InlineUnsafeOps -XX:-ReduceInitialCardMarks -XX:+StressReflectiveCode -XX:CompileCommand=compileonly,*::clone

      (...)
      assert(InlineUnsafeOps) failed: indeterminate pointers come only from unsafe ops
      (...)

      - JDK 17, 18, 19b18 (fastdebug):

      $ java -Xcomp -XX:-InlineUnsafeOps -XX:-ReduceInitialCardMarks -XX:+StressReflectiveCode -XX:CompileCommand=compileonly,*::resolve

      ORIGINAL REPORT FROM WEBBUG GROUP:

      ADDITIONAL SYSTEM INFORMATION :
      OS: Ubuntu18.04
      jdk11
      $ java -version
      openjdk version "11.0.15-internal" 2022-04-19
      OpenJDK Runtime Environment (fastdebug build 11.0.15-internal+0-adhoc.user.jdk11u)
      OpenJDK 64-Bit Server VM (fastdebug build 11.0.15-internal+0-adhoc.user.jdk11u, mixed mode, sharing)

      jdk17
      $ java -version
      openjdk version "17.0.3-internal" 2022-04-19
      OpenJDK Runtime Environment (fastdebug build 17.0.3-internal+0-adhoc.user.jdk17u)
      OpenJDK 64-Bit Server VM (fastdebug build 17.0.3-internal+0-adhoc.user.jdk17u, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      JVM crashed when running the following test under jdk11 and jdk17.
      Reproduce:
      $ java -Xcomp -XX:-InlineUnsafeOps -XX:-InlineMethodsWithExceptionHandlers -XX:-ReduceInitialCardMarks -XX:+StressReflectiveCode Test
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/home/user/jdk_source/jdk11u/src/hotspot/share/opto/compile.cpp:1439), pid=42185, tid=42197
      # assert(InlineUnsafeOps) failed: indeterminate pointers come only from unsafe ops
      #
      # JRE version: OpenJDK Runtime Environment (11.0.15) (fastdebug build 11.0.15-internal+0-adhoc.user.jdk11u)
      # Java VM: OpenJDK 64-Bit Server VM (fastdebug 11.0.15-internal+0-adhoc.user.jdk11u, compiled mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
      # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # 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 ------------

      Command Line: -Xcomp -XX:-InlineUnsafeOps -XX:-InlineMethodsWithExceptionHandlers -XX:-ReduceInitialCardMarks -XX:+StressReflectiveCode Test

      Host: wen-PowerEdge-R740, Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz, 96 cores, 251G, Ubuntu 18.04.6 LTS
      Time: Thu Apr 14 15:24:29 2022 CST elapsed time: 3.861922 seconds (0d 0h 0m 3s)

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

      Current thread (0x00007fc128639000): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=42197, stack(0x00007fc0b453b000,0x00007fc0b463c000)]


      Current CompileTask:
      C2: 3861 1507 !b 4 java.lang.invoke.MemberName::clone (14 bytes)

      Stack: [0x00007fc0b453b000,0x00007fc0b463c000], sp=0x00007fc0b46363f0, 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+0x18de9ca] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x1ca
      V [libjvm.so+0x18dfabf] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x2f
      V [libjvm.so+0xb4cb80] report_vm_error(char const*, int, char const*, char const*, ...)+0x100
      V [libjvm.so+0xa5be33] Compile::flatten_alias_type(TypePtr const*) const+0xdd3
      V [libjvm.so+0xa65dd6] Compile::find_alias_type(TypePtr const*, bool, ciField*)+0x76
      V [libjvm.so+0x1306d78] PhaseMacroExpand::generate_arraycopy(ArrayCopyNode*, AllocateArrayNode*, Node**, MergeMemNode*, Node**, TypePtr const*, BasicType, Node*, Node*, Node*, Node*, Node*, bool, bool, RegionNode*)+0x98
      V [libjvm.so+0x1309acb] PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode*)+0x23b
      V [libjvm.so+0x12fea50] PhaseMacroExpand::expand_macro_nodes()+0x940
      V [libjvm.so+0xa6f995] Compile::Optimize()+0xc15
      V [libjvm.so+0xa70c7f] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x107f
      V [libjvm.so+0x87377b] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xfb
      V [libjvm.so+0xa7e2d0] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x390
      V [libjvm.so+0xa7f298] CompileBroker::compiler_thread_loop()+0x418
      V [libjvm.so+0x181006b] JavaThread::thread_main_inner()+0x20b
      V [libjvm.so+0x180bea5] Thread::call_run()+0x75
      V [libjvm.so+0x151cb06] thread_native_entry(Thread*)+0x106





      ---------- BEGIN SOURCE ----------
      Download TestStressReflectiveCode.zip from:
      https://drive.google.com/file/d/1lW_IonDXEb-pSk7xttZPkl2rBTC0uXad/view?usp=sharing
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thartmann Tobias Hartmann
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: