Getting debugging symbols - not for a crash - for plasmashell on KDE Linux?

Hi - I’m sure I’m doing something wrong for at least one step of this process, but…I’m trying to figure out what’s causing this bug.

I was thinking that I could maybe figure it out if I could see what variable values were getting calculated during the process of launching a new application, so I thought I’d build plasma-desktop and plasma-workspace locally, then debug plasmashell and try to set a breakpoint for the file or functions that were changed in the relevant commit.

What I did:

$ kde-builder plasma-desktop plasma-workspace
$ run0 systemd-sysext refresh --always-refresh=yes
$ systemctl restart --user plasma-plasmashell.service
$ run0 gdb -p $(pidof plasmashell)

However, I didn’t seem to have debug symbols available - function names were ??, and info locals returned “No symbol table info available.”

Has anyone tried doing something like this and can share any tips - am I even going about it the right way to try to investigate that bug, and if I am, am I missing or following incorrect steps to get there?

Any ideas would be much appreciated…thanks!

Your workflow matches the official KDE Linux doc “Develop KDE Software That’s Shipped on the OS Image” (in the docs section of the KDE Linux site) - kde-builder, sysext refresh, service restart is exactly the documented flow. Symbols should actually be present in that build: when a KDE project is built from a git checkout without an explicit CMAKE_BUILD_TYPE, ECM’s KDECompilerSettings.cmake (extra-cmake-modules repo, kde-modules, around line 251-258) defaults the build type to Debug, which includes full debug info. So my guess - a hypothesis, not verified - is that the plasmashell process you attached to was still running the stripped base-image binary instead of your sysext build. You can check with ls -l /proc/$(pidof plasmashell)/exe and systemd-sysext status; the doc itself recommends a reboot when a replaced component misbehaves after the refresh. If symbols are still missing, explicitly set cmake-options: -DCMAKE_BUILD_TYPE=Debug (or RelWithDebInfo for better speed) and rebuild.

If you have any personal insights, I’d love to hear it - unfortunately, your LLM’s response isn’t very helpful here.

You shouldn’t need run0 for this.

Also, did you build plasmashell as "release with debug info?

Your ~/.config/kde-builder.yaml file should have this in it:

  cmake-options: >
    -DCMAKE_BUILD_TYPE=RelWithDebInfo
    [...]

I might have been guilty of the “if it didn’t work, just try adding sudo” approach here…when I tried without run0, I had gotten:

[johnkizer@g717-kde:~] $ gdb -p $(pidof plasmashell)     
GNU gdb (GDB) 18.1
...intro text cut out...
Attaching to process 1924
❌ warning: the /proc/sys/kernel/yama/ptrace_scope setting of 1 might prevent attaching, see 'man 2 ptrace'
ptrace: Operation not permitted.
(gdb) info locals
❌ No frame selected.
(gdb) info files
(gdb) 

I tried poking around web search results some more and eventually figured out what would get it to start and run debuginfod without run0, but that ended up crashing/abruptly terminating:

[johnkizer@g717-kde:~] [1] $ run0 zsh -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"

[johnkizer@g717-kde:~] $ gdb -p $(pidof plasmashell)                    
GNU gdb (GDB) 18.1
Copyright (C) 2026 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Find the GDB manual online at:                                               ┃
┃ http://www.gnu.org/software/gdb/documentation/.                              ┃
┃ For help, type "help".                                                       ┃
┃ Type "apropos word" to search for commands related to "word".                ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Attaching to process 1924
[New LWP 72615 (id 2)]
[New LWP 72614 (id 3)]
[New LWP 72613 (id 4)]
[New LWP 37297 (id 5)]
[New LWP 37296 (id 6)]
[New LWP 2465 (id 7)]
[New LWP 2464 (id 8)]
[New LWP 2459 (id 9)]
--Type <RET> for more, q to quit, c to continue without paging--
[New LWP 2364 (id 10)]
[New LWP 2269 (id 11)]
[New LWP 2263 (id 12)]
[New LWP 2203 (id 13)]
[New LWP 2193 (id 14)]
[New LWP 2083 (id 15)]
[New LWP 2033 (id 16)]
[New LWP 2032 (id 17)]
[New LWP 1933 (id 18)]

