C2: assert(!n->is_Store()) failed: 2 stores to same slice on same control?

XMLWordPrintable

    • b03
    • 27

      Found by Olivier Mattmann <olivier.mattmann@bluewin.ch> during work on this Master thesis where he is working on a fuzzer for C2.

      The attached Test.java asserts starting with JDK-8367341 and OSR enabled:
      java -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,Test.* Test.java
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/home/mhassig/src/jdk/open/src/hotspot/share/opto/memnode.cpp:4819), pid=709770, tid=709783
      # assert(!n->is_Store()) failed: 2 stores to same slice on same control?
      #
      # JRE version: Java(TM) SE Runtime Environment (27.0) (fastdebug build 27-internal-mhassig.open)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-internal-mhassig.open, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x16be870] InitializeNode::can_capture_store(StoreNode*, PhaseGVN*, bool)+0x9b0

      Current thread (0x00007f428c180410): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=709783, stack(0x00007f42906cc000,0x00007f42907cc000) (1024K)]

      Current CompileTask:
      C2:3704 664 b Test::main (61 bytes)

      Stack: [0x00007f42906cc000,0x00007f42907cc000], sp=0x00007f42907c6d80, free space=1003k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x16be870] InitializeNode::can_capture_store(StoreNode*, PhaseGVN*, bool)+0x9b0 (memnode.cpp:4819)
      V [libjvm.so+0x16ca58e] StoreNode::Ideal(PhaseGVN*, bool)+0x64e (memnode.cpp:3436)
      V [libjvm.so+0x18a777e] PhaseIterGVN::transform_old(Node*)+0xce (phaseX.cpp:672)
      V [libjvm.so+0x18ac82e] PhaseIterGVN::optimize()+0xae (phaseX.cpp:1068)
      V [libjvm.so+0xba9b74] Compile::process_for_post_loop_opts_igvn(PhaseIterGVN&)+0x164 (compile.cpp:1892)
      V [libjvm.so+0xbaf5eb] Compile::Optimize()+0xd0b (compile.cpp:2527)
      V [libjvm.so+0xbb2743] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x2023 (compile.cpp:862)
      V [libjvm.so+0x9c8b08] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x478 (c2compiler.cpp:147)
      V [libjvm.so+0xbc20bf] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xbcf (compileBroker.cpp:2345)
      V [libjvm.so+0xbc3300] CompileBroker::compiler_thread_loop()+0x530 (compileBroker.cpp:1989)
      V [libjvm.so+0x112dcbb] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:776)
      V [libjvm.so+0x1bbe876] Thread::call_run()+0xb6 (thread.cpp:243)
      V [libjvm.so+0x18138b8] thread_native_entry(Thread*)+0x118 (os_linux.cpp:929)

        1. Test.java
          2 kB
          Manuel Hässig

            Assignee:
            Quan Anh Mai
            Reporter:
            Manuel Hässig
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: