Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • Last Modified:

analysing core file dumps

How to analyse the core file dumps generated by unix programs when they crash.

Are there any tools available ?

KHem
0
k_suchdeva
Asked:
k_suchdeva
  • 3
  • 3
  • 2
  • +3
1 Solution
 
mglxxxCommented:
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
 
k_suchdevaAuthor Commented:
uname -a
SunOS venus 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-4
0
 
liddlerCommented:
Download and install gdb from www.sunfreeware.com
Then run:
gdb /path/to/program /path/to/core
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ecwCommented:
adb
0
 
sabya_mCommented:
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
 
k_suchdevaAuthor Commented:
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
 
sabya_mCommented:
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
 
k_suchdevaAuthor Commented:
[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
 
mglxxxCommented:
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
 
mglxxxCommented:
I you are more comfortable using GUI tools, take
a look at DDD. It's a GUI frontend for gdb and dbx.
0
 
SantunesCommented:
In order to have debug information, your program needs
to be compiled with -g flag.

gcc -g -o prog prog.c

0

Featured Post

Independent Software Vendors: 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!

  • 3
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now