Apport for Developers

From openSUSE


Contents

Developer Mode

The Apport version of openSUSE supports a developer mode that is also generating crash reports for unpackaged applications. This is useful during development or when you want to test your own custom hooks for Apport.

Note that it'll trigger notification about all the crashes occurred on your system. That might lead to a huge amount of reports and therefore eat up your free disk space.

To enabled the developer mode create a $HOME/.apport file with the following contents:

[main]

developer_mode = 1

Custom Apport Hooks

Apport is extendable by python hooks. There exist two different hook variants, application specific hooks and generic hooks that are executed for every crashing application.

You can learn more about how to write hooks in this article about Apport Hooks.

Application Specific Helpers

Furthermore the openSUSE variant of Apport has additional features to execute an application specific helper that is defined by the environment of the crashing application. This is done by setting the environment variable ON_APP_CRASH_INVOKE to the application that should be run when the application crashes.

Rememeber that the script is executed during the Apport backend is run and not during the execution of the applet like the generic and application specific hooks are. The application itself is in a special state at that time, e.g. attaching GDB to the process is at the moment not possible due to ptrace limitations (no read-only attaching possible).

Example

Assume you have this script called invoke.sh.

#!/bin/sh

echo "I was started by ON_APP_CRASH_INVOKE"

env

An application has set ON_APP_CRASH_INVOKE to the scripts location. The crash report looks like this:

Image:Apport_invoke.png

Passed QA check: Fsundermeyer 14:54, 15 June 2009 (UTC)