Home  >  Article  >  Operation and Maintenance  >  What is core dumped in linux?

What is core dumped in linux?

WBOY
WBOYOriginal
2022-05-31 18:25:5211143browse

In Linux, the segmentation fault "core dumped" refers to the behavior that when a program terminates abnormally or crashes during running, the operating system records the memory status of the program at that time and saves it in a file. ; In addition to memory information, some key program running status will also be dumped at the same time.

What is core dumped in linux?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

linux mid-section error core dumped

When a program terminates abnormally or crashes while it is running, the operating system will record the memory status of the program at that time and save it in a file. This behavior is It's called Core Dump (some Chinese are translated as "core dump").

We can think of core dump as a "memory snapshot", but in fact, in addition to memory information, some key program running status will also be dumped at the same time, such as register information (including program pointer, stack pointer) etc.), memory management information, other processor and operating system status and information.

Core dump is very helpful for programmers to diagnose and debug programs, because some program errors are difficult to reproduce, such as pointer exceptions, and core dump files can reproduce the situation when the program went wrong.

The example is as follows:

Background: Linux environment, enter su and a segfault (core dumped) occurs after entering the password

Reason: The handicap modified ~/.bashrc File

Solution: sudo su, press Enter and then CTRL C and then use vim to change the ~/.bashrc file back to its original content

What is core dumped in linux?

Recommended learning: Linux video tutorial

The above is the detailed content of What is core dumped in linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn