Details
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
- supercedes
-
NEXUS-13048 java.lang.RuntimeException may not be logged correctly at default log levels
-
- Closed
-
- testing discovered
-
NEXUS-13786 Publish Maven Indexes task SimpleDateFormat NullPointerException
-
- Open
-