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

C2 crashes with SIGFPE due to a division that floats above its zero check

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b32

      Backports

        Description

        The attached fuzzer test fails with SIGFPE:

        To reproduce:
        java -Xcomp -XX:CompileOnly=Test -XX:-TieredCompilation -XX:+StressGCM Test.java

        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # SIGFPE (0x8) at pc=0x00007f3958a87a73, pid=12682, tid=12683
        #
        # JRE version: Java(TM) SE Runtime Environment (16.0+30) (fastdebug build 16-ea+30-2130)
        # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 16-ea+30-2130, compiled mode, sharing, compressed oops, g1 gc, linux-amd64)
        # Problematic frame:
        # J 3 c2 Test.mainTest([Ljava/lang/String;)V (613 bytes) @ 0x00007f3958a87a73 [0x00007f3958a87400+0x0000000000000673]
        ...........
        Command Line: -Xmx1G -Xcomp -Xbatch -XX:CompileOnly=Test -XX:CompileCommand=quiet -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:StressSeed=917280111 Test
        ...........
        Current thread (0x00007f3954026570): JavaThread "main" [_thread_in_Java, id=12683, stack(0x00007f395ecd8000,0x00007f395edd9000)]

        Stack: [0x00007f395ecd8000,0x00007f395edd9000], sp=0x00007f395edd78b0, free space=1022k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        J 3 c2 Test.mainTest([Ljava/lang/String;)V (613 bytes) @ 0x00007f3958a87a73 [0x00007f3958a87400+0x0000000000000673]
        J 2 c2 Test.main([Ljava/lang/String;)V (45 bytes) @ 0x00007f3958a868dc [0x00007f3958a86720+0x00000000000001bc]
        v ~StubRoutines::call_stub
        V [libjvm.so+0xe5e795] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x595
        V [libjvm.so+0xfa53a9] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .constprop.1]+0x369
        V [libjvm.so+0xfab16d] jni_CallStaticVoidMethod+0x20d
        C [libjli.so+0x4724] JavaMain+0xd34
        C [libjli.so+0x7c89] ThreadJavaMain+0x9


        siginfo: si_signo: 8 (SIGFPE), si_code: 1 (FPE_INTDIV), si_addr: 0x00007f3958a87a73

          Attachments

          1. FuzzerUtils.java
            13 kB
            Christian Hagedorn
          2. hs_err_pid12682.log
            203 kB
            Christian Hagedorn
          3. Test.java
            9 kB
            Christian Hagedorn

            Issue Links

              Activity

                People

                Assignee:
                chagedorn Christian Hagedorn
                Reporter:
                chagedorn Christian Hagedorn
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: