Operating System - HP-UX
1823063 Members
3175 Online
109645 Solutions
New Discussion юеВ

Obtaining a stack trace from an application core dump on HP-UX

 
SOLVED
Go to solution
Chris Borrill
New Member

Obtaining a stack trace from an application core dump on HP-UX

I have a Java program which is using JNI to call some native libraries. Something inside one or more of these libraries is causing the application to terminate with a core dump.

Can anyone tell be how to use GDB, ADB or some other tool to get a stack trace from the core dump. This can be done on Solaris using the pstack command.

System Information

HP-UX CCHP02 B.11.00 U 9000/800
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2.03-040401-16:07)
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.03-040401-18:59-PA_RISC2.0 PA2.0 (aCC_AP), mixed mode)

thankyou,
Chris
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: Obtaining a stack trace from an application core dump on HP-UX

When you invoke gdb using gdb myexe core the very first thing it does is produce a stack trace w/o any additional commands.
If it ain't broke, I can fix that.
Chris Borrill
New Member

Re: Obtaining a stack trace from an application core dump on HP-UX

I have found the following document which describes in detail how to do what you suggested:

http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,914,00.html

thankyou,
Chris
Auxilia Jansi Rani
New Member
Solution

Re: Obtaining a stack trace from an application core dump on HP-UX

HP gdb shows stack traces of mixed Java, C, and C++ programs.

The stack trace functionality requires Java SDK version 1.3.1.02 or later for HP-UX. To find
the availability of Java SDK version 1.3.1.02 or later, go to the HP web site for Java,
http://www.hp.com/go/java.

To enable this feature, set the environment variable, GDB_JAVA_UNWINDLIB, to the path
to libjunwind.sl. This library is part of the Java SDK version 1.3.1.02 or later for HP-UX.
When GDB_JAVA_UNWINDLIB is set to the path for a valid Java unwind library, stack traces
display Java and C/C++ frames.

The types of Java frames supported are as follows:
├в ┬в Interpreter
├в ┬в Compiled frames
├в ┬в Adapter frames


Steps :

* Library supporting Java unwind must be specified
* Set the environment variable:
GDB_JAVA_UNWINDLIB
export GDB_JAVA_UNWINDLIB=/libjunwind.sl
* Location of library in the J2SE release (1.3.1+):
jre/lib/PA_RISC2.0[W]/libunwind.sl
Example:
export GDB_JAVA_UNWINDLIB=/opt/java1.3/jre/lib/PA_RISC2.0/libjunwind.sl


$ gdb
(gdb) bt

if multithreaded application,

(gdb) thread apply all bt

Let us know if you need more clarification.