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

C2: segmentation fault in bytecode parsing

    XMLWordPrintable

    Details

      Description

      ADDITIONAL SYSTEM INFORMATION :
      OS version:
      Distributor ID: Ubuntu
      Description: Ubuntu 20.04.2 LTS
      Release: 20.04
      Codename: focal

      JDK version we used:
      openjdk version "17.0.2" 2022-01-18
      OpenJDK Runtime Environment (build 17.0.2+8-86)
      OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)

      openjdk version "18" 2022-03-22
      OpenJDK Runtime Environment (build 18+36-2087)
      OpenJDK 64-Bit Server VM (build 18+36-2087, mixed mode, sharing)

      openjdk version "19-ea" 2022-09-20
      OpenJDK Runtime Environment (build 19-ea+17-1142)
      OpenJDK 64-Bit Server VM (build 19-ea+17-1142, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      When we run the test case in jdk17.0.2, jdk18 and jdk19-ea, all in compiled mode(with "-Xcomp"), it crashed with the following message. But when run the test in mixed mode or interpreted mode(with "-Xint), it passed successfully.
      The error message in compiled mode:

      JDK17.0.2:
      .#
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007faf1a60a570, pid=26460, tid=26474
      #
      # JRE version: OpenJDK Runtime Environment (17.0.2+8) (build 17.0.2+8-86)
      # Java VM: OpenJDK 64-Bit Server VM (17.0.2+8-86, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xb92570] MethodLiveness::init_basic_blocks()+0x420
      #
      # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # An error report file with more information is saved as:
      # /home/minghai/bug2/hs_err_pid26460.log
      #
      # Compiler replay data is saved as:
      # /home/minghai/bug2/replay_pid26460.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp

      JDK18:
      .#
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f4051f90f2e, pid=26481, tid=26495
      #
      # JRE version: OpenJDK Runtime Environment (18.0+36) (build 18+36-2087)
      # Java VM: OpenJDK 64-Bit Server VM (18+36-2087, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xba2f2e] MethodLiveness::init_basic_blocks()+0x27e
      #
      # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # An error report file with more information is saved as:
      # /home/minghai/bug2/hs_err_pid26481.log
      #
      # Compiler replay data is saved as:
      # /home/minghai/bug2/replay_pid26481.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp

      JDK19:
      .#
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f0e89738ff5, pid=26502, tid=26516
      #
      # JRE version: OpenJDK Runtime Environment (19.0+17) (build 19-ea+17-1142)
      # Java VM: OpenJDK 64-Bit Server VM (19-ea+17-1142, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xbc1ff5] MethodLiveness::init_basic_blocks()+0x285
      #
      # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # An error report file with more information is saved as:
      # /home/minghai/bug2/hs_err_pid26502.log
      #
      # Compiler replay data is saved as:
      # /home/minghai/bug2/replay_pid26502.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.download bug_init.zip from:
      https://drive.google.com/file/d/1JS4k3uETnsP2Ni8mGsym8ZjRuICsgaPz/view?usp=sharing
      2. extract the bug_init.zip
      3. in dictionary "bug_init", run command:
      java -cp ./bugFiles:./util:./junit.jar:./hamcrest.jar:./target/classes:./target/test-classes org.junit.runner.JUnitCore com.alibaba.fastjson.deserializer.issue1463.TestIssue1463

      Add "-Xcomp" or "-Xint" to get different results.
      Add "-XX:CompileOnly=com/alibaba/fastjson/JSON" to speed up in compiled mode.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The result should be the same since the program are the same, no matter in compiled mode, mixed mode or interpreted mode.
      ACTUAL -
      When run in compiled mode(with "-Xcomp"), it crashed. But when run in mixed mode or interpreted mode(with -Xint), it passed successfully.

      ---------- BEGIN SOURCE ----------
      download bug_init.zip from:
      https://drive.google.com/file/d/1JS4k3uETnsP2Ni8mGsym8ZjRuICsgaPz/view?usp=sharing
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      run the command without -Xcomp or with -Xint

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: