7 Getting a crash log out of Element Desktop
Richard van der Hoff edited this page 2023-11-06 18:04:52 +00:00

Sometimes, Element Desktop crashes.

Crashes

A crash manifests itself in two ways:

  1. The entire app crashes, causing it to disappear. This means the main Electron process has crashed.
  2. The app's screen goes entirely white. This means the render process of Electron has crashed.

If you instead experience JS errors, spinners that don't go away, or some other breakage - that's not technically a crash, and you should instead report the problem via submitting debug logs (top right menu -> Feedback -> Debug logs). This article is strictly for when you experience a crash of the Electron process.

Getting a crash log

In order for anyone to work on your issue, you'll need to create a crash log. How difficult this is depends on your system.

OS X

Open Console.app (in Applications -> Utilities) and go to Crash Reports. You should be able to see an entry that corresponds to Element crashing. Copy and paste the contents of that report into a comment on the defect issue that you've created.

Linux

It depends on your system. The overall idea is

  1. Configure your system to produce a "core dump" when Element crashes.
  2. Download debug symbols for Electron.
  3. Open the core dump in gdb, run bt, and copy and paste the results.

Obtaining debug symbols

The easiest way to obtain the debug symbols for Electron is to download them from https://github.com/electron/electron/releases. You will need to figure out which version of Electron is in use, which you can do with something like:

strings /opt/Element-Nightly/element-desktop-nightly | awk '/^Chrome\/[0-9.]* Electron\/(.*)/ { print $2 }'

... which should result in something like Electron/27.0.2.

Once you have the Electron version, go to https://github.com/electron/electron/releases/tag/v<version>, and download the file named electron-v<version>-linux-<platform>-debug.zip. Unzip it, and copy the electron.debug file from the debug directory to /opt/Element-Nightly (or /opt/Element if you are using the release version).

You can then open your coredump in gdb with something like:

gdb /opt/Element-Nightly/element-desktop-nightly /path/to/core.dump

Then type bt<enter> to produce a stack trace.

If, when you run gdb, you see:

warning: the debug information found in "/opt/Element-Nightly/electron.debug" does not match "/opt/Element-Nightly/element-desktop-nightly" (CRC mismatch).

... then you probably downloaded the debug symbols for the wrong version of Electron.

Enabling/finding core dumps

Ubuntu

Ubuntu normally writes crash files to /var/crash. To extract the contents, do something like: apport-unpack _opt_Element-Nightly_element-desktop-nightly.1000.crash /tmp/elecrash.

If the debug symbols are present before the crash occurs, the crash report may (?) include things like a Stacktrace. Otherwise you can oepn the core dump with gdb, as above.

See also https://askubuntu.com/questions/966407/where-do-i-find-the-core-dump-in-ubuntu-16-04lts#:~:text=In%20Ubuntu%20the%20core%20dumps,or%20sudo%20service%20apport%20start%20.

Arch

See https://wiki.archlinux.org/title/Core_dump#Examining_a_core_dump

Windows

Windows generates crash dump files which you can send to an Element maintainer for analysis. These files contain an image of what you've been doing in Element, so this only a sensible option if you're not concerned about the privacy of your data.

The crash dump file will be located in %LOCALAPPDATA%\CrashDumps on your system. This article has more details.