How canonical/apport works
Project type and purpose
• This is an open-source system utility for Linux called “Apport.” It hooks into the kernel’s coredump handler and various language runtimes to intercept program crashes, collect diagnostic data, and forward reports to bug trackers (Launchpad, GitHub, etc.). It also offers interactive UIs (CLI, GTK, KDE) for manual bug filing. Its plugin architecture allows distribution-specific packaging hooks and backends.
File structure
• Top-level directories:
• apport/ – Core Python library (crash collection, data models, hook registration)
• bin/ – Front-end executables (apport-bug, apport-cli, apport-retrace, etc.)
• gtk/, kde/, java/ – UI front-ends and language-specific hooks
• debhelper/, setuptools_apport/ – Packaging hooks for Debian (debhelper) and setuptools (Python packages)
• etc/ – Default configuration files and report-ignore lists
• problem_report.py – Single-file wrapper for constructing problem reports
• crashdb_impl/ – Modular implementations for storing/querying crash databases (Debian, GitHub, Launchpad, memory)
• packaging_impl/ – Pluggable backends for resolving package metadata (apt/dpkg, rpm)
• pyproject.toml, setup.py – Build and packaging scripts
• tests/ – Unit, integration, and system tests covering all components
• Key patterns:
• Plugin architecture – crashdb_impl and packaging_impl directories implement abstract interfaces defined in crashdb.py and packaging.py.
• Layered CLI/UI separation – core library (apport/*.py) is invoked by multiple front-ends in bin/, gtk/, kde/, java/.
• Service integration – data/systemd and udev define how Apport hooks into the OS at boot or on coredump events.
README for additional insights
• Confirms the core feature set (signal crashes, Python exceptions, UI choices, hook extensibility, backend reporting).
• Mentions documentation in doc/ for data formats and hook conventions.
• Describes deployment via systemd, init scripts, and how to enable/disable apport.