KSCrash is a production-grade crash reporting and system monitoring library for Apple platforms (iOS, macOS, tvOS, watchOS, visionOS). It captures Mach exceptions, Unix signals, C++ and Objective-C exceptions, main thread hangs, watchdog timeouts, and OS-level terminations (OOM, thermal, CPU, reboot). The library generates Apple-format crash reports with full backtraces, binary images, system state, and user-provided context. It also includes performance monitors for CPU usage, memory pressure, and boot time, as well as a sampling profiler. The architecture is modular: a low-level C core provides async-signal-safe stack unwinding (compact unwind, DWARF CFI, frame pointer), safe memory access, JSON encoding/decoding, and a key-value store. Higher-level Objective-C and Swift modules implement individual crash monitors (Mach, signal, NSException, C++ exception, zombie, watchdog, termination, lifecycle, resource, user info) that register via a plugin API. Reports are stored on disk with mmap'd sidecar files for cross-launch state, then processed through a filter pipeline (demangling, compression, JSON formatting, diagnostic analysis) and delivered via configurable sinks (HTTP, email, console). The library is distributed as Swift packages and CocoaPods pods, with extensive CI covering unit tests, integration tests, benchmarks, static analysis, and API stability checks. Key strengths include rigorous async-signal-safety in crash-time code, a lock-free binary image cache for fast symbolication, a streaming JSON codec with pluggable callbacks, and a sidecar system that persists monitor data across app launches. The codebase demonstrates high craftsmanship in low-level systems programming, concurrency, and Apple platform internals. While primarily a crash reporter, its monitoring and profiling capabilities make it a comprehensive observability tool for Apple applications.
Boost.Stacktrace is a production-grade C++ library for capturing, storing, and printing backtraces (call stacks). It provides a header-only core with optional compiled backends that leverage platform-specific mechanisms: `_Unwind_Backtrace` (POSIX), `backtrace()` (glibc), `libbacktrace`, `addr2line`, or Windows Debug Engine (`dbgeng`). The library offers signal-safe raw dump functions, human-readable frame decoding (function names, source file, line number), and the ability to capture stacktraces at the point an exception is thrown via `from_current_exception()`. The design is modular, with separate compiled libraries for each backend and a no-op backend to disable tracing. The codebase is well-structured, heavily tested across compilers and platforms, and actively maintained. It demonstrates deep knowledge of C++ runtime internals, particularly in the exception interception implementation that hooks into `__cxa_allocate_exception` or uses vectored exception handlers on Windows. While the library itself is the reusable asset, several internal utilities (e.g., address base computation from `/proc/self/maps`, `dladdr` abstraction) embody patterns useful in other debugging and profiling tools.
This repository is the GNUstep Objective-C runtime library (libobjc2), a drop-in replacement for the GCC Objective-C runtime that implements the modern Objective-C runtime API for non-Apple platforms. It provides the core runtime services: message dispatch (via architecture-specific assembly fast paths and a C fallback), memory management (ARC retain/release, autorelease pools, weak references), block support, property access, exception handling (with C++ interop), and type-dependent dispatch. The architecture is a shared library with a modular design: loader.c handles module loading, selector_table.cc manages selector uniquing, class_table.c manages class loading and +load, sendmsg2.c implements message lookup, and arc.mm implements the ARC contract. It supports three ABIs (GCC legacy, GNUstep v1 non-fragile, GNUstep v2 modern) and runs on Linux, Windows, FreeBSD, Android, and WebAssembly. The codebase is well-structured with several reusable data structures (hopscotch hash tables, sparse arrays, platform-abstracted locks) and demonstrates strong engineering practices in performance-critical paths (cache-line alignment, atomic operations, copy-on-write dispatch tables). However, it carries significant complexity from legacy ABI compatibility and platform-specific ifdefs, and some components (C++ exception interop) rely on fragile runtime structure discovery.
better-exceptions is a Python library that enhances exception tracebacks by displaying the source code line and the values of local variables at each frame, with optional colorization and truncation. It hooks into Python's sys.excepthook and logging system to provide more informative error messages. The library supports automatic activation via a .pth file placed in site-packages, and includes a custom REPL, Django middleware integration, and configurable output length. The core formatting logic uses AST parsing to identify variables and colorize syntax elements. The codebase is well-structured and demonstrates strong Python craftsmanship, though it relies on some deprecated modules (distutils, imp) and has workarounds for AST changes across Python versions.
LaraBug is a Laravel SDK/package that provides error monitoring and reporting functionality for Laravel applications. It captures unhandled exceptions, monitors queued job failures, tracks JavaScript errors via a blade view and API endpoint, and scans composer.lock files for known CVEs. The architecture follows Laravel package conventions with a service provider registering bindings, a facade for easy access, and specialized components for exception handling, queue monitoring, HTTP communication, and CVE scanning. Key features include automatic exception reporting through Laravel's error handler, intelligent batching of queue events based on load, dynamic CVE scanning triggers, and configurable data filtering to protect sensitive information. The package integrates seamlessly with Laravel 6 through 13 and supports PHP 7.4+.