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

C2 SuperWord: SIGSEGV because PhaseIdealLoop::split_thru_phi left dead nodes in loop _body

XMLWordPrintable

      Found by fuzzer.

      Only seems to reproduce with JDK26.

      Workaround: -XX:-UseSuperWord

      Reproduce:
      java -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch Test.java

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f3785ad7263, pid=3564244, tid=3564574
      #
      # JRE version: Java(TM) SE Runtime Environment (26.0) (fastdebug build 26-internal-empeter.open)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-internal-empeter.open, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x1ad7263] SuperWordVTransformBuilder::build_scalar_vtnodes_for_non_packed_nodes()+0xc23
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %d" (or dumping to /home/empeter/Documents/oracle/creduce/core.3564244)
      #
      # 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: -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher Test.java

      Host: ???, 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz, 16 cores, 29G, Oracle Linux Server release 9.6
      Time: Tue Oct 21 15:04:39 2025 CEST elapsed time: 7.471784 seconds (0d 0h 0m 7s)

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

      Current thread (0x00007f377c1d2b90): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=3564574, stack(0x00007f37701bc000,0x00007f37702bc000) (1024K)]


      Current CompileTask:
      C2:7471 128 b Test::mainTest (616 bytes)

      Stack: [0x00007f37701bc000,0x00007f37702bc000], sp=0x00007f37702b5c10, free space=999k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1ad7263] SuperWordVTransformBuilder::build_scalar_vtnodes_for_non_packed_nodes()+0xc23 (node.hpp:953)
      V [libjvm.so+0x1adda33] SuperWordVTransformBuilder::build()+0x33 (superwordVTransformBuilder.cpp:33)
      V [libjvm.so+0x1acf17d] SuperWord::do_vtransform() const [clone .part.0]+0x5cd (superwordVTransformBuilder.hpp:49)
      V [libjvm.so+0x1ad3f9f] SuperWord::transform_loop()+0x2f (superword.cpp:413)
      V [libjvm.so+0x15b58b8] PhaseIdealLoop::auto_vectorize(IdealLoopTree*, VSharedData&)+0xa48 (loopopts.cpp:4484)
      V [libjvm.so+0x1594c2c] PhaseIdealLoop::build_and_optimize()+0xf3c (loopnode.cpp:5275)
      V [libjvm.so+0xb8caf0] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x4c0 (loopnode.hpp:1189)
      V [libjvm.so+0xb83a24] Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0xb4 (compile.cpp:2262)
      V [libjvm.so+0xb86971] Compile::Optimize()+0xcc1 (compile.cpp:2511)
      V [libjvm.so+0xb89b23] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x2023 (compile.cpp:860)
      V [libjvm.so+0x9a3af3] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4a3 (c2compiler.cpp:147)
      V [libjvm.so+0xb99030] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x780 (compileBroker.cpp:2345)
      V [libjvm.so+0xb9a890] CompileBroker::compiler_thread_loop()+0x530 (compileBroker.cpp:1989)
      V [libjvm.so+0x10f260b] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:771)
      V [libjvm.so+0x1b633e6] Thread::call_run()+0xb6 (thread.cpp:243)
      V [libjvm.so+0x17d06c8] thread_native_entry(Thread*)+0x128 (os_linux.cpp:883)

        1. FuzzerUtils.java
          13 kB
          Emanuel Peter
        2. hs_err_pid3564244.log
          74 kB
          Emanuel Peter
        3. Reduced.java
          0.8 kB
          Emanuel Peter
        4. replay_pid3564244.log
          317 kB
          Emanuel Peter
        5. Test.java
          8 kB
          Emanuel Peter

            epeter Emanuel Peter
            epeter Emanuel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: