For the More Curious: Core Files

Core files are a Unix-ism where a program that has crashed (usually by trying to read or write into memory it does not have access to) will write its entire address space to disk. You can then poke around this core file with gdb and see what was happening when the program crashed, kind of like a software autopsy.

By default on Mac OS X, core files are not created when your program crashes. Core files take a long time to write on OS X, and, on machines with less-than-stellar disk throughput, it can hose your machine for a fair number of seconds while the core file is being written. So you will not get core files unless you ask for them.

Example 8.2 is a program that can generate errors that can drop core files: ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.