v1.6.0 — macOS Support
CrashCatch now supports macOS (Intel & Apple Silicon), joining Windows and Linux as a fully supported platform.
Added
- macOS crash handling via POSIX signals (
SIGSEGV,SIGABRT,SIGFPE,SIGILL,SIGBUS), sharing the samefork()-based async-signal-safe architecture as Linux (posixSignalHandler, unified across both platforms). - Symbol demangling on macOS — a dedicated backwards-parsing
demangle()implementation that correctly handles module names containing spaces (e.g."Google Chrome Helper"), unlike a naive forward tokenizer. - File/line numbers in macOS stack traces via
atos(Xcode Command Line Tools). Batch-resolves all frames in a single call for efficiency. Requires debug symbols — gracefully falls back tomodule+symbol+offseton stripped/Release builds without them. - Portable Debug/Release detection —
Config::buildConfignow derives from the standardNDEBUGmacro instead of the MSVC-specific_DEBUG, so it correctly reflects build type across MSVC, Clang, and GCC (Windows, Linux, and macOS alike).
Fixed
getExecutablePath()on macOS now correctly handles executable paths longer thanPATH_MAXby querying_NSGetExecutablePathfor the required buffer size first, instead of silently truncating/returning garbage.
Known Limitations
- Mach exception interception is not implemented. Only POSIX signal-based crashes are caught on macOS; research into low-level XNU exception handling is ongoing for a future release.
- Message boxes are not supported on macOS. Implementing this would require an Objective-C source file (for
NSAlert) or shelling out toosascript, both of which conflict with the project's single-header goal. No current plan to add this. - Integer divide-by-zero (
SIGFPE) does not trigger on Apple Silicon (ARM64). This is a hardware/architecture limitation, not a CrashCatch bug. ARM64 doesn't trap on integer division by zero, while x86_64 does (verified working correctly on Intel/emulated x86_64 during testing). - File/line resolution requires Xcode Command Line Tools (
atos) and debug symbols to be present; unavailable on stripped Release binaries.
Testing
Verified on macOS Sequoia (x86_64) covering SIGSEGV, SIGFPE, custom Config fields, and file/line resolution against both Debug and Release builds.
Thanks to @0xsmft for the initial macOS implementation and ongoing Mach exception research.