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

Product JVM crashes with FLAG_SET_XXX on non-product Flag

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 20
    • 20
    • hotspot
    • b13

    Description

      This was ultimately my error but clearer error handling could have saved me an hour or two.

      While working on https://bugs.openjdk.org/browse/JDK-8292561, I tried to make ReplayCompiles a product (diagnostic) switch. Depending on ReplayCompiles, however, we set UseDebuggerErgo. UseDebuggerErgo is a notproduct switch.

      So I found that setting a notproduct switch in a product build just crashes. And if that happens before os_init in early arg parsing, we won't even have a signal handler in place, so no hs-err file, just "Segmentation Fault".

      You just cannot run a debug VM here to see assert since the error depends on the VM being product. Therefore, a guarantee somewhere would be helpful.

      Here's a reproducer:

      =====================
      diff src/hotspot/share/gc/shared/gcConfig.cpp

       void GCConfig::select_gc_ergonomically() {
      + FLAG_SET_ERGO(CheckCompressedOops, true);
         if (os::is_server_class_machine()) {
      =====================

      # The VM exits with no apparent error message

      $ java -version; echo $?
      139

      Attachments

        Issue Links

          Activity

            People

              iklam Ioi Lam
              stuefe Thomas Stuefe
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: