Bug 498175 - Desktop goes black and panels disappear when changing the global theme with "Desktop and window layout selected", until plasmashell is restarted
Summary: Desktop goes black and panels disappear when changing the global theme with "...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Containment (show other bugs)
Version: 6.2.5
Platform: Arch Linux Linux
: VHI major
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 498336 498642 500070 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-01-02 18:03 UTC by Filip
Modified: 2025-02-22 03:47 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.2
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/123901/events/a0cb5d165df74300a90a1bea96f120fd/


Attachments
gdb trace (9.80 KB, text/plain)
2025-01-17 20:52 UTC, cwo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Filip 2025-01-02 18:03:24 UTC
SUMMARY
Plasmashell crashes when changing the global theme with "Desktop and window layout" selected

STEPS TO REPRODUCE
1. Open Global Theme KCM
2. Change the global theme with "Desktop and window layout" option enabled

OBSERVED RESULT
Plasmashell crashes 

EXPECTED RESULT
Plasmashell doesn't crash

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.7-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Journalctl output if it helps, not sure what other logs I can attach 

archlinux plasmashell[810]: kf.plasma.quick: Applet preload policy set to 1

archlinux plasmashell[810]: file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/main.qml:178:25: QML FolderViewDropArea (parent or ancestor of QQuickLayoutAttached): Binding loop detected for property "minimumWidth": file:///usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/main.qml:201:9

archlinux plasmashell[810]: Toolbox not loading, toolbox package is either invalid or disabled.

archlinux plasmashell[810]: kde.plasmashell: Activity added twice "db84a10c-0855-46fd-b92c-3248e8d7f6b7"

archlinux plasmashell[810]: org.kde.plasma.kicker: Entry is not valid "org.kde.kontact.desktop" 0x5e833d7e2da0

archlinux plasmashell[810]: org.kde.plasma.kicker: Entry is not valid "org.kde.kontact.desktop" 0x5e833d7e2da0

archlinux plasmashell[810]: file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/main.qml:50:9: QML KSortFilterProxyModel: Binding loop detected for property "sourceModel"

archlinux plasmashell[810]: file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/main.qml:50:9: QML KSortFilterProxyModel: Binding loop detected for property "sourceModel"

archlinux plasmashell[810]: qt.dbus.integration: Could not connect "org.cups.cupsd.Notifier" to PrinterFinishingsChanged(QString, QString, QString, uint, QString, bool) :

archlinux plasmashell[810]: QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0

archlinux plasmashell[810]: error getting max keyboard brightness via dbus QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/org/kde/Solid/PowerManagement/Actions/KeyboardBrightnessControl'")
Comment 1 Antonio Rojas 2025-01-02 18:16:25 UTC
As mentioned in the report template, crash reports require a backtrace
Comment 2 Filip 2025-01-02 20:10:13 UTC
I know, but I just can't get a backtrace. We can keep it as needsinfo and if no one can repro, let it close itself.
Comment 3 Filip 2025-01-07 10:04:07 UTC
*** Bug 498336 has been marked as a duplicate of this bug. ***
Comment 4 Filip 2025-01-14 07:34:29 UTC
*** Bug 498642 has been marked as a duplicate of this bug. ***
Comment 5 duha.bugs 2025-01-15 00:24:31 UTC
Can reproduce on git master. 
Operating System: Arch Linux 
KDE Plasma Version: 6.2.80
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.1
Kernel Version: 6.12.9-arch1-1 (64-bit)
Graphics Platform: X11


Since there are multiple people affected I am setting this as confirmed.

It seems the reason that there is no backtrace is that plasmashell does not crash, it just freezes. I think thats also why plasmashell --replace does not work  until the old plasmashell gets (manually) killed.

This seems to only affect Arch users, I was unable to reproduce with Opensuse.
Comment 6 TraceyC 2025-01-15 01:59:56 UTC
I'm also able to reproduce on Solus git-master

After clicking Apply, the kcm is still up
The plasmashell process is still running
There is a black background with no ui elements, no panels 

systemctl restart --user plasma-plasmashell.service restored plasmashell to a working state
Comment 7 Nate Graham 2025-01-15 03:53:47 UTC
Is anyone able to encounter this on Wayland too, or does it only happen on  X11?
Comment 8 Filip 2025-01-15 07:24:14 UTC
I encounter this on Wayland and also the two users from the bugs marked as duplicate from this one
Comment 9 cwo 2025-01-17 20:52:16 UTC
Created attachment 177469 [details]
gdb trace

I can reproduce this on master (might be a few days old at this point).

No crash report, as it hangs instead of crashing. I ran plasmashell in gdb, interrupted it for a trace, let it run for a but and repeated this. Both seem to be at the same place. The two traces are in the attachment.

----

#1  0x00005555555bf12b in ShellCorona::unload (this=0x555555bdedb0)
    at /home/wolki/kde/src/plasma-workspace/shell/shellcorona.cpp:972
