Bug 436435 - KRunner silently crashes when search results should be displayed
Summary: KRunner silently crashes when search results should be displayed
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Kyle Devir
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-01 05:23 UTC by Kyle Devir
Modified: 2021-05-01 12:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KRunner via KSysGuard (242.01 KB, image/png)
2021-05-01 05:54 UTC, Kyle Devir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Devir 2021-05-01 05:23:10 UTC
SUMMARY

Journalctl output: https://invent.kde.org/-/snippets/1622

Dr Konqi doesn't trigger, nor does there seem to be any coredumps, so this was the best I could get...

If I can get advice on how to get more info, that would handy.


STEPS TO REPRODUCE
1. Install / update KRunner via kdesrc-build
2. Start KRunner
3. Type stuff until you would normally get search results
4. Get silent crash


OBSERVED RESULT

Silent crashing


EXPECTED RESULT

Showing search results


SOFTWARE/OS VERSIONS

Operating System: Arch Linux
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.11.12-arch1-1-custom (64-bit)
Graphics Platform: Wayland
Processors: 6 × AMD Ryzen 5 2600X Six-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: Radeon RX 580 Series
Comment 1 Alexander Lohnau 2021-05-01 05:26:22 UTC
Do you have Krunner and milou build from master?
Comment 2 Kyle Devir 2021-05-01 05:28:31 UTC
Actually, it seems KRunner works just fine via `gdb /run/media/valmar/DataSSD/kde/usr-2021-04-30-17-35/bin/krunner`...
Comment 3 Kyle Devir 2021-05-01 05:31:20 UTC
The real issue seems to be despite all of my paths being properly set (I think), /usr/bin/krunner is being called for some odd reason... :|
Comment 4 Alexander Lohnau 2021-05-01 05:32:50 UTC
Have you applied the "prefix.sh" file?
Comment 5 Kyle Devir 2021-05-01 05:33:22 UTC
I run my kdesrc-build setup via

```
function run-startplasma-wayland-git() {
    export XDG_SESSION_TYPE=wayland
    export GDK_BACKEND=wayland
    export SDL_VIDEODRIVER=wayland
    export QT_LOGGING_RULES="kwin_*.debug=true;kwin_libinput.debug=false"

    mkdir -p ~/.local/share/kwin
    mv $HOME/.local/share/kwin/session.wayland.log $HOME/.local/share/kwin/session.wayland.log-`date +"%Y%m%d%H%M"`

    bash /run/media/valmar/DataSSD/kde/kde-env-master-wayland.sh &> ~/.local/share/kwin/session.wayland.log 2>&1
}
alias startplasma-wayland-git=run-startplasma-wayland-git
```

Which calls this script:

```
#!/bin/sh

KDE_usr_prefix="/run/media/valmar/DataSSD/kde/usr"

export CMAKE_PREFIX_PATH="$KDE_usr_prefix:$CMAKE_PREFIX_PATH"
export PATH="$KDE_usr_prefix/bin:$PATH"
export PKG_CONFIG_PATH="$KDE_usr_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
export PYTHONPATH="$KDE_usr_prefix/lib/site-packages:$PYTHONPATH"
export QML2_IMPORT_PATH="$KDE_usr_prefix/lib/qml:$QML2_IMPORT_PATH"
export QT_PLUGIN_PATH="$KDE_usr_prefix/lib/qt5/plugins:$KDE_usr_prefix/lib/plugins:$QT_PLUGIN_PATH"
export XDG_DATA_DIRS="$KDE_usr_prefix/share:/usr/share:$XDG_DATA_DIRS"
export XDG_CONFIG_DIRS="$KDE_usr_prefix/etc/xdg:/etc/xdg:$XDG_CONFIG_DIRS"
export MANPATH="$KDE_usr_prefix/share/man:$MANPATH"

cd ${KDE_usr_prefix}
${KDE_usr_prefix}/bin/startplasma-wayland
```
Comment 6 Kyle Devir 2021-05-01 05:34:34 UTC
Now, this scripted setup hasn't changed since my prior build, which was from a week or two ago. So something has broken since.

I even tried `kdesrc-build --refresh-build krunner`, to no avail.
Comment 7 Alexander Lohnau 2021-05-01 05:35:42 UTC
Have you build milou from source too?
Comment 8 Kyle Devir 2021-05-01 05:42:39 UTC
Wouldn't that come as part of a `kdesrc-build baloo` build?

Because I'm pretty certain it has been.
Comment 9 Kyle Devir 2021-05-01 05:43:53 UTC
Starting KRunner via `/run/media/valmar/DataSSD/kde/usr-2021-04-30-17-35/bin/krunner` in Konsole makes it work perfectly.

(usr is a symlink to usr-2021-04-30-17-35)
Comment 10 Kyle Devir 2021-05-01 05:45:50 UTC
So, this isn't KRunner's fault, so much as whatever KDE component isn't honouring the exported paths, and is just somehow blindly running `/usr/bin/krunner`...

Sorry for the confusion. :)

Now to go hunt for what actually starts KRunner...
Comment 11 Kyle Devir 2021-05-01 05:54:49 UTC
Created attachment 138050 [details]
KRunner via KSysGuard

......

```
[Unit]
Description=KRunner
PartOf=graphical-session.target

[Service]
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/krunner
Type=dbus
BusName=org.kde.krunner
TimeoutSec=5sec
Slice=background.slice
# Disable restart as we're dbus activated anyway
Restart=no
```

What's actually responsible for setting `@CMAKE_INSTALL_FULL_BINDIR@`?

For basically everything else KDE related, it's resolved correctly, as seen in the attached image.
Comment 12 Kyle Devir 2021-05-01 05:56:44 UTC
Actually, that doesn't seem to be true... a few other KDE processes don't seem to honour the exported paths either... :|
Comment 13 Alexander Lohnau 2021-05-01 06:46:54 UTC
>What's actually responsible for setting `@CMAKE_INSTALL_FULL_BINDIR@`?

That is done by CMake at build time, do you use the systemd startup?

And you do you manually start KRunner or do you just invoke it using the shortcut and type stuff?

Adding
>krunner &

to your script might be a workaround
Comment 14 Kyle Devir 2021-05-01 06:54:45 UTC
Yeah, I use the systemd startup ~ that's the default now, I think?

Yeah, upon checking, it has to be the systemd startup method, going by journalctl collecting krunner's output.

So, somehow, the CMake pathing in plasma-workspace is borked for KRunner... but why makes no sense, as the proper pathing is there for most other plasma-workspace stuff...
Comment 15 Kyle Devir 2021-05-01 06:55:17 UTC
Should I start another bug related to that?
Comment 16 Kyle Devir 2021-05-01 07:08:41 UTC
Hmmmm...

From `/run/media/valmar/DataSSD/kde/usr-2021-04-30-17-35/lib/systemd/user/plasma-plasmashell.service`:

```
[Unit]
Description=KRunner
PartOf=graphical-session.target

[Service]
ExecStart=/run/media/valmar/DataSSD/kde/usr-2021-04-30-17-35/bin/krunner
Type=dbus
BusName=org.kde.krunner
TimeoutSec=5sec
Slice=background.slice
# Disable restart as we're dbus activated anyway
Restart=no
```

So, now this turns into... the incorrect .service file is being started...
Comment 17 Kyle Devir 2021-05-01 07:10:05 UTC
Whoops, from `/run/media/valmar/DataSSD/kde/usr-2021-04-30-17-35/lib/systemd/user/plasma-krunner.service`, I mean.
Comment 18 Kyle Devir 2021-05-01 07:19:58 UTC
Hmmmmm.

Is KRunner integrated into the Application Launcher widget's searching capabilities?

If so, that seems to find kdesrc-build KRunner just fine.
Comment 19 Alexander Lohnau 2021-05-01 12:32:45 UTC
Yes, Krunner powers those search results too.


What does <MYPREFIX>/share/dbus-1/services/org.kde.krunner.service contain?
Comment 20 Kyle Devir 2021-05-01 12:57:38 UTC
```
[D-BUS Service]
Name=org.kde.krunner
Exec=/run/media/valmar/DataSSD/kde/usr-2021-04-30-17-35/bin/krunner
SystemdService=plasma-krunner.service
```