Debugging

One of the big missing features of Arch Linux are packages with debug symbols in a separate repository that could be offered for installation after a crash so that the next crash could be analyzed, read bug report https://bugs.archlinux.org/task/38755.

Especially for KDE it is helpful to enable debugging symbols and information. Example output of a backtrace that is lacking helpful information:

Thread 1 "kwin_wayland" received signal SIGSEGV, Segmentation fault.
0x00007f7d56510bbc in ?? () from /usr/lib/libwayland-server.so.0
(gdb) bt
#0 0x00007f7d56510bbc in () at /usr/lib/libwayland-server.so.0
#1 0x00007f7d56515619 in () at /usr/lib/libwayland-server.so.0
#2 0x00007f7d56510cff in wl_client_destroy () at /usr/lib/libwayland-server.so.0
#3 0x00007f7d56510db9 in () at /usr/lib/libwayland-server.so.0
#4 0x00007f7d565129b2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#5 0x00007f7d5f17b2bf in KWayland::Server::Display::Private::dispatch() () at /usr/lib/libKF5WaylandServer.so.5
#6 0x00007f7d5f99c9e1 in () at /usr/lib/libkwin.so.5
#7 0x00007f7d5f9986eb in () at /usr/lib/libkwin.so.5
#8 0x00007f7d5f998904 in () at /usr/lib/libkwin.so.5

The 2 question marks (??) show that you have a package without debug information. To see to which package the mentioned file belongs, run:

pacman -Qo /pathoffile/filename.so

Before compiling anything, you need to activate in Arch Linux the debugging symbols for new compiled packages first in the makepgk file. If the file belongs to Qt, then you can install the Qt5 debug packges via a separate repository without the need for compiling.

Makepkg

Enable debugging symbols for new compiled packages, for more details read https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces. Basically you need to modify in the following file the OPTIONS= line, this will enable debug and disable strip:

nano /etc/makepkg.conf
...
#OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)
OPTIONS=(!strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx debug)
...

Now you can go ahead and compile the required package with debug symbols.

Compile Arch Linux Package with Debug Symbols

 

  1. Download e.g. from the Arch Linux package website or repository the PKGBUILD file.
  2. run makepgk
  3. If you need to verfify the key, you can do it via: gpg –recv-keys ???????
  4. run makepgk –install

Mesa-git Debug packages

If you need debug packages, you can use them from mesa-git. Add the repository from mesa-git Mesa-Git and LLVM-svn and then install the required packages, e.g. for mesa it would be mesa-git-debug.

Qt5 Debug packages

The Qt5 debug symbol packages are provided via a separate repository, read https://wiki.archlinux.org/index.php/Unofficial_user_repositories#qt-debug

Add the repository to pacman.conf

[qt-debug]
Server = https://qutebrowser.org/qt-debug/$arch

Add the key via mentioned in the link above via

gpg --recv-keys ???????

Kwin debugging

https://community.kde.org/KWin/Debugging

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.