What is Core Dump?

Source: Internet
Author: User

Turn from: http://blog.csdn.net/ljx0305/article/details/4065082


Today, debug a program, with the core dump, so write it, remember that.
What is Core Dump?
Core means memory, dump means to throw it out and heap it out.
When you develop and use a UNIX program, sometimes the program is inexplicably down, without any hints (sometimes prompting the core dumped). At this time you can see if there is a core. Process number of the file generation, this file is the operating system when the program down when the memory content thrown out to generate, it can be used as a reference to debug the program.
Core dump is also called the central Dump, when the program runs abnormal, the program abnormal exit, the program's current memory state of the system stored in a core file, called Core dump.

How do I use core files?
Gdb-c core file path [path of application]
Enter the where you want to return, and you can show which line the program is in and in which function.

Why is there no core file generation?
Sometimes the program down, but the core file is not generated. The core file generation is related to your current system environment settings, you can set it up with the following statement, and then run the program to generate the core file.
Ulimit-c Unlimited
Core files are generated in the same location as the path where the program is run, and the filename is typically core. Process number

4. View core files with GDB:
Here we can take a core dump when a run-time signal causes an error.
After core dump occurs, use GDB to view the contents of the core file to locate the row in the file that is causing the core dump.
GDB [exec file] [core file]
Such as:
GdB./test Test.core
After entering GDB, check backtrace with the BT command to check where the program is running to locate the file-> line of core dump.

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.