4

I was trying to generate a core file in Ubuntu 18.04. My program generates a core file, but I'm not able to find it.

$ ./a.out
Segmentation fault (core dumped)
$ ls -lrt
total 32
-rwxrwxrwx 1 sanjay sanjay   302 Mar  4 16:38 segmentation.cpp
-rwxrwxrwx 1 sanjay sanjay 28720 Mar  4 16:47 a.out
Zanna
  • 72,312
sam
  • 41
  • 1
  • 1
  • 2

2 Answers2

13

Since non-programming users can learn little from coredumps, your shell likely suppresses them by default by setting the ulimit value to zero:

$ ulimit -c
0

You can set the value to any non-zero size, or simply remove the limit altogether using ulimit -c unlimited

See help ulimit or refer to man bash for details.

steeldriver
  • 142,475
0

check out Where do I find the core dump in ubuntu 16.04LTS?

In Ubuntu the core dumps are handled by Apport and can be located in /var/crash/. But it is disabled by default in stable releases