Search code examples
macossegmentation-faultosx-snow-leopardcoredump

Does Snow Leopard put core dumps somewhere special?


I'm trying to debug a segfault on an application I'm working on (works on linux of course, so I can't use that as my fallback for debugging core dumps). Anyhow, I've set "ulimit -c unlimited" and snow leopard reports "Segmentation fault (core dumped)" but alas there is no core file to be found. Does Snow Leopard put them somewhere special or is there some other option I need to enable? Surprisingly little returned when I google this...


Solution

  • You need to configure launchd so that it actually writes out the core dumps. You can find instructions for doing so in this Apple TechNote.

    Basically, you need to enable Core Dumps by adding the line:

    limit core unlimited
    

    to your /etc/launchd.conf file, creating it if necessary, and then restarting.

    You can also enable the core dump for a single terminal session by calling:

    ulimit -c unlimited
    

    before you launch your command-line app.

    You can find the core dumps in /cores. Be careful, as core dumps can be large and can easily fill up your drive if you don't clean out the /cores directory on a regular basis.