?
Solved

analysing core file dumps

Posted on 2003-03-31
11
Medium Priority
?
425 Views
Last Modified: 2010-04-21
How to analyse the core file dumps generated by unix programs when they crash.

Are there any tools available ?

KHem
0
Comment
Question by:k_suchdeva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 9

Expert Comment

by:mglxxx
ID: 8243916
All UNIX-like OSes I've seen so far come with a debugger
(often called dbx). Using the debugger, the faulty program executable, and the core file you can perform
a post-mortem analysis of a program crash.

E.g., on AIX you call dbx with the full path to the program
which created the core in the directory where you put the
core.

What kind of UNIX are you using?
0
 
LVL 2

Author Comment

by:k_suchdeva
ID: 8244033
uname -a
SunOS venus 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-4
0
 
LVL 18

Expert Comment

by:liddler
ID: 8244382
Download and install gdb from www.sunfreeware.com
Then run:
gdb /path/to/program /path/to/core
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ecw
ID: 8247800
adb
0
 

Accepted Solution

by:
sabya_m earned 60 total points
ID: 8249195
You can try several options.
Try
 strings core | more // see the code flow
 adb // to see the stack trace
 gdb -c core // to see the backtrace . You need to type where or bt after this.
0
 
LVL 2

Author Comment

by:k_suchdeva
ID: 8250656
It seems as if i need to know a lot of stuff to diagnose the program with gdb.

Can you point me to some gdb manual which explains me everything from basic to advanced level.

Thanks
Khem
0
 

Expert Comment

by:sabya_m
ID: 8250711
I do not have a gdb manual with me right now.
You can do man gdb to find some useful info.
But you follow the steps like these.
gdb -c core // or gdb core a.out
bt // or where [bt is backtrace , it gives the lines or function calls just before the crash]
0
 
LVL 2

Author Comment

by:k_suchdeva
ID: 8250818
[ksachd@venus ksachd]$ gdb  -c core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
Here is the output.

GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.7".
Core was generated by `-bash'.
Program terminated with signal 10, Bus Error.
#0  0x30408 in ?? ()
(gdb) bt
#0  0x30408 in ?? ()
#1  0x3044c in ?? ()
#2  0x40948 in ?? ()
#3  0x43ae8 in ?? ()
#4  0x447dc in ?? ()
#5  0x44f34 in ?? ()
#6  0x45668 in ?? ()
#7  0x46760 in ?? ()
#8  0x4698c in ?? ()
#9  0x4634c in ?? ()
#10 0x3384c in ?? ()
#11 0x30fac in ?? ()
#12 0x306a4 in ?? ()
#13 0x3233c in ?? ()
#14 0x310ec in ?? ()
#15 0x306a4 in ?? ()
#16 0x2714c in ?? ()
#17 0x25694 in ?? ()
(gdb)

Could not figure out anything from this.

0
 
LVL 9

Expert Comment

by:mglxxx
ID: 8251483
Bash throwing cores is rather unusual.
The stack trace looks like bash was compiled without
keeping any symbol information. Will be almost impossible
to analyse this core.

For documentation about gdb:
All GNU tools come with documentation in the GNU 'info'
format. In order to read the documentation, you install
GNU info. If info is installed, 'info gdb' will access
the gdb docs. If you have TeX on your machine, you can
also convert the documentation into a form suitable for
printing. Look for files having the extension '.texi' and
run these through TeX.
0
 
LVL 9

Expert Comment

by:mglxxx
ID: 8251486
I you are more comfortable using GUI tools, take
a look at DDD. It's a GUI frontend for gdb and dbx.
0
 
LVL 1

Expert Comment

by:Santunes
ID: 8254767
In order to have debug information, your program needs
to be compiled with -g flag.

gcc -g -o prog prog.c

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month9 days, 3 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question