| United States-English |
|
|
|
![]() |
Java™ Troubleshooting Guide for HP-UX Systems: > Chapter 3 Getting Help from Hewlett-PackardCollecting Problem Data |
|
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. 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 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.
The following subsections provide additional details on each of these steps. The size of the-Xmx option affects the core file size. Use these rules to estimate the size of the Java core file:
Check your coredump block size to make sure it is set to unlimited using the ulimit -a command:
If coredump is not set to unlimited, set it to unlimited using the ulimit -c command:
Check the amount of disk space available in the current working directory using the df -kP command:
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:
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:
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:
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:
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:
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:
This capability is turned on only for the current boot. 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:
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:
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.
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:
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:
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. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||