Preserving native core dump files for problem determination
 Technote (troubleshooting)
 
Problem(Abstract)
When an IBM® WebSphere® Application Server Java™ process crashes on a UNIX® system, it should produce a memory dump in a file named "core". Unfortunately, a subsequent crash will overwrite an existing core file. This document explains a technique for preserving an existing core file as part of the startup sequence for the WebSphere Application Server on UNIX systems.
 
Resolving the problem
An abnormal termination (crash) of the WebSphere Application Server process on a UNIX system will normally produce a memory dump file named "core", in the $WAS_HOME/bin directory. It is important to save this file for problem determination and diagnosis purposes.
This document discusses a technique which can be used to save these core files by modifying the Application Server start script (startServer.sh). This is important because a core file could potentially be overwritten.
  1. Create a directory into which the core files should be copied (e.g., $WAS_HOME/core.files)
  2. Change directory to the $WAS_HOME/bin directory (this is the directory containing startServer.sh)
  3. Make a backup copy of startServer.sh
  4. Edit startServer.sh
  5. Locate an appropriate place to insert the following instructions (e.g., on the line following the ". $binDir/setupCmdLine.sh" statement)
  6. Insert the following instructions:
#-----------------------------------------------------------------
# The following uses relative directory addressing to specify the
# destination directory into which the core files will be copied.
#-----------------------------------------------------------------
# Note: These steps are part of startServer.sh, which will be
# executed when the current directory is <WAS_HOME>/bin.
# Therefore, the actual directory being referenced is
# <WAS_HOME>/core.files/
# Also, this code is written assuming that ksh is the
# default shell interpreter.
#-----------------------------------------------------------------
CORE_HOME="../core.files/"
#-----------------------------------------------------------------
# If a "core" file exists, move and rename it.
# Note: The process of moving, and renaming the core file does not
# change the creation/modification time associated with the
# file. This information can be used to determine when the
# abnormal termination of the WebSphere Application Server
# process actually occurred.
#-----------------------------------------------------------------
if [ -e core ]; then
CORE_FILE=$CORE_HOME"WSAS.core."$(date "+%y-%m-%d.%H:%M:%S")
echo "Saving core as $CORE_FILE"
mv core $CORE_FILE
fi

When WebSphere Application Server is started using this script at a command prompt, the existing core file in the $WAS_HOME/bin directory will be renamed WSAS.core.<timestamp> and moved into $WAS_HOME/core.files directory.

Note that this is only effective if the server is started using a script which executes this code (such as startServer.sh, as suggested above), and not when a deployment manager instructs a node agent to start a server process.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > General
Operating system(s): Solaris
Software version: 5.1
Software edition:
Reference #: 1140522
IBM Group: Software Group
Modified date: Oct 20, 2005