Why are core dump files generated?

前端 未结 7 546
鱼传尺愫
鱼传尺愫 2020-12-05 11:10

Sometimes when I run my code, a core dump file is generated when I terminate the program by Ctrl+\\. The file name is of the form core.*.

7条回答
  •  离开以前
    2020-12-05 11:41

    A process dumps core when it is terminated by the operating system due to a fault in the program. The most typical reason this occurs is because the program accessed an invalid pointer value. Given that you have a sporadic dump, it's likely that you are using an uninitialized pointer.

    Can you post the code that is causing the fault? Other than vague generalizations it's hard to guess what's wrong without actually seeing code.

    As for what a core dump actually is, check out this Wikipedia article:

    • http://en.wikipedia.org/wiki/Core_dump

提交回复
热议问题