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

C2 crashes with SIGFPE due to division by zero

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b08

      Backports

        Description

        The attached fuzzer test fails with SIGFPE.

        To reproduce:
        $ java -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test Test.java


        # A fatal error has been detected by the Java Runtime Environment:
        #
        # SIGFPE (0x8) at pc=0x00007fd47090f290, pid=11460, tid=11461
        #
        # JRE version: Java(TM) SE Runtime Environment (16.0) (slowdebug build 16-internal+0-2020-06-30-0728116.christian...)
        # Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 16-internal+0-2020-06-30-0728116.christian..., compiled mode, compressed oops, g1 gc, linux-amd64)
        # Problematic frame:
        # J 90 c2 Test.mainTest([Ljava/lang/String;)V (729 bytes) @ 0x00007fd47090f290 [0x00007fd47090e940+0x0000000000000950]
        ..........
        Command Line: -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.Main Test.java
        ..........
        Current thread (0x00007fd474033890): JavaThread "main" [_thread_in_Java, id=11461, stack(0x00007fd47adcd000,0x00007fd47aece000)]

        Stack: [0x00007fd47adcd000,0x00007fd47aece000], sp=0x00007fd47aecbda0, free space=1019k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        J 90 c2 Test.mainTest([Ljava/lang/String;)V (729 bytes) @ 0x00007fd47090f290 [0x00007fd47090e940+0x0000000000000950]
        J 89 c2 Test.main([Ljava/lang/String;)V (45 bytes) @ 0x00007fd47090aa20 [0x00007fd47090a8a0+0x0000000000000180]
        v ~StubRoutines::call_stub
        V [libjvm.so+0x9df631] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x5fd
        V [libjvm.so+0xea9eec] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*), JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x36
        V [libjvm.so+0x9df030] JavaCalls::call(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x8e
        V [libjvm.so+0xf4d30f] invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*)+0xcb6
        V [libjvm.so+0xf4d65d] Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0x191
        V [libjvm.so+0xaff647] JVM_InvokeMethod+0x294
        C [libjava.so+0xf414] Java_jdk_internal_reflect_NativeMethodAccessorImpl_invoke0+0x43
        j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base
        j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+113 java.base
        j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base
        j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base
        j com.sun.tools.javac.launcher.Main.execute(Ljava/lang/String;[Ljava/lang/String;Lcom/sun/tools/javac/launcher/Main$Context;)V+128 jdk.compiler
        j com.sun.tools.javac.launcher.Main.run([Ljava/lang/String;[Ljava/lang/String;)V+54 jdk.compiler
        j com.sun.tools.javac.launcher.Main.main([Ljava/lang/String;)V+14 jdk.compiler
        v ~StubRoutines::call_stub
        V [libjvm.so+0x9df631] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x5fd
        V [libjvm.so+0xea9eec] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*), JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x36
        V [libjvm.so+0x9df030] JavaCalls::call(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x8e
        V [libjvm.so+0xa8255c] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x188
        V [libjvm.so+0xa98181] jni_CallStaticVoidMethod+0x333
        C [libjli.so+0x4a2f] JavaMain+0xbf7
        C [libjli.so+0xaca5] ThreadJavaMain+0x27


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

          Attachments

          1. FuzzerUtils.java
            13 kB
          2. hs_err_pid11460.log
            220 kB
          3. Test.java
            9 kB

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: