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

PhaseMacroExpand::generate_slow_arraycopy crash when clone null CallProjections.fallthrough_ioproj

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b11
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        C2 crash when compile IllegalArrayCopy with negative index before an infinite loop.

            static void foo() {
                try {
                    Arrays.copyOfRange(src, -1, 128);
                    do {
                    } while (true);
                } catch (ArrayIndexOutOfBoundsException ex) {
                    count++;
                }
            }

        # SIGSEGV (0xb) at pc=0x00007f95e714f258, pid=14408, tid=14420
        #
        # JRE version: OpenJDK Runtime Environment (11.0.13) (build 11.0.13-internal+0-adhoc.shihui.jdk11u-dev)
        # Java VM: OpenJDK 64-Bit Server VM (11.0.13-internal+0-adhoc.shihui.jdk11u-dev, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0xc16258] Node::clone() const+0x38

        Stack: [0x00007f95b875c000,0x00007f95b885d000], sp=0x00007f95b88587a0, free space=1009k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0xc16258] Node::clone() const+0x38
        V [libjvm.so+0xb0397b] PhaseMacroExpand::generate_slow_arraycopy(ArrayCopyNode*, Node**, Node*, Node**, TypePtr const*, Node*, Node*, Node*, Node*, Node*, bool)+0x47b
        V [libjvm.so+0xb0646a] PhaseMacroExpand::generate_arraycopy(ArrayCopyNode*, AllocateArrayNode*, Node**, MergeMemNode*, Node**, TypePtr const*, BasicType, Node*, Node*, Node*, Node*, Node*, bool, bool, RegionNode*)+0xf5a
        V [libjvm.so+0xb08f0f] PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode*)+0x62f
        V [libjvm.so+0xb00028] PhaseMacroExpand::expand_macro_nodes()+0x748
        V [libjvm.so+0x64a1fc] Compile::Optimize()+0x6ec
        V [libjvm.so+0x64b695] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0xcb5
        V [libjvm.so+0x565074] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xd4
        V [libjvm.so+0x655b84] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x474
        V [libjvm.so+0x657488] CompileBroker::compiler_thread_loop()+0x5a8
        V [libjvm.so+0xe09141] JavaThread::thread_main_inner()+0x1e1
        V [libjvm.so+0xe05ddf] Thread::call_run()+0x14f
        V [libjvm.so+0xc5186e] thread_native_entry(Thread*)+0xee

        siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000


        8u doesn't have this issue as second compilation is skipt due to inifinite loop.

        jdk8u-dev/build/linux-x86_64-normal-server-release/images/j2sdk-image/bin/java -Xbatch -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=compileonly,"IllegalArrayCopyBeforeInfiniteLoop::foo" -XX:+PrintCompilation IllegalArrayCopyBeforeInfiniteLoop
        CompilerOracle: compileonly IllegalArrayCopyBeforeInfiniteLoop.foo
            112 1 !b IllegalArrayCopyBeforeInfiniteLoop::foo (24 bytes)
            113 1 !b IllegalArrayCopyBeforeInfiniteLoop::foo (24 bytes) COMPILE SKIPPED: infinite loop (not retryable)

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                hshi Hui Shi
                Reporter:
                hshi Hui Shi
                Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: