Linux core dump

Source: Internet
Author: User

When we develop or use a program, the most feared thing is that the program fails. Although the system is okay, we may encounter the same problem next time. Then, the operating system will dump out the memory content when the program is down, and let us or debugger as a reference. This action is called core dump.


1. What is core?
Before using semiconductors as memory materials, humans use coils as memory materials and the inventor is Wang An. The coils are called core and the memory made by coils is called core memory. Today, the semiconductor industry is booming and no one has used core memory. However, in many cases, memory is still called core.


2. What is Linux core dump?
When we develop or use a program, the most feared thing is that the program fails. Although the system is okay, we may encounter the same problem next time. Then, the operating system will dump out the memory content when the program is crashed, which is usually written in a file called core.) Let us or debugger as a reference. This action is called Linux core dump.


3. Why does Linux core dump occur?
As mentioned above, an error occurs when the program fails. In C/C ++, the most common error occurs when the needle is faulty. You can use the core file and debugger to locate errors. How can you use the core file in the debugger? Man: gdb !).


4. Can I delete the core file?
If you don't, don't, and don't need to modify the program, you can safely delete it! How can we avoid the appearance of core files? If tcsh is used, try adding a line in. tcshrc: limit coredumpsize 0
If bash is used, add (or modify) one in/etc/profile: ulimit-c 0


5. There is a trick to show you the best use of core.
After entering gdb-c core, you can show which row of the program you are dropping, and which function is where the row is being dropped, which function calls this function, and which function calls this function .... until main () by this information, you can find out the bug ........ it has been tried and tested, but it is a prerequisite that you must open the debug information option in compile. Otherwise, there will be a lot of things you don't understand, rather than your favorite source program.

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.