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

SIGSEGV in C2 compiled code using locking

XMLWordPrintable

    • aarch64
    • linux

      ADDITIONAL SYSTEM INFORMATION :
      $ uname -a
      Linux localhost.localdomain 4.19.90-2112.8.0.0131.oe1.aarch64 #1 SMP Fri Dec 31 19:53:20 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

      $ cat /etc/os-release
      NAME="openEuler"
      VERSION="20.03 (LTS-SP3)"
      ID="openEuler"
      VERSION_ID="20.03"
      PRETTY_NAME="openEuler 20.03 (LTS-SP3)"
      ANSI_COLOR="0;31"



      A DESCRIPTION OF THE PROBLEM :
      When I run the following Testcase using jdk-17.0.11, I find that the jvm crashes. This is very strange because there is no such problem on jdk8. I tried to add the -Xint option and -Xcomp option when running the test to determine whether it is a JIT problem, but both options make the problem unreproducible.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      path/to/jdk-17.0.11/bin/javac -cp . Test.java
      path/to/jdk-17.0.11/bin/java Test

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Continues running in an infinite loop
      ACTUAL -
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x0000fffc692c0e60, pid=3747800, tid=3747801
      #
      # JRE version: Java(TM) SE Runtime Environment (17.0.11+7) (build 17.0.11+7-LTS-207)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.11+7-LTS-207, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
      # Problematic frame:
      # J 9 c2 Test.t()V (118 bytes) @ 0x0000fffc692c0e60 [0x0000fffc692c0c40+0x0000000000000220]
      #
      # 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" (or dumping to /home/TEMP/proj/core.3747800)
      #
      # An error report file with more information is saved as:
      # /home/TEMP/proj/hs_err_pid3747800.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #


      ---------- BEGIN SOURCE ----------
      class Test {
          public static void main(String[] args) {
              for (;;)
                  t();
          }

          static int var8;

          static void t() {
              synchronized (Test.class) {
                  int var12 = 0;
                  while (var12 < 10000) {
                      var12++;
                      if (var12 < 5)
                          synchronized (new Test()) {
                          }
                  }
              }
              synchronized (Test.class) {
                  int var4 = 0;
                  do {
                      var4++;
                      if (var4 < 4) {
                          boolean var10 = true;
                          int var9 = 0;
                          do {
                              var9++;
                              if (var10)
                                  var8++;
                          } while (var9 < 20000);
                      }
                  } while (var4 < 10000);
              }
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: