Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-13777

JVM optimizations may log exceptions without stack traces by default due to OmitStackTraceInFastThrow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 3.4.0
    • Fix Version/s: 3.5.0
    • Component/s: Logging
    • Labels:
    • Story Points:
      1
    • Release Note:
      Yes
    • Sprint:
      Platform - Sprint 100

      Description

      We have seen at least two instances where a java.lang.NullPointerException is thrown unintentionally due to programming error and yet no stack trace is logged to help us determine and fix the root cause of the bug.

      This seems to be due to a JVM optimization according to: http://www.oracle.com/technetwork/java/javase/relnotes-139183.html

      The compiler in the server VM now provides correct stack backtraces for all "cold" built-in exceptions. For performance purposes, when such an exception is thrown a few times, the method may be recompiled. After recompilation, the compiler may choose a faster tactic using preallocated exceptions that do not provide a stack trace. To disable completely the use of preallocated exceptions, use this new flag: -XX:-OmitStackTraceInFastThrow

      Expected

      • prevent critical exceptions to be logged without without a stack trace, by turning off the JVM optimization and setting -XX:-OmitStackTraceInFastThrow by default

      Additional Reference: https://stackoverflow.com/a/27214402/235000

      Workaround

      A user may wish to disable this JVM optimization themselves until it is made the default option. They can edit bin/nexus.vmoptions and add the following line and restart Nexus:

      -XX:-OmitStackTraceInFastThrow 
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              plynch Peter Lynch
              Last Updated By:
              Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title