How to generate a core dump file in linux and how to set it

Source: Internet
Author: User

How to generate A core dump file in linux and set the concept of core dump: a core dump is the recorded state of the working memory of a computer program at A specific time, generally when the program has terminated abnormally (crashed ). in practice, other key pieces of program state are usually dumped at the same time, including the processor registers, which may include the program counter and stack pointer, memory management informa Tion, and other processor and operating system flags and information. the name comes from the once-standard memory technology core memory. core dumps are often used to diagnose or debug errors in computer programs. on your operating systems, a fatal error in a program automatically triggers a core dump, and by extension the phrase "to dump core" has come to mean, in your cases, fatany Al error, reg Ardless of whether a record of the program memory is created. on linux, set the core dump file generation method: 1) Enter ulimit-c in the terminal. If the result is 0, the system cannot generate a core dump when the program crashes. 2) use the ulimit-c unlimited command to enable the core dump function without limiting the size of the generated core dump file. If you need to limit the number, add a number limit. Ulimit-c 1024 3) by default, the file name generated by core dump is core, and it is in the current directory of the program. The new core overwrites the existing core. By modifying the/proc/sys/kernel/core_uses_pid file, you can use the pid of the process as the extension. The generated core file format is core. xxx, where xxx is pid 4) You can modify/proc/sys/kernel/core_pattern to control the location and format of the core file. For example, to generate all core files to the/corefile directory, the file name format is core-command name-pid-timestamp. echo "/corefile/core-% e-% p-% t">/proc/sys/kernel/core_pattern

Related Article

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.