#2  0x00005555555c6be8 in ShellCorona::unload (this=0x555555bdedb0)
    at /home/wolki/kde/src/plasma-workspace/shell/shellcorona.cpp:703
#3  ShellCorona::loadLookAndFeelDefaultLayout (this=0x555555bdedb0, packageName=<optimized out>)
    at /home/wolki/kde/src/plasma-workspace/shell/shellcorona.cpp:699
#4  0x0000555555625063 in PlasmaShellAdaptor::loadLookAndFeelDefaultLayout
    (layout=<optimized out>, this=0x555555ec8410)
    at /home/wolki/kde/build/plasma-workspace/shell/plasmashelladaptor.cpp:75
#5  0x0000555555625617 in PlasmaShellAdaptor::qt_metacall
    (this=0x555555ec8410, _c=<optimized out>, _id=6, _a=0x7fffffffcad8)
    at /home/wolki/kde/build/plasma-workspace/shell/moc_plasmashelladaptor.cpp:289
#6  0x00007ffff519a49c in QDBusConnectionPrivate::deliverCall
    (this=this@entry=0x7fffe80016a0, object=object@entry=0x555555ec8410, msg=..., metaTypes=..., slotIdx=10)
    at /usr/src/qt6-base-6.8.1-0zneon+24.04+noble+release+build38/src/dbus/qdbusintegrator.cpp:1008
#7  0x00007ffff519b203 in QDBusConnectionPrivate::activateCall
    (this=this@entry=0x7fffe80016a0, object=0x555555ec8410, flags=flags@entry=..., msg=...)
    at /usr/src/qt6-base-6.8.1-0zneon+24.04+noble+release+build38/src/dbus/qdbusintegrator.cpp:910
#8  0x00007ffff519dd6b in QDBusConnectionPrivate::activateObject
    (this=<optimized out>, node=..., msg=..., pathStartPos=<optimized out>)
    at /usr/src/qt6-base-6.8.1-0zneon+24.04+noble+release+build38/src/dbus/qdbusintegrator.cpp:1485
#9  0x00007ffff519e6ea in QDBusActivateObjectEvent::placeMetaCall (this=0x7fffe8056390)
    at /usr/src/qt6-base-6.8.1-0zneon+24.04+noble+release+build38/src/dbus/qdbusintegrator.cpp:1605
Comment 10 Marco Martin 2025-01-21 14:11:11 UTC
the crashing lines are:

while (!containments().isEmpty()) {
        containments().constFirst()->destroy();
    }

while trying to dereference containments().constFirst() so would imply that containments() contains an already deleted one, but doesn't make much sense as destroy() will cause removal form containments() immediately

it might be rewritten to making a copy of the containments() list if that might be a tad safer()
Comment 11 Nate Graham 2025-01-21 19:32:13 UTC
That seems like a safer plan, yeah.
Comment 12 JLV 2025-02-10 16:42:43 UTC
This happens to me also. CachyOS with KDE plasma.
Comment 13 Frank 2025-02-10 22:41:11 UTC
Hello,
I also experience this issue on all my machines (metals+VMs) every time I apply a Global Theme.

Using Garuda Linux on Arch
Wayland
Plasma 6.2.5
QT 6.8.2-2
Frameworks 6.10.0-1
Kernel 6.13.2

Many of our users also report that same issue.

So far the workaround was CTRL-ALT-DEL followed by either LOGOUT or REBOOT and wait a while for Plasma to execute the task, but I appreciate the systemctl command as another workaround.

Thank you
Comment 14 Elite 2025-02-12 15:54:46 UTC
The bug is also in 6.4 dev.  Wayland on a amd 7900. With KDEOS
Comment 15 cwo 2025-02-16 19:23:34 UTC
*** Bug 500070 has been marked as a duplicate of this bug. ***
Comment 16 John Faulk 2025-02-17 18:00:26 UTC
Also reproducible on Debian Trixie, plasma 6.2.5 
Kernel 6.12
Amd64
Comment 17 David Edmundson 2025-02-18 13:43:24 UTC
>while trying to dereference containments().constFirst() so would imply that containments() contains an already deleted one, but doesn't make much sense as destroy() will cause removal form containments() immediately

That's not it, we query containment() each time.

The bug is that SystemTray doesn't react to destroy()
13:42:27.443 ShellCorona::unload QList(SystemTray(0x5863e3324da0))
Comment 18 David Edmundson 2025-02-18 13:57:58 UTC
SystemTray hits this early return, with the fairly unhelpful commit