This GDB supports auto-downloading debuginfo from the following URLs:
  <http://debuginfod.kdeos.haraldsitter.eu>
  <https://debuginfod.archlinux.org>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading 20.27 K separate debug info for /usr/lib/libpthread.so.0
Downloading 5.82 M separate debug info for /usr/lib/libKF6DBusAddons.so.6                                     
...
a whole bunch of these
...                                       
Downloading 3.57 M separate debug info for /usr/lib/libdav1d.so.7                                             
Downloading 43.28 M separate debug info for /usr/lib/librav1e.so.0.8                                          
/usr/include/c++/16/string_view:291: constexpr const std::basic_string_view<_CharT, _Traits>::value_type& std::basic_string_view<_CharT, _Traits>::back() const [with _CharT = char; _Traits = std::char_traits<char>; const_reference = const char&]: Assertion 'this->_M_len > 0' failed.


Fatal signal: Aborted
----- Backtrace -----
0x561d6ee9e481 ???
0x561d6f0321ed ???
0x7f17651d06ef ???
0x7f176522c11c ???
0x7f17651d05cf gsignal
0x7f17651b7684 abort
0x7f17655b65bc _ZSt21__glibcxx_assert_failPKciS0_S0_
0x561d6ece5f73 ???
0x561d6ed0057d ???
0x561d6ef82638 ???
0x561d6ef8172a ???
0x561d6ef814b5 ???
0x7f176522f79b ???
0x7f176522f818 pthread_once
0x561d6f9dfe6e ???
0x7f1765603858 ???
0x7f176522a041 ???
0x7f17652b272b ???
0xffffffffffffffff ???
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible.  GDB will now terminate.

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

zsh: abort (core dumped)  gdb -p $(pidof plasmashell)

And yep, I didn’t change anything after setting up kde-builder, so that section of my ~/.config/kde-builder.yaml file looks like:

  cmake-options: >
    -DCMAKE_BUILD_TYPE=RelWithDebInfo
    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
    -DBUILD_HTML_DOCS=OFF
    -DBUILD_MAN_DOCS=OFF
    -DBUILD_TESTING=OFF
    -DBUILD_PYTHON_BINDINGS=OFF
    -DWITH_PYTHON_VENDORING=OFF
    -DBUILD_QCH=OFF
    -DCMAKE_INSTALL_LIBEXECDIR=lib
    -DCMAKE_C_COMPILER_LAUNCHER=ccache
    -DCMAKE_C_LINKER_LAUNCHER=ccache
    -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
    -DCMAKE_CXX_LINKER_LAUNCHER=ccache

If all of that is just a gdb thing to figure out, I can head down that path, I just wasn’t sure if there was a different established way (Qt Creator?) that folks had for investigating a bug like that, and for doing so in KDE Linux (maybe something that I can then add to the debugging Plasma wiki page).

Thanks!

Right, I forgot that attaching requires elevated privileges in KDE Linux due to kernel hardening!

It would be easier to spawn a new process, which doesn’t require that:

systemctl stop plasma-plasmashell.service
gdb plasmashell
run
[reproduce issue]
^c
bt

That should get you a backtrace.

When you’re done, exit GDB with q and then restart plasmashell with:

systemctl startplasma-plasmashell.service

Hopefully that works better!

Thanks! That did work for a while, though for whatever reason after a few moments of checking the source to see which file I needed to set a breakpoint on (to try to grab the variable values), gdb crashed again with the same assert message (and then immediately did so again when trying to restart plasmashell through gdb)

This… is probably a sign that I’m in over my head :laughing:

That’s interesting… I just tried it and got the same thing. Maybe there really is a bug in gdb itself that we’re all hitting!

Interesting - I’m guessing you’re also running KDE Linux? I just repeated those steps when booted into Fedora 44, and it didn’t crash even after running through the process several times, and then being left alone for a couple of hours - maybe something specific to the software versions in the Arch base system for KDE Linux, or in how they interact withkde-builder-built software somehow?

Yeah, I’m on KDE Linux, too. It actually wouldn’t be the first time we got a new new version of gdb from Arch that crashes.