It seems like I can not generate core dumps in Mac OS X 10.6.8.
$ ulimit -c unlimited
$ ./a.out
Hello world!
Segmentation fault
$ find ~/ -type f -name core
You can generate core dump files on Mac Os X like this:
Create the file : /etc/launchd.conf
, then :
echo "limit core unlimited" | sudo tee -a /etc/launchd.conf
Restart your Mac.
And that's it, the core dump files are generated in the /cores
directory. Be careful the core dump files are large files so when you finishing troubleshooting your code, remove them.