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

C2: SIGFPE in unsigned_mod_value

XMLWordPrintable

    • b07
    • 25

      I found this with the Template Framework JDK-8344942.

      At the end of unsigned_mod_value, we compute:
      return TypeClass::make(static_cast<Signed>(dividend % divisor));

      But in this example, the "divisor" is zero, which leads to SIGFPE.

      The SIGFPE happens both in debug and in product.

      java -Xbatch -XX:CompileCommand=compileonly,Test::test* -XX:CompileCommand=printcompilation,Test::test* Test.java

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGFPE (0x8) at pc=0x000077924282870f, pid=1597591, tid=1597605
      #
      # JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-internal-LTS-2025-03-11-0926490.emanuel...)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-internal-LTS-2025-03-11-0926490.emanuel..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xc2870f] UModLNode::Value(PhaseGVN*) const+0x1ff
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to .../build/linux-x64-debug/jdk/bin/core.1597591)
      #
      # An error report file with more information is saved as:
      # ...n/hs_err_pid1597591.log
      #
      # Compiler replay data is saved as:
      # ../replay_pid1597591.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #
      Aborted (core dumped)


      Current CompileTask:
      C2:2445 89 !b 4 Test::test (17 bytes)

      Stack: [0x0000779220100000,0x0000779220200000], sp=0x00007792201fb1f0, free space=1004k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xc2870f] UModLNode::Value(PhaseGVN*) const+0x1ff (divnode.cpp:1326)
      V [libjvm.so+0x168390e] PhaseIterGVN::transform_old(Node*)+0x36e (phaseX.cpp:1236)
      V [libjvm.so+0x1679034] PhaseIterGVN::optimize()+0x94 (phaseX.cpp:1046)
      V [libjvm.so+0xa807b3] Compile::Optimize()+0x323 (compile.cpp:2294)
      V [libjvm.so+0xa8420f] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1ecf (compile.cpp:858)
      V [libjvm.so+0x8c3d00] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x440 (c2compiler.cpp:141)
      V [libjvm.so+0xa91cec] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xbfc (compileBroker.cpp:2331)
      V [libjvm.so+0xa92c28] CompileBroker::compiler_thread_loop()+0x598 (compileBroker.cpp:1975)
      V [libjvm.so+0xf7eb0f] JavaThread::thread_main_inner()+0x12f (javaThread.cpp:776)
      V [libjvm.so+0x1947b56] Thread::call_run()+0xb6 (thread.cpp:231)
      V [libjvm.so+0x15fa1b8] thread_native_entry(Thread*)+0x128 (os_linux.cpp:877)
      C [libc.so.6+0x9caa4]

        1. hs_err_pid1597591.log
          81 kB
        2. replay_pid1597591.log
          250 kB
        3. Test.java
          0.5 kB

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

              Created:
              Updated: