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

C2: Vector constant materialization attempt

    XMLWordPrintable

Details

    • b01
    • x86_64
    • linux_ubuntu

    Backports

      Description

        ADDITIONAL SYSTEM INFORMATION :
        Arch: x86_64
        OS: Ubuntu 20.04.4 LTS
        HotSpot
        - openjdk version "11.0.17-internal" 2022-10-18
        - OpenJDK Runtime Environment (fastdebug build 11.0.17-internal+0-adhoc.congli.my-jdk11u)
        - OpenJDK 64-Bit Server VM (fastdebug build 11.0.17-internal+0-adhoc.congli.my-jdk11u, mixed mode)
        javac: javac 11.0.17-internal

        A DESCRIPTION OF THE PROBLEM :
        The problem was found in the repo https://github.com/openjdk/jdk11u-dev (commit f915a327), OpenJDK 11.0.17 (internal).

        **Note**
        1. The given test may take **~1min** to make HotSpot crash. So please be patient.
        2. Sorry, we cannot reduce the test further otherwise it cannot be reproduced.

        The following is part of the log:
        ```
        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/zdata/congli/my-jdk11u/src/hotspot/share/opto/matcher.cpp:1591), pid=3346525, tid=3346783
        # assert(false) failed: bad AD file
        #
        # JRE version: OpenJDK Runtime Environment (11.0.17) (fastdebug build 11.0.17-internal+0-adhoc.congli.my-jdk11u)
        # Java VM: OpenJDK 64-Bit Server VM (fastdebug 11.0.17-internal+0-adhoc.congli.my-jdk11u, mixed mode, 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: -Xmx1G -Xbatch Test

        Host: amdsuplus3.inf.ethz.ch, AMD Ryzen Threadripper 3990X 64-Core Processor, 128 cores, 251G, Ubuntu 20.04.4 LTS
        Time: Tue Jun 21 18:15:28 2022 CEST elapsed time: 1.182462 seconds (0d 0h 0m 1s)

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

        Current thread (0x00007fddd86ed800): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=3346783, stack(0x00007fdda4513000,0x00007fdda4614000)]


        Current CompileTask:
        C2: 1182 122 !b 4 Test::lMeth (198 bytes)

        Stack: [0x00007fdda4513000,0x00007fdda4614000], sp=0x00007fdda460ea70, free space=1006k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x1a756ca] 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+0x1a76835] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x35
        V [libjvm.so+0xc3626a] report_vm_error(char const*, int, char const*, char const*, ...)+0x10a
        V [libjvm.so+0x1518490] Matcher::Label_Root(Node const*, State*, Node*, Node*&)+0x5c0
        V [libjvm.so+0x15184fa] Matcher::Label_Root(Node const*, State*, Node*, Node*&)+0x62a
        V [libjvm.so+0x15184fa] Matcher::Label_Root(Node const*, State*, Node*, Node*&)+0x62a
        V [libjvm.so+0x1518f1b] Matcher::match_tree(Node const*)+0x1bb
        V [libjvm.so+0x151db92] Matcher::xform(Node*, int)+0xd42
        V [libjvm.so+0x15222d8] Matcher::match()+0xbf8
        V [libjvm.so+0xb46065] Compile::Code_Gen()+0xb5
        V [libjvm.so+0xb4c1ae] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1bbe
        V [libjvm.so+0x91bfc4] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x334
        V [libjvm.so+0xb5d210] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x540
        V [libjvm.so+0xb5e8b8] CompileBroker::compiler_thread_loop()+0x678
        V [libjvm.so+0x19ab8d2] JavaThread::thread_main_inner()+0x252
        V [libjvm.so+0x19a42ab] Thread::call_run()+0x7b
        V [libjvm.so+0x169a5b6] thread_native_entry(Thread*)+0x106
        ```

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. javac Test.java
        2. java -Xmx1G -Xbatch Test

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        No crashes
        ACTUAL -
        Crashed

        ---------- BEGIN SOURCE ----------
        class Test {
          int N;
          int iFld;

          static long lMeth(int i, double d1, int i1) {
            int i21;
            float f2 = 54.993F;
            for (i21 = 5; i21 < 125; ++i21) {
              int i28 = 4;
              f2 += 65008;
              java.io.PrintStream ax$7 = System.out;
              java.io.PrintStream ax$8 = System.err;
              java.io.PrintStream ax$9 =
                  new java.io.PrintStream(
                      new java.io.OutputStream() {
                        public void write(int b) {}
                      });
              System.setOut(ax$9);
              for (int ax$5 = -3790; ax$5 < 3069; ax$5 += 1) {
                int ax$3 = i28;
                try {
                  int[] ax$1 = {10, 20, 45, 38, 88};
                  int[] ax$0 = new int[20];
                  for (int ax$2 = 0; ax$2 < ax$0.length && ax$2 < ax$1.length; ax$2++)
                    i28 += ax$0[ax$2] + ax$1[ax$2];
                } finally {
                  i28 = ax$3;
                }
              }
              System.setOut(ax$7);
              System.setErr(ax$8);
            }
            long meth_res = Float.floatToIntBits(f2);
            return meth_res;
          }

          void mainTest(String[] strArr1) {
            double d = 2.2304;
            N <<= lMeth(iFld, d, iFld);
          }

          public static void main(String[] strArr) {
            Test _instance = new Test();
            for (int i; ; ) _instance.mainTest(strArr);
          }
        }
        ---------- END SOURCE ----------

        FREQUENCY : always


        Attachments

          1. hotspot-bug-85.tar.gz
            60 kB
          2. Test.java
            1 kB
          3. Test-1.java
            2 kB

          Issue Links

            Activity

              People

                vlivanov Vladimir Ivanov
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: