How to generate a core dump in Linux on a segmentation fault?

前端 未结 12 1236
余生分开走
余生分开走 2020-11-22 17:06

I have a process in Linux that\'s getting a segmentation fault. How can I tell it to generate a core dump when it fails?

12条回答
  •  一个人的身影
    2020-11-22 17:26

    There are more things that may influence the generation of a core dump. I encountered these:

    • the directory for the dump must be writable. By default this is the current directory of the process, but that may be changed by setting /proc/sys/kernel/core_pattern.
    • in some conditions, the kernel value in /proc/sys/fs/suid_dumpable may prevent the core to be generated.

    There are more situations which may prevent the generation that are described in the man page - try man core.

提交回复
热议问题