๐ง Linux Support¶
CrashCatch v1.1.0 introduces out-of-the-box support for Linux, providing robust crash logging for native C++ applications using POSIX signal handling.
๐ฅ Supported Signals¶
CrashCatch currently handles the following common crash-related signals on Linux:
Signal | Description |
---|---|
SIGSEGV |
Segmentation fault |
SIGABRT |
Aborted process (e.g. abort() ) |
SIGFPE |
Floating point exception (e.g. divide by zero) |
Additional signals (e.g. SIGILL
, SIGBUS
) may be supported in future versions.
๐ Output Format¶
When a crash occurs, CrashCatch will:
- Create a folder like
./crash_dumps/
- Save a
.txt
log file including: - Timestamp
- Stack trace (via
backtrace()
) - Application version & build config
- Executable path
- Any additional notes set in config
---¶
๐งพ Example Output¶
Crash Report
============
Signal: Segmentation fault (11)
Timestamp: 2025-04-04_23-07-34
Environment Info:
App Version: unknown
Build Config: Release
Platform: Linux
Executable: /home/keith/crashcatch/build/CrashCatchTest
Stack Trace:
[0]: ./CrashCatchTest(+0x4936) [0x5b96db8be936]
[1]: ./CrashCatchTest(+0x4daf) [0x5b96db8bedaf]
[2]: /lib/x86_64-linux-gnu/libc.so.6(+0x45330) [0x754c6ea45330]
[3]: ./CrashCatchTest(+0x3abd) [0x5b96db8bdabd]
[4]: ./CrashCatchTest(+0x6dcd) [0x5b96db8c0dcd]
[5]: ./CrashCatchTest(+0x6d79) [0x5b96db8c0d79]
[6]: ./CrashCatchTest(+0x6d1a) [0x5b96db8c0d1a]
[7]: ./CrashCatchTest(+0x6cea) [0x5b96db8c0cea]
[8]: ./CrashCatchTest(+0x6cca) [0x5b96db8c0cca]
[9]: /lib/x86_64-linux-gnu/libstdc++.so.6(+0xecdb4) [0x754c6eeecdb4]
[10]: /lib/x86_64-linux-gnu/libc.so.6(+0x9caa4) [0x754c6ea9caa4]
[11]: /lib/x86_64-linux-gnu/libc.so.6(+0x129c3c) [0x754c6eb29c3c]
¶
Crash Report
============
Signal: Segmentation fault (11)
Timestamp: 2025-04-04_23-07-34
Environment Info:
App Version: unknown
Build Config: Release
Platform: Linux
Executable: /home/keith/crashcatch/build/CrashCatchTest
Stack Trace:
[0]: ./CrashCatchTest(+0x4936) [0x5b96db8be936]
[1]: ./CrashCatchTest(+0x4daf) [0x5b96db8bedaf]
[2]: /lib/x86_64-linux-gnu/libc.so.6(+0x45330) [0x754c6ea45330]
[3]: ./CrashCatchTest(+0x3abd) [0x5b96db8bdabd]
[4]: ./CrashCatchTest(+0x6dcd) [0x5b96db8c0dcd]
[5]: ./CrashCatchTest(+0x6d79) [0x5b96db8c0d79]
[6]: ./CrashCatchTest(+0x6d1a) [0x5b96db8c0d1a]
[7]: ./CrashCatchTest(+0x6cea) [0x5b96db8c0cea]
[8]: ./CrashCatchTest(+0x6cca) [0x5b96db8c0cca]
[9]: /lib/x86_64-linux-gnu/libstdc++.so.6(+0xecdb4) [0x754c6eeecdb4]
[10]: /lib/x86_64-linux-gnu/libc.so.6(+0x9caa4) [0x754c6ea9caa4]
[11]: /lib/x86_64-linux-gnu/libc.so.6(+0x129c3c) [0x754c6eb29c3c]
Testing Linux Crashes¶
Null Pointer¶
Divide by zero¶
Threaded Fault¶
```cpp
include ¶
include "CrashCatch.hpp"¶
void crashFunc(){ int p = nullptr; p = 5; } int main() { std::thread t(crashFunc); t.join(); } ```
## CMake Setup
No special setup is required on Linux. Simply include the header and optionalling link with -rdynamic
to improve symbol resolution
cmake
g++ -std=c++17 main.cpp -rdynamic -o crash_app
-rdynamic
allows symbol names to appear in stack traces generated by backtrace_symbol()
## ๐ง Known Limitations
* Crash logs are .txt
only โ no core dump or .dmp
generation yet
- Stack traces may not always show full function names without
-rdynamic
* GUI message boxes are not supported on Linux (yet)¶
๐ฆ Future Improvements¶
-
Signal handler chaining (to avoid interfering with other handlers)
-
Optional generation of Linux core dumps
-
Demangling of C++ function names
-
macOS crash handling support
-
JSON-based crash logs