Methods and settings for generating core dump files under Linux

Source: Internet
Author: User

The concept of core dump:

A core dump is the recorded state of the working memory of a computer in a specific time, generally when The program has terminated abnormally (crashed). In practice, other key pieces of program state is usually dumped at the same time, including the processor registers, WHI CH may include the program counter and stacks pointer, memory management information, and other processor and operating Sys TEM flags and information. The name comes from the Once-standard memory technology core memory. Core dumps is often used to diagnose or debug errors in computer programs.

On many operating systems, a fatal error in a program automatically triggers a core dump, and by extension the phrase ' to Dump core "have come to mean, in many cases, any fatal error, regardless of whether a record of the program memory is creat Ed.


Under the Linux platform, set the method for the core dump file generation:

1) Enter ULIMIT-C in the terminal if the result is 0, the system does not generate a core dump when the program crashes.

2) Use the Ulimit-c Unlimited command to turn on the core dump function without limiting the size of the generated core dump file. If you need a limit, add a numeric limit. Ulimit-c 1024

3) By default, core dump generates a file named core and is in the program's current directory. The new core will overwrite the existing core. By modifying the/proc/sys/kernel/core_uses_pid file, the PID of the process can be used as the extension, and the resulting core file format is core.xxx, where xxx is the PID

4) You can control the location and file format of the core file by modifying the/proc/sys/kernel/core_pattern. For example, to generate all the core files into the/corefile directory, the file name format is core-command name-pid-timestamp. echo "/corefile/core-%e-%p-%t" >/proc/sys/kernel/core_pattern

Methods and settings for generating core dump files under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.