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

PerfDataManager::destroy crashes in VM_Exit

    XMLWordPrintable

Details

    • b09
    • generic
    • generic

    Description

      When the user enables UL -Xlog:perf+datacreation=debug, it may crash in PerfDataManager::destroy().

      The following line will crash when _sample is NULL.
        log_debug(perf, datacreation)("Total = %d, Sampled = %d, Constants = %d",
                                      _all->length(), _sampled->length(), _constants->length());

      This only happens when UsePerfData is on and PerfDataManager::destroy() is invoked before StatSampler::initialize() which initializes PerfDataManager::_sampled.
      PerfDataManager::destroy() is called by VM_Exit which can be triggered by SIGINT on Linux anytime.

      A reproducible: invoke the following command and keep pressing Ctrl-c.
      $perf stat -r 100 java -Xlog:perf+datacreation=debug --version

      [0.043s][debug][perf,datacreation] name = sun.ci.lastInvalidatedType, dtype = 11, variability = 3, units = 1, dsize = 8, vlen = 0, pad_length = 1, size = 56, on_c_heap = FALSE, address = 0x00007f7662bc19f8, data address = 0x00007f7662bc1a28
      ^C#
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f766187639e, pid=4801, tid=4808
      #
      # JRE version: OpenJDK Runtime Environment (18.0) (build 18-internal+0-adhoc.xxinliu.jdk)
      # Java VM: OpenJDK 64-Bit Server VM (18-internal+0-adhoc.xxinliu.jdk, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xc3439e] PerfDataManager::destroy()+0x4e
      #
      # Core dump will be written. Default location: /tmp/core.4801.%i
      #
      # An error report file with more information is saved as:
      # /local/home/xxinliu/Devel/jdk/hs_err_pid4801.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #

      [error occurred during error reporting (), id 0xb, SIGSEGV (0xb) at pc=0x00007f766187639e]

      ./build/linux-x86_64-server-release/jdk/bin/java: Aborted
      [error occurred during error reporting (), id 0xb, SIGSEGV (0xb) at pc=0x00007f70f41f9e9c]

      java: Aborted

      Attachments

        Issue Links

          Activity

            People

              xliu Xin Liu
              xliu Xin Liu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 1 day
                  1d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified