CrashCatch (original) (raw)
💥 A modern, single-header crash reporting library for C++ on Windows and Linux.
---¶
🚀 What is CrashCatch?¶
CrashCatch is a modern, single-header crash reporting library for C++ applications — supporting both Windows and Linux.
It automatically captures crashes, logs diagnostic information, generates .dmp (Windows) or .txt (Windows & Linux) reports, and includes stack traces and environment metadata. From minimal CLI tools to full desktop apps, CrashCatch fits right in.
Key highlights: - No external dependencies — just include the header - Full crash context (timestamp, platform, executable path, version, etc.) - Symbol resolution and demangling (platform-specific) - Configurable onCrash() and onCrashUpload() hooks - Optional crash dialog support (Windows GUI apps)
As of v1.2.0, CrashCatch offers complete Linux support with signal handling, demangled stack traces, and crash context generation.
✅ Supported Platforms¶
| OS | Supported | Crash Handling Method |
|---|---|---|
| Windows | ✅ Yes | SetUnhandledExceptionFilter + MiniDump |
| Linux | ✅ Yes | POSIX signals (signal()) + backtrace |
| macOS | 🚧 Planned | POSIX + Mach exceptions |
⚡ Quick Start¶
Zero Config (Auto-init)¶
[](#%5F%5Fcodelineno-0-1)#define CRASHCATCH_AUTO_INIT [](#%5F%5Fcodelineno-0-2)#include "CrashCatch.hpp" [](#%5F%5Fcodelineno-0-3) [](#%5F%5Fcodelineno-0-4)int main() { [](#%5F%5Fcodelineno-0-5) int* ptr = nullptr; [](#%5F%5Fcodelineno-0-6) *ptr = 42; // simulated crash [](#%5F%5Fcodelineno-0-7)}
One-Liner Setup¶
[](#%5F%5Fcodelineno-1-1)#include "CrashCatch.hpp" [](#%5F%5Fcodelineno-1-2) [](#%5F%5Fcodelineno-1-3)int main() { [](#%5F%5Fcodelineno-1-4) CrashCatch::enable(); [](#%5F%5Fcodelineno-1-5) int* ptr = nullptr; [](#%5F%5Fcodelineno-1-6) *ptr = 42; [](#%5F%5Fcodelineno-1-7)}
Full Config Example¶
[](#%5F%5Fcodelineno-2-1)#include "CrashCatch.hpp" [](#%5F%5Fcodelineno-2-2) [](#%5F%5Fcodelineno-2-3)int main() { [](#%5F%5Fcodelineno-2-4) CrashCatch::Config config; [](#%5F%5Fcodelineno-2-5) config.appVersion = "1.1.0"; [](#%5F%5Fcodelineno-2-6) config.buildConfig = "Release"; [](#%5F%5Fcodelineno-2-7) config.additionalNotes = "Test build"; [](#%5F%5Fcodelineno-2-8) config.showCrashDialog = true; [](#%5F%5Fcodelineno-2-9) config.onCrash = [] { [](#%5F%5Fcodelineno-2-10) std::cout << "Cleaning up before crash...\n"; [](#%5F%5Fcodelineno-2-11) }; [](#%5F%5Fcodelineno-2-12) [](#%5F%5Fcodelineno-2-13) CrashCatch::initialize(config); [](#%5F%5Fcodelineno-2-14) [](#%5F%5Fcodelineno-2-15) int* ptr = nullptr; [](#%5F%5Fcodelineno-2-16) *ptr = 42; [](#%5F%5Fcodelineno-2-17)}
📦 Installing with CMake¶
[](#%5F%5Fcodelineno-3-1)mkdir build && cd build [](#%5F%5Fcodelineno-3-2)cmake .. -DCMAKE_INSTALL_PREFIX=./install [](#%5F%5Fcodelineno-3-3)cmake --build . --target install
Then in another project:
[](#%5F%5Fcodelineno-4-1)find_package(CrashCatch REQUIRED) [](#%5F%5Fcodelineno-4-2)target_link_libraries(MyApp PRIVATE CrashCatch::CrashCatch)
🧪 Examples¶
Explore working examples in the GitHub repo: - ZeroConfig - OneLiner - FullConfig - ThreadCrash - DivideByZero
📸 Screenshots¶

🛠Features¶
- ✅ Header-only — single
.hpp, no external dependencies - ✅ Cross-platform — Windows & Linux support out of the box
- ✅ Automatic Crash Capture — via
SetUnhandledExceptionFilter(Windows) or POSIX signals (Linux) - ✅ Crash Context Info — includes executable path, build config, version, and notes
- ✅ Crash Reporting:
.dmp(Windows) or.txt(Linux/Windows) crash files- Detailed stack traces and environment info
- ✅ Symbol Resolution:
- Top frame symbols (Windows)
- Demangled symbols (Linux)
- ✅ onCrash Callback — run custom cleanup or logging logic with full crash context
- ✅ Optional Crash Dialog — user-friendly message box (Windows only)
- ✅ Configurable Dump Location, filename prefix, and timestamping
- ✅ onCrashUpload Hook — pass report data to your custom uploader
- ✅ CMake + CI Friendly — drop-in installation and build support
📄 License¶
MIT License — created and maintained by Keith Pottratz
GitHub Repo
Created by Keith Pottratz
MIT Licensed