All Topics  
Core dump

 

   Email Print
   Bookmark   Link






 

Core dump



 
 
In computing
Computing

Computing is usually defined as the activity of using and developing computer technology, computer hardware and computer software. It is the computer-specific part of information technology....
, a core dump consists of the recorded state of the working memory
Computer storage

Computer data storage, often called storage or memory, refers to computer components, devices, and recording medium that retain digital data used for computing for some interval of time....
 of a computer program
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 at a specific time, generally when the program has terminated abnormally (crash
Crash (computing)

A crash or in computing is a condition where a program stops performing its expected function and also stops responding to other parts of the system....
ed). In practice, other key pieces of program state
Context switch

A context switch is the computing process of storing and restoring the State of a Central processing unit such that multiple Process es can share a single CPU resource....
 are usually dumped at the same time, including the processor register
Processor register

In computer architecture, a processor register is a small amount of Computer storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere....
s, which may include the program counter and stack pointer, memory management information, and other processor and operating system flags and information.






Discussion
Ask a question about 'Core dump'
Start a new discussion about 'Core dump'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computing
Computing

Computing is usually defined as the activity of using and developing computer technology, computer hardware and computer software. It is the computer-specific part of information technology....
, a core dump consists of the recorded state of the working memory
Computer storage

Computer data storage, often called storage or memory, refers to computer components, devices, and recording medium that retain digital data used for computing for some interval of time....
 of a computer program
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 at a specific time, generally when the program has terminated abnormally (crash
Crash (computing)

A crash or in computing is a condition where a program stops performing its expected function and also stops responding to other parts of the system....
ed). In practice, other key pieces of program state
Context switch

A context switch is the computing process of storing and restoring the State of a Central processing unit such that multiple Process es can share a single CPU resource....
 are usually dumped at the same time, including the processor register
Processor register

In computer architecture, a processor register is a small amount of Computer storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere....
s, which may include the program counter and stack pointer, memory management information, and other processor and operating system flags and information. The name comes from the once-standard core memory technology. Core dumps are often used to diagnose or debug errors in computer programs.

On many operating systems, a fatal error
Fatal error

In computing, a fatal error is an error which causes a program to abort - and thus may return the user to the operating system. When this happens, data that the program was processing may be lost....
 in a program automatically triggers a core dump, and by extension the phrase "to dump core" has come to mean, in many cases, any fatal error, regardless of whether a record of the program memory results.

The term "core dump" has become jargon to indicating any circumstance where large amounts of unedited data get deposited for further examination.

Background

Before the advent of disk operating systems and the ability to record large data file
Data file

A data file is a computer file which stores data for use by a computer Application software or System software. It generally does not refer to files that contain instructions or code to be executed , or to files which define the operation or structure of an application or system ; but specifically to information used as input, and/or wri...
s, core dumps came in the form of paper printouts of the contents of memory, typically arranged in columns of octal
Octal

The octal numeral system, or oct for short, is the radix-8 number system, and uses the digits 0 to 7. Numerals can be made from Binary numeral system numerals by grouping consecutive digits into groups of three ....
 or hexadecimal
Hexadecimal

In mathematics and computer science, hexadecimal is a numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 09 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen....
 numbers (the latter was sometimes called a "hex dump
Hex dump

Hex dump is a hexadecimal view of computer memory. Each byte is represented as a two-digit hexadecimal number. Hex dumps are commonly organized into rows of 8 or 16 bytes, sometimes separated by whitespaces....
"), together with interpretations of various encodings such as machine language instructions, text strings, or decimal or floating-point numbers. In more recent operating systems, a "core dump" is a file containing the memory image of a particular process
Process (computing)

In computing, a process is an Object of a computer program that is being sequentially executed by a computer system that has the ability to run several computer programs Concurrency ....
, or the memory images of parts of the address space
Address space

In computing, an address space defines a range of discrete addresses, each of which may correspond to a physical or virtual memory register, a Node , peripheral device, disk sector or other logical or physical entity....
 of that process, along with other information such as the values of processor register
Processor register

In computer architecture, a processor register is a small amount of Computer storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere....
s. These files can be viewed in a readable text format similar to the older paper printouts as well using the proper tools such as objdump
Objdump

objdump is a program for displaying various information about object files. For instance, it can be used as a disassembler to view executable in assembly form....
.

Causes of core dumps


In high-level programming language
High-level programming language

In computing, a high-level programming language is a programming language with strong Abstraction from the details of the computer. In comparison to low-level programming languages, it may use natural language elements, be easier to use, or more Porting across platforms....
s, compilers usually generate programs with correct underlying instructions, and errors more frequently arise from logically complex situations such as accesses to non-existent memory. In practice, these are often buffer overflows, where a programmer allocates too little memory for incoming or computed data, or access to null pointers, a common coding error when an unassigned memory reference variable is accessed. Manual dumps may be caused by kill -6 or gcore . kill -6 dumps a thread dump.

Uses of core dumps

Core dumps can serve as useful debugging aids in several situations. On early standalone or batch-processing
Batch processing

Batch processing is execution of a series of Computer programs on a computer without human interaction.Batch jobs are set up so they can be run to completion without human interaction, so all input data is preselected through Script s or command-line parameters....
 systems, core dumps allowed a user to debug a program without monopolizing the (very expensive) computing facility for debugging. Besides, a printout was more convenient than debugging using switches and lights. On shared computers, whether time-sharing, batch processing, or server systems, core dumps allow off-line debugging of the operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
, so that the system can be back in operation immediately. Core dumps allow a user to save a crash for later or off-site analysis, or comparison with other crashes. For embedded computers
Embedded system

An embedded system is a special-purpose computer system designed to perform one or a few dedicated functions, often with real-time computing constraints....
, it may be impractical to support debugging on the computer itself, so a dump can be taken for analysis on a different computer. Some operating systems (such as early versions of Unix
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
) did not support attaching debugger
Debugger

A debugger is a computer program that is used to test and debug other programs. The code to be examined might alternatively be running on an Instruction Set Simulator, a technique that allows great power in its ability to halt when specific conditions are encountered but which will typically be much slower than executing the code directly on...
s to running processes, so core dumps were necessary to run a debugger on a process's memory contents. Core dumps can be used to capture data freed during dynamic memory allocation
Dynamic memory allocation

In computer science, dynamic memory allocation is the allocation of computer storage storage for use in a computer program during the runtime of that program....
 and may thus be used to retrieve information from a program that has exited or been closed. In the absence of an interactive debugger, the core dump may be used by an assiduous programmer to determine the error from direct examination.

A core dump represents the complete contents of the dumped regions of the address space of the dumped process. Depending on the operating system, the dump may contain few or no data structures to aid interpretation of the memory regions. In these systems, successful interpretation requires that the program or user trying to interpret the dump understands the structure of the program's memory use.

A debugger can use a symbol table
Symbol table

In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter , where each identifier in a program's source code is associated with information relating to its declaration or appearance in the source, such as its data type, scope level and sometimes its location....
 (if one exists) to help the programmer interpret dumps, identifying variables symbolically and displaying source code; if the symbol table is not available, less interpretation of the dump is possible, but there might still be enough possible to determine the cause of the problem. There are also special-purpose tools called dump analyzer
Dump analyzer

A dump analyzer is a programming tool which is used for understanding a machine readable core dump.The GNU utils strings , file , objdump, readelf and the powerful GNU Debugger can all be used to look inside core computer files....
s to analyze dumps. One popular tool that is available on almost all operating systems is the GNU Binutils' objdump
Objdump

objdump is a program for displaying various information about object files. For instance, it can be used as a disassembler to view executable in assembly form....
.

On modern Unix-like
Unix-like

A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
 operating systems, administrators and programmers can read core dump files using the GNU Binutils Binary File Descriptor library (BFD), and the GNU Debugger
GNU Debugger

The GNU Debugger, usually called just GDB, is the standard debugger for the GNU software system. It is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada programming language, C , C++, FreeBASIC, and Fortran programming language....
 (gdb) and objdump that use this library. This library will supply the raw data for a given address in a memory region from a core dump; it does not know anything about variables or data structures in that memory region, so the application using the library to read the core dump will have to determine the addresses of variables and determine the layout of data structures itself, for example by using the symbol table for the program it's debugging.

Core dumps can be used to save the context (state) of a process at a given state for returning to it later. One can make systems highly available systems by transferring core between processors, sometimes via coredump files themselves.

Core dump files


Format


In older and simpler operating systems, each process had a contiguous address-space, so a core dump file was simply a binary file with the sequence of bytes or words. In modern operating systems, a process address space may have gaps, and share pages with other processes or files, so more elaborate representations are used; they may also include other information about the state of the program at the time of the dump.

In Unix-like
Unix-like

A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
 systems, core dumps generally use the standard executable
Executable

In computing, an executable causes a computer "to perform indicated tasks according to encoded instruction ," as opposed to a file that only contains data ....
 image-format
File format

A file format is a particular way to encode information for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa....
: a.out
A.out (file format)

a.out is a file format used in older versions of Unix-like computer operating systems for executables, object code, and, in later systems, shared libraries....
 in older Unix
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
es, ELF
Executable and Linkable Format

In computing, the Executable and Linking Format is a common standard file format for executables, object code, shared libraries, and core dumps....
 in modern Linux
Linux

Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license...
, System V
UNIX System V

Unix System V, commonly abbreviated SysV , is one of the versions of the Unix operating system. It was originally developed by AT&T and first released in 1983....
, Solaris
Solaris Operating System

Solaris is a Unix-based operating system introduced by Sun Microsystems in 1992 as the successor to SunOS.Solaris is known for its scalability, especially on SPARC systems, and for originating many innovative features such as DTrace and ZFS....
, and BSD systems, Mach-O
Mach-O

Mach-O, short for Mach kernel object code file format, is a file format for executables, object code, shared libraries, dynamically-loaded code, and core dumps....
 in Mac OS X
Mac OS X

Mac OS X is a line of computer operating systems developed, marketed, and sold by Apple Inc., and since 2002 has been included with all new Macintosh computer systems....
, etc.

Naming


Dumps of user-processes traditionally get created as core.

System-wide dumps on modern Unix-like systems often appear as vmcore or as vmcore.incomplete.

See also

  • Savestate
  • Brain dump
    Brain dump

    The phrase brain dump refers to these things:* Generally, the transfer of a large quantity of information from one person to another or to a piece of paper can be referred to as a 'brain dump'....
  • Magnetic core memory
    Magnetic core memory

    Magnetic core memory, or ferrite-core memory, is an early form of random access computer memory. It uses small magnetic ceramic rings, the cores, through which wires are threaded to store information via the Polarity of the magnetic field they contain....


External links

  • Article "" by Guido Socher
  • Article "" by Frank Schoep


  • "Setting the core dump name schema" ""


  • Wikibook "Guide To Unix" for a reference to cshell's
    CSH

    CSH is a three-letter abbreviation with multiple meanings:* Caesium hydride, a crystalline solid with the molecular formula CsH* Calcium silicate hydrate, or calcium silicate hydrogel, the main component of cement paste...
     "limit coredumpsize $BLOCKS|unlimited" and bash's
    Bash

    Bash is a free software Unix shell written for the GNU Project. Its name is an acronym which stands for Bourne-again shell. The name is a pun on the name of the Bourne shell , an early and important Unix shell written by Stephen Bourne and distributed with Version 7 Unix circa 1978, and the concept of being "Born again Christianity"....
     "ulimit -c $BLOCKS|unlimited",
  • Wikibook "Reverse_Engineering/Other_Tools#GNU_Tools" for some more references to gnu tools.


  • -- BSD-licensed library for making core dumps
  • A 1980 song lamenting Segmentation violations and the resulting core dumps by Greg Boyd


Descriptions for the file format: