Sei sulla pagina 1di 4

Getting a Stack Trace from a CORE file « PeopleSoft Page 1 of 4

PeopleSoft
PeopleSoft and Oracle weblog

 About

Posted by: repettas | October 13, 2007

Getting a Stack Trace from a CORE file


Try the following the steps below you can provide Oracle support with vital information to help identify the cause of a problem. Please note that it is
important to include information about the tool being used to help identify the cause of a problem.

If the core file contains multiple threads, use Note: 118252.1

What is a ‘core dump’?

A core dump is an image copy of a process state at the instant it ‘aborted’. It is produced in the form of a file called ‘core’ usually located in the current
directory.

What causes a core dump ?

There are many situations which can cause a core dump to be produced, but it is usually because the process has attempted to do something which the
operating system does not like. The most common causes of this are:

The program tried to access memory outside its allowed range.


The program tried to obtain a resource which was either exhausted or unavailable.
An attempt was made to execute an illegal instruction(s).
An attempt was made to read unaligned data.

In UNIX systems the offending process is sent one of a number of signals which force a core dump to be produced. It is also possible for a user to produce
a core dump by sending one of these signals to a process manually.

What should I do if I get a core dump ?

As with any problem you should first note down the FULL version numbers of the product, the RDBMS, PL/SQL (if used) and any related products.

You should also note the EXACT command you were running when this occurred. Eg: If it was a SQL*Forms problem and you were using
‘mrunform30′, write this down. This command will be referred to as ‘program’ below.

Now follow the instructions below in order:

1. Check if you have a ‘core’ file, it should be in the directory where the command was issued, or in CORE_DUMP_DEST/core_NNNNNN if it is the
‘oracle’ executable. “oracle” can also produce core files in $ORACLE_HOME/dbs/core_NNNNNN or $ORACLE_HOME/dbs.

2. Log in as Oracle and cd to the directory containing the core file. Then issue:

file core

This should identify the “program” name to use in the next step, e.g.: oracle

3. Log in as Oracle and change in to to the $ORACLE_HOME/bin directory. Enter the command:

file program

and write the result down letter for letter. If the word ‘dynamic’ or ‘dynamically linked’ appears in the output of this command then please make a note of
this as there are a few platforms on which Oracle does NOT support dynamically linking and this may be the cause of your problem.

4. Now enter:

chmod +r program

to add read permission to the program.

5. Log out, then log in as the user who encountered the error. The next step will vary slightly depending on which version of Unix you are using. One of
the following commands should exist on your machine – try each in order until you find one that exists. In some cases you may be asked for stacks from
all threads so use the “thread” version of the command if it exists:

Command NB Exit Command Stack Trace Command


——— — ————- ——————-
dbx quit where
xdb HPUX 10 quit t
gdb HPUX 11 q bt
dde HPUX 11 q bt
sdb q t
adb $q or Ctrl-D $c
debug (PTX only) quit stack
gdb LINUX quit bt or thread apply all where

http://repettas.wordpress.com/2007/10/13/getting-a-stack-trace-from-a-core-file/ 21/01/2011
Getting a Stack Trace from a CORE file « PeopleSoft Page 2 of 4

Change to the directory where the core dump is located and enter the commands as in the relevant example below. If you are not sure which program
produced the ‘core’ file then on some UNIX platforms the command ‘file core’ will tell you the executable name that the core file is from (this does not
work on ALL Unix platforms, see note below.)

Example commands:

DBX: $ script /tmp/mystack


$ dbx $ORACLE_HOME/bin/ core
(dbx) where
… << stack should appear here
$ exit

XDB: $ script /tmp/mystack


$ xdb $ORACLE_HOME/bin/ core
(xdb) t
… << stack should appear here
$ exit

SDB: $ script /tmp/mystack


$ sdb $ORACLE_HOME/bin/ core
(sdb) t
… << stack should appear here
$ exit

Note: In the ‘adb’ commands below literally type the $c and $q

ADB: $ script /tmp/mystack


$ adb $ORACLE_HOME/bin/ core
$c << NB: adb has no prompt so just enter $c

$q
$ exit

DEBUG: $ script /tmp/mystack


$ debug -c core $ORACLE_HOME/bin/
debug> stack
… < quit
$ exit

GDB: $ script /tmp/mystack


