# How to Dump a Core File on MacOS (Monterey 12.5)
A core dump (file) records the memory and state of a program at some moment in time, usually when it terminates abnormally. Core dumps can be useful in debugging in certain situations.
On MacOS, the ability to dump a core file must be enabled. The following steps describe how.
### 1. Ensure ```/cores``` Directory is Writable
Core-files are stored in the ```/cores``` directory on MacOS. You must have permission to write to it. To ensure this:
The kernel state variable ```kern.coredump``` must be set in order to dump core-files. This needs to be set only once; it is persistent between reboots. To set it:
For an executable to dump a core-file it must be signed. To do this, create an ```.entitlements``` file with the com.apple.security.get-task-allow entitlement set: