JDK-5003862 : RFE: print native stacktrace upon crash in hs_err_pid.log
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2_03
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: generic
  • Submitted: 2004-02-26
  • Updated: 2022-05-11
  • Resolved: 2004-02-26
Related Reports
Duplicate :  
Description
This is a request from a customer, who does much JNI code.
Comparing to IBM's VM, customer finds the following very useful:
IBM's VM prints (among many other pieces of information) a native stacktrace 
of the failing thread in their errorlog:
e.g.:

% more javacore16201.1077794940.txt

Thu Feb 26 11:24:15 2004
SIGABRT received in kill at 0x40081ed1 in /lib/libc.so.6. Processing terminated.
PID: 15726
J2RE 1.3.1 IBM build cxia32131-20020622
[ ... ]
         PID: 15726
         ----- Native Stack -----       Diagnostics_Impl at 40017409 in libxhpi.so
        dgGenerateJavacore at 40249F89 in libjvm.so
        abortJVM at 402DAFA1 in libjvm.so       sysUnwindSignalCatchFrame at 4033FA1F in libhpi.so
        sysSignalCatchHandler at 4033FAB1 in libhpi.so  intrDispatch at 403402CA in libhpi.so
        intrDispatchMD at 4034052C in libhpi.s  raise at 400345EB in libpthread.so.0
        abort at 400835C9 in libc.so    intrDispatch at 403402CA in libhpi.so
        intrDispatchMD at 4034052C in libhpi.s  bar at 415AB7AF in libtestImpl.so
        Java_test_bar at 415AB789 in libtestImpl.so
        ??
        mmipExecuteJava at 402A520F in libjvm.so
        ??
--------------------------------------------------------
[ ... ]


It would be desirable, if Sun's VM could also print such information in the 
file "hs_err_pid.log", so that most relevant debug information is already 
retrieved at the time of the crash.

This feature could probably be triggered by a -XX-option, e.g -XX:+PrintNativeStack.


Please find attached a complete crossplatform JNI example, that produces a crash.
Please find also data, that have been redeemed from several platforms, like
Solaris, RedHat Linux, SuSE Linux and Windows.


Comments
PUBLIC COMMENTS Sun's VM to print stack information in the file "hs_err_pid.log", so that most relevant debug information is already retrieved at the time of the crash. Thank you for the great suggestion. This has been fixed in J2SE 1.5. We hope you like all the additional fatal error handling information that is now available. We really appreciate your suggestions for improvements.
10-06-2004