Unable to create a core file for my crashed program

前端 未结 4 2436
遥遥无期
遥遥无期 2021-02-20 13:30

I am using Ubuntu 12.04 LTS. I wrote a simple program as follows to create crash

// null.c
#include

int main()
{
   int *p = NULL;
   int k=*p;
          


        
4条回答
  •  不思量自难忘°
    2021-02-20 14:31

    Your real question appears to be not "where is my core dump", but rather "how can I modify /proc/sys/kernel/core_pattern".

    sudo bash -c 'echo core.%e.%p > /proc/sys/kernel/core_pattern'
    

    should do the trick.

提交回复
热议问题