Coredump Fault Analysis

Source: Internet
Author: User

If a program runs for 3 days before it goes wrong, this time

Do we have to use GDB to debug the program for 3 days?

At this point we need to use the core dump:

1, Core dump is also called kernel dump. When an exception occurs while the program is running, the Linux system can store the contents of the memory in a core file when the program goes wrong

, this process is called core Dump.

2. What kind of mistake does core dump use to deal with? It is mainly a segment error (segment fault) ...

The general performance is: A. Array access out of bounds B. Access null pointer c. stack Overflow d. Modify read-only memory

3. On Linux systems, the core dump function is turned off by default, but can be turned on/off via the Ulimit command

Open: Ulimit-c Unlimited

Close: ulimit-c 0

4. After core dump occurs, you can use GDB to view the contents of the core file and locate the error location of the program

Usage: GDB Program name core file name

GdB./test core.122223

5. Complete Example:

Gdb-c core.id Program Name

Input: Where. You can know who is calling and which line is down in which function.

or enter BT

Coredump Fault Analysis

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.