Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are core dumps written on Mac?

On Mac OS X, if I send SIGQUIT to my C program, it terminates, but there is no core dump file.

Do you have to manually enable core dumps on Mac OS X (how?), or are they written to somewhere else instead of the working directory?

like image 445
xyz Avatar asked Jan 17 '10 12:01

xyz


People also ask

Where are core dumps written?

By default, all core dumps are stored in /var/lib/systemd/coredump (due to Storage=external ) and they are compressed with zstd (due to Compress=yes ). Additionally, various size limits for the storage can be configured. Note: The default value for kernel.

How do I view core dumps?

In a terminal, run sleep 30 to start a process sleeping for 30 seconds. While it is running, press Ctrl + \ to force a core dump. You'll now see a core file in the directory you are in.

Where is the core folder on Mac?

The CoreServices folder is located in the Macintosh HD > System > Library folder, and contains a number of applications, background tasks, and shared resources that the system uses to provide various services to the user.


1 Answers

It seems they are suppressed by default. Running

$ ulimit -c unlimited 

Will enable core dumps for the current terminal, and it will be placed in /cores as core.PID. When you open a new session, it will be set to the default value again.

like image 118
xyz Avatar answered Oct 28 '22 16:10

xyz