JDK-6432085 : Stack Trace does not show up on NullPointerException in 1.4.2 (-server VM)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2_11
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2006-05-31
  • Updated: 2010-08-05
  • Resolved: 2006-06-30
Related Reports
Duplicate :  
Description
Stack Trace does not appear on NPE in 1.4.2_11.

Configuration :
 UltraSparcII 400[MHz]  *2
 4[GB]
 Solaris9

How to reproduce :
1. Compile attached .java programs
2. Launch
    " java -server -cp . TestNPO 100"
  in 1.4.2_11 on Solaris9 box.

The following message will show up.
...
Thread-72 start
Thread-83 start
Thread-54 start
Thread-52 start
Thread-81 start
Thread-88 start
Thread-58 start
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException

Although NPE occurs several times,  stack trace does not show up.

Comments
EVALUATION It turns out this is unrelated to 6428459, in fact it appears to be a duplicate of 4292742. The spec does not dictate that stack traces must appear for all exceptions. Current behavior, c2 will include the stack trace; after recomplication, it may revert to the older, faster mechanism and omit a trace. -XX:-OmitStackTraceInFastThrow may be used to force stack trace always, at the cost of performance.
30-06-2006

WORK AROUND Use -XX:-OmitStackTraceInFastThrow.
22-06-2006

EVALUATION It's quite possible the missing stack trace is due to 6428459 which appears to be a c2 issue. We'll re-evaluated this after 6428459 is fixed.
07-06-2006