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

Need to enable -XX:+TraceExceptions in release builds

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 8-pool
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      binary, behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Hide
      -XX:+TraceException will be available as a product option previously only available as develop. Since nobody will have that option turned on currently, the risk is minimal.

      However, downgrading from a version of the JDK supporting the option to an older build not supporting the option *and* keeping the CLI flag -XX:+TraceException on will fail to start the JVM.
      Show
      -XX:+TraceException will be available as a product option previously only available as develop. Since nobody will have that option turned on currently, the risk is minimal. However, downgrading from a version of the JDK supporting the option to an older build not supporting the option *and* keeping the CLI flag -XX:+TraceException on will fail to start the JVM.
    • Interface Kind:
      add/remove/modify command line option

      Description

      Summary

      Promote JVM option -XX:+TraceExceptions from a development flag to a product flag. This allows it to be used in a release build of the JDK.

      Problem

      When an exception is raised in the JVM, it sets the pending exception in the corresponding Java thread and the exception is re-thrown once JVM operations complete and execution continues running Java code.

      However, once execution continues executing Java code it can be difficult to locate the origin of the exception (JVM code).

      By enabling the HotSpot option -XX:+TraceExceptions for product builds, details of JVM-raised exceptions can be shown. This simplifies diagnosis of the actual problem.

      Currently, -XX:+TraceException is only available as a develop option, which means it's only available for debug JVM builds. It cannot be used for JVMs deployed in production:

      $ java -XX:+TraceExceptions -version
      Error: VM option 'TraceExceptions' is develop and is available only in debug version of VM.
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.

      Solution

      Promote JVM option -XX:+TraceExceptions to be available in release JVM builds. By default it will be turned off.

      Specification

      diff -r 0e48ee44693e -r 47ffd05828f9 src/share/vm/runtime/globals.hpp
      --- a/src/share/vm/runtime/globals.hpp  Tue Dec 16 12:52:04 2014 +0100
      +++ b/src/share/vm/runtime/globals.hpp  Tue Dec 16 19:00:24 2014 -0500
      @@ -1341,7 +1341,7 @@
         develop(bool, TraceClassInitialization, false,                            \
                 "Trace class initialization")                                     \
                                                                                   \
      -  develop(bool, TraceExceptions, false,                                     \
      +  product(bool, TraceExceptions, false,                                     \
                 "Trace exceptions")                                               \
                                                                                   \
         develop(bool, TraceICs, false,                                            \

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zgu Zhengyu Gu
                Reporter:
                lagergren Marcus Lagergren
                Reviewed By:
                Severin Gehwolf
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: