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
Since non-programming users can learn little from coredumps, your shell likely suppresses them by default by setting the
ulimit
value to zero: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 toman bash
for details.check out Where do I find the core dump in ubuntu 16.04LTS?