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

Duplicate simple loop back-edge will crash the vm

    XMLWordPrintable

Details

    • b16

    Description

      After https://bugs.openjdk.org/browse/JDK-8279888, the following simple Test crashes.

      class Foo {
        static void c(Byte[] a, Byte d) {
          for (int e = 0; e < a.length; e++)
            a[e] = 0;
        }
      }
      class Test {
        int f(int g) {
          Byte h[] = new Byte[500];
          Foo.c(h, (byte)4);
          short i = 7;
          while (i != 1)
            i = (short)(i - 3);
          return 0;
        }
        void j(String[] k) {
          try {
            int l = 5;
            if (l < f(l))
              ;
          } catch (Exception m) {
          }
        }
        public static void main(String[] args) {
          try {
            Test n = new Test();
            for (int i=0;i <10000;i++)
              n.j(args);
          } catch (Exception ex) {
          }
        }
      }


      The crash log is:

      Current CompileTask:
      C2: 315 24 ! 4 Test::j (16 bytes)

      Stack: [0x00007fe32b3da000,0x00007fe32b4db000], sp=0x00007fe32b4d4e00, free space=1003k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x429e55] Node::in(unsigned int) const+0x13 (node.hpp:391)
      V [libjvm.so+0xf4bd74] PhaseIdealLoop::verify_strip_mined_scheduling(Node*, Node*)+0xc2 (loopnode.cpp:5733)
      V [libjvm.so+0xf4ca24] PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0xa50 (loopnode.cpp:5926)
      V [libjvm.so+0xf4bfd0] PhaseIdealLoop::build_loop_late_post(Node*)+0x28 (loopnode.cpp:5760)
      V [libjvm.so+0xf4bc54] PhaseIdealLoop::build_loop_late(VectorSet&, Node_List&, Node_Stack&)+0x248 (loopnode.cpp:5706)
      V [libjvm.so+0xf464e1] PhaseIdealLoop::build_and_optimize()+0xa95 (loopnode.cpp:4387)
      V [libjvm.so+0x8a0df4] PhaseIdealLoop::PhaseIdealLoop(PhaseIterGVN&, PhaseIdealLoop const*)+0xca (loopnode.hpp:1100)
      V [libjvm.so+0x8a0eac] PhaseIdealLoop::verify(PhaseIterGVN&)+0x63 (loopnode.hpp:1158)
      V [libjvm.so+0x894777] Compile::Optimize()+0xcb5 (compile.cpp:2379)
      V [libjvm.so+0x88d69a] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x13cc (compile.cpp:823)
      V [libjvm.so+0x77e6e4] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x194 (c2compiler.cpp:113)
      V [libjvm.so+0x8ab589] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x9ed (compileBroker.cpp:2240)
      V [libjvm.so+0x8aa175] CompileBroker::compiler_thread_loop()+0x3e7 (compileBroker.cpp:1916)
      V [libjvm.so+0x8c9dd5] CompilerThread::thread_entry(JavaThread*, JavaThread*)+0x69 (compilerThread.cpp:58)
      V [libjvm.so+0xc4bfd4] JavaThread::thread_main_inner()+0x164 (javaThread.cpp:700)
      V [libjvm.so+0xc4be64] JavaThread::run()+0x204 (javaThread.cpp:683)
      V [libjvm.so+0x13a70c8] Thread::call_run()+0x180 (thread.cpp:224)
      V [libjvm.so+0x10c0b33] thread_native_entry(Thread*)+0x18f (os_linux.cpp:710)

      Attachments

        Issue Links

          Activity

            People

              wchao Wang Chao
              wchao Wang Chao
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: