Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Java™ Troubleshooting Guide for HP-UX Systems: > Chapter 3 Getting Help from Hewlett-Packard

Collecting Problem Data

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Three pieces of information are essential for analyzing most crashes—the core file, the fatal error log, and the stack trace. The following sections provide instructions to collect this information.

Collecting Core File Information

This section begins with a checklist to follow to make sure you can collect useful core files. It then reviews how you can generate a core file if one is not generated for you. Finally, there is a discussion about how to verify that your core file is valid.

Core File Checklist

Core files contain useful information, if they are complete. Sometimes you need to configure your system to make sure you can save complete core files. Consider the following items to ensure you can create complete core files.

  1. Estimate the core file size.

  2. Ensure your process can write large core files.

  3. Verify you have enough free disk space.

  4. Make sure the directory where the core file will reside supports a large file system. If not, write the core file to a directory that does.

  5. Make sure you have the correct permissions to write core files.

The following subsections provide additional details on each of these steps.

Estimate Core File Size

The size of the-Xmx option affects the core file size. Use these rules to estimate the size of the Java core file:

  • -Xmx is less than 1,500 MB. The core file will be less than or equal to 2 GB.

  • -Xmx is between 1,500 and 2,400 MB. The core file will be less than or equal to 3 GB.

  • -Xmx is greater than 2,400 MB. The core file will be less than or equal to 4 GB.

Ensure Process Can Write Large Core Files

Check your coredump block size to make sure it is set to unlimited using the ulimit -a command:

$ ulimit -a 
time(seconds)        unlimited 
file(blocks)         unlimited 
data(kbytes)         4292870144 
stack(kbytes)        8192 
memory(kbytes)       unlimited
coredump(blocks)     4194303

If coredump is not set to unlimited, set it to unlimited using the ulimit -c command:

$ ulimit -c unlimited  

$ ulimit -a 
time(seconds)        unlimited 
file(blocks)         unlimited 
data(kbytes)         4292870144 
stack(kbytes)        8192 
memory(kbytes)       unlimited
coredump(blocks)     unlimited

Verify Amount of Disk Space

Check the amount of disk space available in the current working directory using the df -kP command:

$ df -kP /home/mycurrentdir
Filesystem          1024-blocks  Used  Available Capacity  Mounted on 
/dev/vg00/lvol5       1022152   563712   458440     56%    /home
Check If Directory Supports Large File Systems

Use the fsadm command as root to check if your directory supports large file systems. If you do not execute this command as root, you may not retrieve meaningful results. Following is an example:

<root>$ /usr/sbin/fsadm <mount_point>

The following example output shows a /extra file system that is set up to support large files and a /stand file system that is not set up to support large files:

<root>$ /usr/sbin/fsadm /extra
fsadm: /etc/default/fs is used for determining the file system type 
largefiles  

<root>$ /usr/sbin/fsadm /stand 
fsadm: /etc/default/fs is used for determining the file system type 
nolargefiles      

You can use the /usr/sbin/fsadm command to set the directory to support large files. For example, to convert an hfs file system from nolargefiles to largefiles, issue the following command:

$ fsadm -f hfs -o largefiles /dev/vg02/lvol1

Alternatively, if the directory does not support large file systems, you can write the core file to a different directory. Do this by setting the JAVA_CORE_DESTINATION environment variable (available starting with SDK 1.4.2) to the name of the directory and create the directory. For example:

$ export JAVA_CORE_DESTINATION=<alt_dir>
$ mkdir $JAVA_CORE_DESTINATION

Java creates a directory named core under the JAVA_CORE_DESTINATION directory where the core and hs_err_pid<pid>.log files are written. For example:

$ cd $JAVA_CORE_DESTINATION 
$ ls 
core.29757  

$ ll core.29757 
total 429296
-rw-------   1 test     users      219781020 Aug 29 12:33 core 
-rw-rw-rw-   1 test     users           2191 Aug 29 12:33 hs_err_pid29757.log
Ensure Permissions Allow Core Files

Some Java processes run setuid; that is, a process where the effective uid or gid differs from the real uid or gid. On HP-UX 11i v1 (11.11) and later versions a kernel security feature prevents core file creation for these processes. Use the following command when you are logged in as the root user to enable core dumps of setuid Java processes:

$ echo "dump_all/W 1" | adb -w /stand/vmunix /dev/kmem 

This capability is turned on only for the current boot.

Generating a Core File

Analyzing the core file is essential for troubleshooting problems. Core files are automatically generated for application aborts. For hung processes and performance issues, you need to generate them using the gdb dumpcore command.

The gdb dumpcore command forces the generation of a core file without killing a running process. This command causes a core file named core.<pid> to be created. The current process state is not modified when this command is issued.

The following example shows a Java application running on an Integrity system:

$ echo "dumpcore\nq" > gdb_cmds 
$ ps -u myuser | grep java 
12290 pts/6  12:58 java 
$ gdb --command=gdb_cmds -batch /opt/java1.4/bin/IA64N/java 12290 

This generates a core file in the current directory with the name core.12290.

On HP-UX 11i v3 (11.31), another way to generate a core file is by using the gcore command. The following example shows invocation of gcore to dump the core image of process 11050. The core image is written to the core.11050 file by default:

$ gcore 11050

Verifying a Core File

After you have successfully collected your core file, you should verify that it is complete and valid with the following two steps.

First, open the core file in gdb and check the error and warning messages. If the message “<corefilename> is not a core dump: File format not recognized“ is displayed when you open the file, your core file is invalid. The following example shows how to verify a core file produced by a 32-bit application on a PA-RISC system. In this example, the core file is valid.

$ gdb /opt/java1.4/jre/lib/PA_RISC2.0/server/libjunwind.sl core 
HP gdb 5.5.7 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00 and target hppa1.1-hp-hpux11.00. 
Copyright 1986 - 2001 Free Software Foundation, Inc. 
Hewlett-Packard Wildebeest 5.5.7 (based on GDB) is covered by the GNU General Public License. 
Type "show copying" to see the conditions to change it and/or distribute copies. 
Type "show warranty" for warranty/support.
.. 
Core was generated by `java'. Program terminated with signal 6, Aborted.  

#0  0xc0214db0 in kill+0x10 () from ./libc.2

Second, check to make sure that the core file was not truncated by issuing the “what core” command. If you do not see the dld.sl version at the bottom of the what output, then the core file is truncated and is not usable. In the following example, the dld.sl version exists at the bottom of the what output, so you know the core file is not truncated:

$ what core
 core: 
some other library names and version information ... 
92453-07 dld dld dld.sl B.11.48 EXP 051121

Collecting Fatal Error Log Information

When a Java application aborts, the fatal error log file (hs_err_pid<pid>.log) is generated. The contents of this file vary depending on the architecture and the Java version. (For example, early Java versions generate less information in the fatal error log.). Following is a summary of the type of information contained in this file:

  1. The error causing the Java VM to abort, including the pc, process id, and thread id at which the error occurred. For example:

        # An unexpected error has been detected by HotSpot Virtual Machine:    
        #     
        #  SIGSEGV (11) at pc=7541df20, pid=25675, tid=1
  2. The Java version and problematic frame. For example:

        # Java VM: Java HotSpot(TM) Server VM (1.4.2
        #                      1.4.2.10-060112-19:42-IA64N IA64 mixed mode) 
        # Problematic frame:     
        # j  spin.main([Ljava/lang/String;)V+5
       
  3. Information about the current thread, including:

    1. Executing thread

    2. siginfo at the point of failure

    3. Stack pointer and hex dump of the top of memory stack

    4. Hex dump at the location of the current pc

    5. Stack range and stack free space

  4. Process information, including:

    1. Dump of all active threads at the time of the abort (SDK 1.4.2.04+)

    2. Java VM state (whether at safepoint or not) (SDK 1.4.2.10+)

    3. mutex state (SDK 1.4.2.10+)

    4. Summary of heap status; for example:

             Heap   
             def new generation   total 5632K, used 144K [6d400000, 6da10000, 6e950000)  
             eden space 5056K,    2% used [6d400000, 6d424040, 6d8f0000)  
             from space 576K,     0% used [6d8f0000, 6d8f0000, 6d980000)  
             to space 576K,       0% used [6d980000, 6d980000, 6da100000
             tenured generation   total 12480K, used 0K [6e950000, 6f580000, 71400000)    
             the space 12480K,    0% used [6e950000, 6e950000, 6e950200, 6f580000)  
             compacting perm gen  total 16384K, used 1118K [71400000, 72400000, 75400000)       
             the space 16384K,    6% used [71400000, 71517860, 71517a00, 72400000)
    5. dynamic libraries loaded by the process (SDK 1.4.2.04+)

    6. Java VM arguments (SDK 1.4.2.04+)

    7. Java-related environment variables

  5. System Information. This includes operating system name, version, processor, memory, and system load. For example:

         OS: HPUX      
         uname:HP-UX B.11.23 U ia64     
         rlimit: STACK 98252k, CORE 2097151k, NOFILE 4096, AS infinity 
         load average:0.12 0.19 0.22 
    
         CPU:total 8 Processor     = McKinley    
         Processor features = branchlong   
         Memory: 4k page, physical 16743644k   
       
         vm_info: Java HotSpot(TM) Server VM (1.4.2.10-060112-19:42-IA64N)
         for hp-ux-ia64 built on Jan 12 2006 20:09:37 by jinteg with aCC

Collecting Stack Trace Information

On PA-RISC systems, a stack trace is printed to stderr when the application aborts. On Integrity systems, branch and general register contents are printed to stderr when an application aborts. The stack trace (PA-RISC systems) and register contents (Integrity systems) are not printed to the hs_err_pid<pid>.log file; therefore, the contents of stderr should be captured into a file and sent to HP along with the hs_err_pid<pid>.log, core file, and libraries.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2009 Hewlett-Packard Development Company, L.P.