HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 90 (of 101)
Chapter 11 Software Development
October 29, 2013
Java Abort
If the JVM aborts, it will always try to leave a core file. Depending on the java version and the
reason of the abort, it sometimes writes additional information into a file named
hs_err_pid<PID>.log, where <PID> is the process ID of the aborted java process.
When looking at a java core file, make sure to use the correct java executable.
/opt/java1.4/bin/java is not the real java executable. It is only a wrapper. The correct java
executables, e.g. for java 1.4, are:
/opt/java1.4/bin/PA_RISC/java (PA-RISC 1.1)
/opt/java1.4/bin/PA_RISC2.0/java (PA-RISC 2.0)
/opt/java1.4/bin/PA_RISC2.0W/java (PA-RISC 64-bit)
/opt/java1.4/bin/IA64N/java (IA64 32-bit)
/opt/java1.4/bin/IA64W/java (IA64 64-bit)
Debugging a java core file normally requires deep knowledge of the internal structure of the
JVM. In many cases, debugging java core files means getting a stacktrace and checking in
CHART [9] for known problems. If there are no matches, forward the core file to the Languages
WTEC [7].
Besides a JVM internal error, it is also possible that the JVM aborts because of a problem with
the application running inside the JVM, or, if JNI is used, because of a bug in the native part (3
rd
party shared libraries). JNI aborts can be handled like any other core file, and checked against the
abort reasons discussed earlier in this chapter.
Since gdb version 3.1 and java 1.3.1.02, gdb is able to unwind through the java methods
(interpreted as well as compiled). All java depots since 1.3.1.02 contain the library
libjunwind.sl, e.g. for java 1.4:
/opt/java1.4/jre/lib/PA_RISC/server/libjunwind.sl (PA-RISC 1.1)
/opt/java1.4/jre/lib/PA_RISC2.0/server/libjunwind.sl (PA-RISC 2.0)
/opt/java1.4/jre/lib/PA_RISC2.0W/server/libjunwind.sl (PA-RISC 64-bit)
/opt/java1.4/jre/lib/IA64N/server/libjunwind.so (IA64 32-bit)
/opt/java1.4/jre/lib/IA64W/server/libjunwind.so (IA64 64-bit)
gdb tries to find the appropriate java unwind library on its own. If it is not able to find it, you can
set the environment variable GDB_JAVA_UNWINDLIB:
$ export
GDB_JAVA_UNWINDLIB=/opt/java1.4/jre/lib/PA_RISC2.0/server/libjunwind.sl
$ gdb /opt/java1.4/bin/PA_RISC2.0/java core_1
: