Hick
Hick

Reputation: 36374

What does a core dump of a C code mean ?

What does the extension of the core dump mean and how to read core dump file? As in when I open the file in text editors, I get garbage values.

Note : Its extension is something like .2369

Upvotes: 5

Views: 19766

Answers (4)

Frank Meerkötter
Frank Meerkötter

Reputation: 2858

A core file is the memory image of a process at that point in time when it was terminated. Termination could for example happen through a segmentation fault or a failed assert. To "view" a coredump you will need a debugger. It will allow you to examine the state of the process. This includes listing the stack traces for all the threads of the process. Printing the values of variables and registers. Note that this works "better" if you have debug information available.

Traditionally core files are just named "core". This has the not so nice effect that cores will overwrite them selfs before a developer/admin discovers them. Many modern platforms allow to give core-files custom names that contain additional information. The number at the end of your core could for example be the PID of the process that this core belonged to.

Upvotes: 7

danben
danben

Reputation: 83220

You can use gdb to read the core dump. The extension is the process id.

Here is a link to a thread explaining how to do this.

And here is a gdb tutorial.

Upvotes: 8

Amardeep AC9MF
Amardeep AC9MF

Reputation: 19034

The extension is most often the process ID that crashed. You need to examine the file with a debug tool.

Upvotes: 3

WhirlWind
WhirlWind

Reputation: 14112

Wikipedia can explain core dumps better than I, but

It is the dump of "core" memory; that is, the memory, registers, and other program state that the process holds when it crashes.

The value at the end of the filename must be system dependent. I normally use a debugger like GDB, in concert with my program to examine such files.

Upvotes: 3

Related Questions