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

Segfault at Node::rematerialize() const+0x4

XMLWordPrintable

    • x86_64
    • linux_ubuntu

      ADDITIONAL SYSTEM INFORMATION :
      Arch: x86_64
      OS: Ubuntu 20.04.4 LTS
      HotSpot
      - openjdk version "1.8.0_352-internal-fastdebug"
      - OpenJDK Runtime Environment (build 1.8.0_352-internal-fastdebug-congli_2022_06_07_14_13-b00)
      - OpenJDK 64-Bit Server VM (build 25.352-b00-fastdebug, mixed mode)
      javac: javac 1.8.0_352-internal-fastdebug

      A DESCRIPTION OF THE PROBLEM :
      The problem was found in the repo https://github.com/openjdk/jdk8u-dev (commit 83e90957), OpenJDK 1.8.0_352-internal.

      **Note**
      1. The given test may take **~1min** to make HotSpot crash. So please be patient.
      2. Sorry, we cannot reduce the test further otherwise it cannot be reproduced.

      The following is part of the log:
      ```
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f5a312ac8f4, pid=1652824, tid=0x00007f59833bc700
      #
      # JRE version: OpenJDK Runtime Environment (8.0_352) (build 1.8.0_352-internal-congli_2022_06_21_15_08-b00)
      # Java VM: OpenJDK 64-Bit Server VM (25.352-b00 mixed mode linux-amd64 compressed oops)
      # Problematic frame:
      # V [libjvm.so+0x91f8f4] Node::rematerialize() const+0x4
      #
      # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #

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

      Current thread (0x00007f5a2c16c800): JavaThread "C2 CompilerThread3" daemon [_thread_in_native, id=1653027, stack(0x00007f59832bd000,0x00007f59833bd000)]

      siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x000000000000002c

      Registers:
      RAX=0x00007f57dc000ce0, RBX=0x0000000000000001, RCX=0x00000000000000a0, RDX=0x00007f580803e800
      RSP=0x00007f59833b8658, RBP=0x00007f59833b8820, RSI=0x00007f57f403b590, RDI=0x0000000000000000
      R8 =0x00007f57f408a210, R9 =0x00007f57c0002660, R10=0x0000000000000000, R11=0x0000000000000003
      R12=0x00007f57f403b9e0, R13=0x0000000000000000, R14=0x00007f59833b8b20, R15=0x00007f5808059d90
      RIP=0x00007f5a312ac8f4, EFLAGS=0x0000000000010297, CSGSFS=0x002b000000000033, ERR=0x0000000000000004
        TRAPNO=0x000000000000000e

      Top of Stack: (sp=0x00007f59833b8658)
      0x00007f59833b8658: 00007f5a31363929 0000000000000006
      0x00007f59833b8668: 00000000000003d8 00007f580803fe12
      0x00007f59833b8678: 000000a300010000 00007f59833b87b0
      0x00007f59833b8688: 00007f5808012100 00007f58080124d8
      0x00007f59833b8698: 00007f59833b8790 00007f58080120f0
      0x00007f59833b86a8: 00007f57f4029258 00007f57f4029258
      0x00007f59833b86b8: 00007f5808089e90 00007f580803fd70
      0x00007f59833b86c8: 00007f57f408a210 00007f57f4014f00
      0x00007f59833b86d8: 00007f59833b87d0 0000000000000002
      0x00007f59833b86e8: 00007f5800000002 00007f5808089ed0
      0x00007f59833b86f8: 00007f5700000093 00007f57f4003f88
      0x00007f59833b8708: 00007f580803e040 00007f57f4003ee0
      0x00007f59833b8718: 00007f5700000001 00007f5800000014
      0x00007f59833b8728: 00000000000000a0 0000000000000014
      0x00007f59833b8738: 00007f580803f2f0 00007f57dc000ce0
      0x00007f59833b8748: 0000000000000001 00007f57f403b590
      0x00007f59833b8758: 00007f59833b8880 00007f580803e800
      0x00007f59833b8768: 0000000000000072 0000000000000008
      0x00007f59833b8778: 00007f5900000372 00007f580803ed20
      0x00007f59833b8788: 0000042f000087d0 000001ef00000015
      0x00007f59833b8798: 00007f59833b8880 00007f570000000f
      0x00007f59833b87a8: 00007f580803d0c0 000001ef00000000
      0x00007f59833b87b8: 00007f59833b8880 00007f570000000f
      0x00007f59833b87c8: 00007f580803d880 000001ef00000000
      0x00007f59833b87d8: 00007f59833b8880 00007f570000000f
      0x00007f59833b87e8: 00007f580803d880 00007f59833b8880
      0x00007f59833b87f8: 00007f59833b8920 00007f59833b88b0
      0x00007f59833b8808: 00007f59833b88e0 00007f59833b8880
      0x00007f59833b8818: 00007f59833b8b20 00007f59833b8a70
      0x00007f59833b8828: 00007f5a30d81fec 0000000200000002
      0x00007f59833b8838: 0000000000000001 0000000000000000
      0x00007f59833b8848: 00007f59833b8980 00007f59833b88b0

      Instructions: (pc=0x00007f5a312ac8f4)
      0x00007f5a312ac8d4: 66 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
      0x00007f5a312ac8e4: b8 01 00 00 00 c3 66 0f 1f 44 00 00 f3 0f 1e fa
      0x00007f5a312ac8f4: 0f b7 47 2c 83 e0 03 66 83 f8 02 74 0f 0f b7 47
      0x00007f5a312ac904: 2e 66 d1 e8 83 e0 01 c3 0f 1f 40 00 e9 eb 1e f4

      Register to memory mapping:

      RAX=0x00007f57dc000ce0 is an unknown value
      RBX=0x0000000000000001 is an unknown value
      RCX=0x00000000000000a0 is an unknown value
      RDX=0x00007f580803e800 is an unknown value
      RSP=0x00007f59833b8658 is pointing into the stack for thread: 0x00007f5a2c16c800
      RBP=0x00007f59833b8820 is pointing into the stack for thread: 0x00007f5a2c16c800
      RSI=0x00007f57f403b590 is an unknown value
      RDI=0x0000000000000000 is an unknown value
      R8 =0x00007f57f408a210 is an unknown value
      R9 =0x00007f57c0002660 is an unknown value
      R10=0x0000000000000000 is an unknown value
      R11=0x0000000000000003 is an unknown value
      R12=0x00007f57f403b9e0 is an unknown value
      R13=0x0000000000000000 is an unknown value
      R14=0x00007f59833b8b20 is pointing into the stack for thread: 0x00007f5a2c16c800
      R15=0x00007f5808059d90 is an unknown value


      Stack: [0x00007f59832bd000,0x00007f59833bd000], sp=0x00007f59833b8658, free space=1005k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x91f8f4] Node::rematerialize() const+0x4
      V [libjvm.so+0x3f4fec] PhaseChaitin::Register_Allocate()+0x49c
      V [libjvm.so+0x481907] Compile::Code_Gen()+0x497
      V [libjvm.so+0x484b6a] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool)+0x175a
      V [libjvm.so+0x3d8d29] C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0x119
      V [libjvm.so+0x48d5cb] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x6db
      V [libjvm.so+0x48f6e8] CompileBroker::compiler_thread_loop()+0x468
      V [libjvm.so+0xaa814f] JavaThread::thread_main_inner()+0xef
      V [libjvm.so+0xaa842f] JavaThread::run()+0x2af
      V [libjvm.so+0x950060] java_start(Thread*)+0x150
      C [libpthread.so.0+0x8609] start_thread+0xd9
      ```


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. javac Test.java
      2. java -Xmx1G -XX:-BackgroundCompilation -XX:-PrintWarnings Test

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No segfault
      ACTUAL -
      Segfault

      ---------- BEGIN SOURCE ----------
      class Test {
        int N;
        long instanceCount;

        int iMeth() {
          float fArr[] = new float[N];
          long meth_res = Double.doubleToLongBits(checkSum(fArr));
          return (int) meth_res;
        }

        void vMeth1() {
          int i2, i3, i16 = 232, i20, i21, iArr1[] = new int[N];
          boolean b1 = false;
          for (i3 = 8; i3 < 188; ) {
            for (int ax$6 = 0; ax$6 < 9246; ax$6 += 1) iMeth();
            for (i20 = 1; i20 > i3; i20 -= 3) {
              i21 = iArr1[i16 + 1] / i20;
              iArr1[i20 + 1] = iArr1[i20] % 1865804166;
              if (b1) break;
              switch (i3) {
                case 112:
                  break;
                case 114:
                  i16 -= i20;
              }
            }
          }
        }

        void vMeth(double d, long l, float f) {
          vMeth1();
        }

        void mainTest(String[] strArr1) {
          vMeth(11.30440, instanceCount, 2.868F);
        }

        public static void main(String[] strArr) {
          Test _instance = new Test();
          _instance.mainTest(strArr);
        }

        public static double checkSum(float[] a) {
          double sum = 0;
          for (int j = 0; j < a.length; j++) {
            sum += (a[j] / (j + 1) + a[j] % (j + 1));
          }
          return sum;
        }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            dskantz Daniel Skantz
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: