Search code examples
macosdaemonsigabrtcrash-dumps

Can I create a crash dump for my launch daemon on a macOS when it crashes?


I've written a launch daemon for macOS. (It's written in C++.)

The daemon works in most cases, except that once in a while I see that it receives the SIGABRT signal from the own process. (I can see it in a log.)

Because this happens at some random moments, I can't attach a debugger to it.

I'm new to development for macOS. Most of my experience comes from Windows. Thus, I'm wondering if it's possible to generate a crash dump when my daemon receives SIGABRT? And if so, would Xcode allow me to analyze that crash dump file later?

PS. In general how do you guys do it on a macOS?


Solution

  • You don't create it yourself, it will be created by the OS for you. You just need to know where to find it and how to read it. Check this blog post for details.