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.