$ gdb $ORACLE_HOME/bin/ core
(gdb) bt
… << stack should appear here
(gdb) thread apply all where
… << stacks for all threads here
(gdb) quit
$ exit

DDE: $ script /tmp/mystack


$ dde -ui line core $ORACLE_HOME/bin/
dde> bt

dde> q
$ exit

Assuming this worked then the stack trace should be shown in the file ‘/tmp/mystack’. Upload this to Oracle Support.

6) If the debug command failed to give a stack trace then try using a different debugger from the list above (if available). If all debuggers fail then there is
probably a problem with either the permissions or the file type – see the section below and then contact Oracle Support with all the details you have so
far.

Common reasons for not getting a sensible stack:

Filesize Limits: Note that on some machines there may be a kernel parameter or user limit which controls the maximum size of core file that can be
produced – you can usually check this by typing:

limit - in the C shell


ulimit -a - in the Bourne / Korn shells

If this limit is too small the core file will be useless – raise the limit and reproduce the problem.

Stripped Executable: Some program executables are stripped of symbol information. This makes the stack trace useless. If ‘file program’ shows the word
‘stripped’ or ‘nm program’ shows no output then it is likely that the executable is stripped of symbolic information. In this case the problem tool must be
relinked without being stripped – on most Unix platforms this involves ensuring there is no ‘-s’ option on the link line. Contact Oracle Support with
details of the link line used to link the tools.

HP UNIX: Some platforms like HP Unix need a special object file linking in at link time to ensure symbols in shared objects can be reported by the debug
tool. Typically this involves relinking the tool including /usr/lib/end.o on the link line. The location of this special file may be different depending on your
HPUX version. ‘xdb’ generally tells you the location of this file if it was not linked into the executable.

If ‘file core’ does not return the executable name:

http://repettas.wordpress.com/2007/10/13/getting-a-stack-trace-from-a-core-file/ 21/01/2011
Getting a Stack Trace from a CORE file « PeopleSoft Page 3 of 4

Try using the ‘strings’ command:

csh> setenv LANG C


or
ksh> LANG=C; export LANG … to get rid of non-ASCII characters return by ‘strings’
> strings -a core | more

The first part of the output may reveal the executable name.

Ads by Google
Pam Hsiang Trading Co Ltd
Rubber & tire making machine, Coil & transformer making machine.
www.pht6168.com
EMI Shielding Solutions
Circuit Board Shields, EMI Gaskets, Ferrites, RF Absorbers for EMI/RFI
www.LeaderTechInc.com
Industrial Drilling Tools
Exporter & Stockist of Magnetic Drill Machine & Annular Cutter
www.dancontrade.com
Download Google Chrome
Searching is fast and easy with Google's web browser.
www.Google.com/Chrome

Posted in Oracle, Oracle Managment, Performance | Tags: Management, Oracle, Tuning

« Tracing Sessions in Oracle using the DBMS_SUPPORT Package


How to Process an Express Core File Using dbx, dbg, dde, gdb or ladebug »

Like Be the first to like this post.

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *

Email *

Website

Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite="">
<cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Comment

Notify me of follow-up comments via email.

Subscribe by email to this site

Categories
 Apple
 Office 2008
 OS X
 Parallels Desktop Mac OS X
 Blogroll
 DBA
 Oracle
 ASM
 Clusterware
 EMCA
 Oracle Managment
 Performance
 RMAN
 PeopleSoft
 PeopleSoft Query
 PeopleTools

http://repettas.wordpress.com/2007/10/13/getting-a-stack-trace-from-a-core-file/ 21/01/2011
Getting a Stack Trace from a CORE file « PeopleSoft Page 4 of 4

 Oracle Application Server


 Perl
 Personal
 Uncategorized
 UNIX
 Windows Operating Systems
 Windows Server
 Windows XP

Browse
Monthly Archives

Search

Links
 Grey Sparling PeopleSoft Expert’s Corner
 Oracle Technology Network
 PeopleSoft
 PeopleSoft Corner
 WordPress.com
 WordPress.org

Subscribe
 Entries (RSS)
 Comments (RSS)

Blog at WordPress.com. | Theme: Ocean Mist by Ed Merritt.

http://repettas.wordpress.com/2007/10/13/getting-a-stack-trace-from-a-core-file/ 21/01/2011

Potrebbero piacerti anche