> For the complete documentation index, see [llms.txt](https://docs.elementary.io/contributor-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elementary.io/contributor-guide/feedback/reporting-issues/inspecting-crashes.md).

# Inspecting Crashes

The [GNU Project Debugger (gdb)](https://www.gnu.org/software/gdb/) is a general purpose debugger, but we're mostly going to focus on getting useful information when an application crashes. To get started, open an application in gdb, for example AppCenter by running:

```bash
gdb io.elementary.appcenter
```

1. Now run this application by typing `run` and pressing enter.
2. If the application doesn't crash right away try reproducing the crash.
3. Get more information by typing `backtrace` and pressing enter.
4. Please share the lines after `(gdb) backtrace`, those should provide useful information.

For more information see the manpages by running: `man gdb`. Another tutorial: [Debugging with GDB](https://betterexplained.com/articles/debugging-with-gdb/)

## Investigating Spontaneous Crashes

Running the application under gdb slows down the application and is problematic to reproduce some crashes. In such cases, it is recommended to use the systemd-coredump service which will gather application information on crash.

Let's take our example above of AppCenter: if the application would have crashed without understanding what might have happened, the service would retain the backtrace which is then replayable with:

```bash
coredumpctl debug io.elementary.appcenter
```

If there are lines such as `0x00001234deadbeef in ?? ()` it means that we are missing some debugging symbols.

The debugging symbols of elementary OS are hidden by default (as they are taking some space). To be able to discover then, we need to add their corresponding debian source:

```bash
UPSTREAM_RELEASE=$(LSB_OS_RELEASE=/usr/lib/upstream-os-release lsb_release -cs)
echo "deb http://ddebs.ubuntu.com ${UPSTREAM_RELEASE} main restricted universe multiverse
deb http://ddebs.ubuntu.com ${UPSTREAM_RELEASE}-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com ${UPSTREAM_RELEASE}-proposed main restricted universe multiverse" | \
sudo tee -a /etc/apt/sources.list.d/ddebs.list
echo "deb https://ppa.launchpadcontent.net/elementary-os/stable/ubuntu ${UPSTREAM_RELEASE} main/debug
deb https://ppa.launchpadcontent.net/elementary-os/os-patches/ubuntu ${UPSTREAM_RELEASE} main/debug" | \
sudo tee -a /etc/apt/sources.list.d/elementary-ddebs.list
sudo apt install ubuntu-dbgsym-keyring debian-goodies && sudo apt update
```

We can then install all the missing debugging symbols with:

```bash
find-dbgsym-packages --install $(which io.elementary.appcenter)
```

Rerunning `coredumpctl debug` should now show more useful traces.

For a flatpak application, we can use `flatpak-coredumpctl io.elementary.elementary.calculator` to see the latest traces of a crash inside flatpak.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.elementary.io/contributor-guide/feedback/reporting-issues/inspecting-crashes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