void Applet::destroy()
{
    if (immutability() != Types::Mutable || d->transient || !d->started) {
        return; // don't double delete
    }
Comment 19 Bug Janitor Service 2025-02-18 16:01:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libplasma/-/merge_requests/1266
Comment 20 Bug Janitor Service 2025-02-18 16:04:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5221
Comment 21 Marco Martin 2025-02-19 09:29:13 UTC
Git commit 63dd1d3e92c981f8e77ce5824d7dd57dc8daf3ed by Marco Martin.
Committed on 19/02/2025 at 09:29.
Pushed by mart into branch 'master'.

applets/systray: guard pointer to innerContainment

The inner systray could be deleted at any time by something external,
for instance ShellCorona::unload()
It was already a QPointer, check it

M  +5    -2    applets/systemtray/container/systemtraycontainer.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/63dd1d3e92c981f8e77ce5824d7dd57dc8daf3ed
Comment 22 Bug Janitor Service 2025-02-19 09:42:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5228
Comment 23 Marco Martin 2025-02-19 10:04:08 UTC
Git commit ee3956d901965600a1a27041d6d0a2c5fc71226c by Marco Martin.
Committed on 19/02/2025 at 10:04.
Pushed by mart into branch 'Plasma/6.3'.

applets/systray: guard pointer to innerContainment

The inner systray could be deleted at any time by something external,
for instance ShellCorona::unload()
It was already a QPointer, check it

M  +5    -2    applets/systemtray/container/systemtraycontainer.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/ee3956d901965600a1a27041d6d0a2c5fc71226c
Comment 24 Bug Janitor Service 2025-02-19 14:23:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5232
Comment 25 Marco Martin 2025-02-19 14:34:21 UTC
Git commit 25002145fb792215bf3435ebcdb4087fe0a95fe4 by Marco Martin.
Committed on 19/02/2025 at 14:34.
Pushed by mart into branch 'master'.

Applet: possibility to cleanup transient applets

Even if an applet is marked as transient (for instance if somebody
called setDestroyed, or if its parent is already transient. like
in the bug report) it should be possible to destroy it as well, so
if the corona is mutable, call cleanupoanddelete anyways (applet and
containment immutability will always be systemimmutable when they are
transient)
Related: bug 404641

M  +12   -2    src/plasma/applet.cpp
M  +5    -0    src/plasma/private/applet_p.cpp

https://invent.kde.org/plasma/libplasma/-/commit/25002145fb792215bf3435ebcdb4087fe0a95fe4
Comment 26 Marco Martin 2025-02-19 14:52:30 UTC
Git commit ea93eef86011d2a0c0123b42657adc149a79ca4c by Marco Martin.
Committed on 19/02/2025 at 14:49.
Pushed by mart into branch 'Plasma/6.3'.

Applet: possibility to cleanup transient applets

Even if an applet is marked as transient (for instance if somebody
called setDestroyed, or if its parent is already transient. like
in the bug report) it should be possible to destroy it as well, so
if the corona is mutable, call cleanupoanddelete anyways (applet and
containment immutability will always be systemimmutable when they are
transient)
Related: bug 404641


(cherry picked from commit 25002145fb792215bf3435ebcdb4087fe0a95fe4)

4cc0bd7f Applet: possibility to cleanup transient applets
f551664f don't double emit on setDestroyed
42fe21d2 revise the logic a bit

Co-authored-by: Marco Martin <notmart@gmail.com>

M  +12   -2    src/plasma/applet.cpp
M  +5    -0    src/plasma/private/applet_p.cpp

https://invent.kde.org/plasma/libplasma/-/commit/ea93eef86011d2a0c0123b42657adc149a79ca4c
Comment 27 Marco Martin 2025-02-20 13:31:00 UTC
Git commit 96be099af0d70e7804eeafc1d9f7ceac78f5436a by Marco Martin.
Committed on 20/02/2025 at 13:30.
Pushed by mart into branch 'master'.

shellcorona: delete containments in a for loop

as there is always the possibility destroy is a no-op, iterate
over containments with a for loop rather than a while

M  +10   -2    shell/shellcorona.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/96be099af0d70e7804eeafc1d9f7ceac78f5436a
Comment 28 Bug Janitor Service 2025-02-20 15:19:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5236
Comment 29 Marco Martin 2025-02-20 15:58:07 UTC
Git commit 15c1392b6acee19e58c686b5d7eb70cfae208c00 by Marco Martin.
Committed on 20/02/2025 at 15:19.
Pushed by mart into branch 'Plasma/6.2'.

shellcorona: delete containments in a for loop

as there is always the possibility destroy is a no-op, iterate
over containments with a for loop rather than a while


(cherry picked from commit 96be099af0d70e7804eeafc1d9f7ceac78f5436a)

d1f2a903 shellcorona: delete containments in a for loop
15fc74c7 fix build errors
356bdf37 Apply 1 suggestion(s) to 1 file(s)

Co-authored-by: Marco Martin <notmart@gmail.com>

M  +10   -2    shell/shellcorona.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/15c1392b6acee19e58c686b5d7eb70cfae208c00