1

I compiled some C code, once with gcc, and then with g++, so I got two output executable files. When executing both files I found that it told me:

Segmentation fault (core dumped)

But there is no sign of any core dumps in /var/crash to do with this (only old stuff) so where would they be (I wouldn't expect them to be in there, but just thought I'd mention that I had checked)? I am running Ubuntu GNOME 16.04 with GNOME 3.20.

  • 2
    Whats the output of ulimit -c? – heemayl Jun 26 '16 at 21:08
  • @heemayl: The output is 0. – user364819 Jun 26 '16 at 21:34
2

Core dumping is disabled by default in Ubuntu by setting the maximum dumping file size to 0 for all users.

You can check this by:

ulimit -c

By default it would show 0.

Now to enable core dumping, set the size to the value you want (or unlimited).

For example, setting the maximum dumping file size as 4 KB:

ulimit -c 8

-c takes block numbers with each block being 512 Bytes.

Setting to unlimited (Not recommended):

ulimit -c unlimited

This will change the limit for the current user and not permanently. To make the changes effective for users selectively and permanently, you should edit the /etc/security/limits.conf file and set your desired values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy