1833704 Members
2616 Online
110062 Solutions
New Discussion

Re: use of core dump

 
siva baskaran
Regular Advisor

use of core dump

Dear all,

whatever task we can be done core dump file and what are the main functions how can use this for troubleshooting purpose

thanks
siva
6 REPLIES 6
Bill Hassell
Honored Contributor

Re: use of core dump

There is only one use for a core file if you did not write the program and that is to identify the program which failed. Use this command:

cd /directory-with_corefile
file core

This will show the name of the program that failed and the signal that caused the program to terminate. Notice I did not say "the reason for the failure". Signals are generated when a program makes a mistake like going outside of memory bounds, overflowing a stack, referencing an illegal memory address, etc. So the program is signaled and it will either handle the signal or crash with a core dump.

If you did not write the program, there is no further information you can use to fix the bad program with the possible exception of changing maximum program limits for RAM usage.

If you wrote the program and have the source code, there are tools bundled in with your compiler such as tusc which can trace the program's execution and show where in the code the error is detected.


Bill Hassell, sysadmin
sathish kannan
Valued Contributor

Re: use of core dump

Hello Siva,

You need the source code to cleary understand the contents of the core file.
Having said that, you can use file command to determine which application caused the coredump.

I have some experiece with Coredumps, when some of my application coredumps, i have used "strings -a" to read the contents again it won't give all the answers. But worth reading it

#file core

#strings -a core


Regards
Sathish
Don't Think too much
Muthukumar_5
Honored Contributor

Re: use of core dump

You can get to know that which application is made this core? What is the problem state (stack trace) and debug informations to fix the problem.

Use the method to debug core:

a) file core
b) what core
c) strings -a core
d) gdb binary core
gdb>bt

e) adb binary core
adb> $c

--
Muthu
Easy to suggest when don't know about the problem!
Raj D.
Honored Contributor

Re: use of core dump

Siva ,

You can do strings on the core file to know from which application the core file has been generated , and then you can analyse it or can remove it , to save disk space.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Arunvijai_4
Honored Contributor

Re: use of core dump

Hi Siva,

"core" is one of the best ways of determining a problem with any application runs on Unix.

In the Unix environments, core is a synonim of central memory, or RAM. The word is due to the fact the the original central memory forms were implemented as a network of magnetic iron nucleous: the nucleous memory, or core. For this reason, often, when a process teminates abnormally, the operating system dumps the image of its core memory. This file has the name core dump (obviously) and can be later on analysed by using diagnostic tools.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Senthil Prabu.S_1
Trusted Contributor

Re: use of core dump

hi siva,
Basically core is dumped because the application crashed. It helps you to debug and analyse the problem.

Use have to familiar with debuggers like gcc, adb to analyse the core.



You can get to know that which application is made this core? What is the problem state (stack trace) and debug informations to fix the problem.

To debug and analyse thecore:

gdb binary core
gdb>bt


HTH,
Prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.