Bug 525207 - Crash in wallpaper() D-Bus API: cannot add a null QDBusVariant
Summary: Crash in wallpaper() D-Bus API: cannot add a null QDBusVariant
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.7.4
Platform: Arch Linux Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-09-04 11:47 UTC by Alperen
Modified: 2026-09-10 21:54 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.8.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alperen 2026-09-04 11:47:20 UTC
SUMMARY
Querying org.kde.PlasmaShell.wallpaper() via D-Bus while the wallpaper settings dialog is open and switching wallpaper plugins crashes plasmashell with SIGABRT.

STEPS TO REPRODUCE
1. Run a script or tool that queries wallpaper over D-Bus (e.g. qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.wallpaper 0)
2. Open Desktop and Wallpaper settings
3. Change wallpaper plugin (e.g. Picture of the Day to Image)

OBSERVED RESULT
plasmashell aborts immediately (SIGABRT).

From journalctl:
plasmashell[PID]: QDBusMarshaller: cannot add a null QDBusVariant
plasmashell[PID]: process PID: arguments to dbus_message_iter_close_container() were incorrect
systemd[1174]: plasma-plasmashell.service: Main process exited, code=killed, status=6/ABRT

From coredumpctl gdb:
#0  __pthread_kill_implementation (threadid=..., signo=6) at pthread_kill.c:44
#1  raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:27
#2  abort () at abort.c:81
#3  qt_message_fatal (...) at global/qlogging.cpp
#4  QDBusMarshaller::appendVariant (customVariant=...) at /usr/src/debug/qt6-base/src/dbus/qdbusmarshaller.cpp:580
#5  QDBusMarshaller::addBasicType (...)
#6  dbus_message_iter_close_container (...) at libdbus-1.so.3

EXPECTED RESULT
D-Bus method returns the available properties or an empty map without crashing.

ADDITIONAL INFORMATION
In plasma-workspace/shell/shellcorona.cpp (ShellCorona::wallpaper):
- config is not null-checked before accessing keys.
- config->value(itemName) can return an invalid QVariant during plugin transitions.
Passing an invalid QVariant to QVariantMap causes QDBusMarshaller to fail when serializing, which triggers the libdbus assertion abort.
Comment 1 Bug Janitor Service 2026-09-04 12:01:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/7014
Comment 2 Alperen 2026-09-08 13:26:33 UTC
Git commit 235eb7dc4bf762849e4fbc684804ef734dbf4195 by Alperen Yildiz.
Committed on 08/09/2026 at 12:57.
Pushed by davidedmundson into branch 'master'.

shell: Avoid invalid QVariants in wallpaper() D-Bus

When the wallpaper configuration dialog is transitioning or plugins are changing,
config->value(itemName) can return an invalid QVariant. Passing an invalid QVariant
into a QVariantMap over D-Bus causes QDBusMarshaller to fail with:
"QDBusMarshaller: cannot add a null QDBusVariant", which leads to a libdbus
assertion failure in dbus_message_iter_close_container() and aborts plasmashell (SIGABRT).

Add a null check for config and ensure only valid, non-null QVariants are inserted
into the parameters map.
FIXED-IN: 6.4.0

M  +9    -2    shell/shellcorona.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/235eb7dc4bf762849e4fbc684804ef734dbf4195