Skip to content

馃崚Desktop: check containment availability first before `usedInAccentColor`

Fushan Wen requested to merge work/cherry-pick-1c22c2dd into Plasma/6.0

There is a race when the application is closing down, the containment is destroyed before DesktopView receives containmentChanged, which triggers a binding update, but usedInAccentColor will access the dangling containment, which will cause a crash.

Possible backtrace:

Stack trace of thread 25161:
                #0  0x00007f5ba42949ec __pthread_kill_implementation (libc.so.6 + 0x949ec)
                #1  0x00007f5ba4241176 raise (libc.so.6 + 0x41176)
                #2  0x00007f5ba7632bc3 _ZN6KCrash19defaultCrashHandlerEi (libKF6Crash.so.6 + 0x6bc3)
                #3  0x00007f5ba4241240 __restore_rt (libc.so.6 + 0x41240)
                #4  0x00007f5ba74a4aa3 _ZNK6Plasma11Containment8activityEv (libPlasma.so.6 + 0x2baa3)
                #5  0x000000000045a93d _ZNK11ShellCorona20screenForContainmentEPKN6Plasma11ContainmentE (plasmashell + 0x5a93d)
                #6  0x00000000004404d5 _ZNK11DesktopView17usedInAccentColorEv (plasmashell + 0x404d5)
                #7  0x000000000042dc25 _ZN11DesktopView18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv (plasmashell + 0x2dc25)
                #8  0x00007f5ba5df21e0 _ZN3QV4L12loadPropertyEPNS_15ExecutionEngineEPNS_4Heap6ObjectEP7QObjectRK16QQmlPropertyData (libQt6Qml.so.6 + 0x1f21e0)
                #9  0x00007f5b5eb932a7 n/a (n/a + 0x0)
                #10 0x00007f5ba5e4bc88 _ZN3QV44Moth3VME4execEPNS_17JSTypesStackFrameEPNS_15ExecutionEngineE (libQt6Qml.so.6 + 0x24bc88)
                #11 0x00007f5ba5dbd25e _ZN3QV4L6doCallEPNS_8FunctionEPKNS_5ValueES4_iPNS_16ExecutionContextE (libQt6Qml.so.6 + 0x1bd25e)
                #12 0x00007f5ba5ef25d8 _ZN24QQmlJavaScriptExpression8evaluateEPN3QV48CallDataEPb (libQt6Qml.so.6 + 0x2f25d8)
                #13 0x00007f5ba5e86b63 _ZN11QQmlBinding8evaluateEPb (libQt6Qml.so.6 + 0x286b63)
                #14 0x00007f5ba5e8b80f _ZN11QQmlBinding8doUpdateERKN24QQmlJavaScriptExpression13DeleteWatcherE6QFlagsIN16QQmlPropertyData9WriteFlagEERN3QV45ScopeE (libQt6Qml.so.6 + 0x28b80f)
                #15 0x00007f5ba5e89894 _ZN11QQmlBinding6updateE6QFlagsIN16QQmlPropertyData9WriteFlagEE (libQt6Qml.so.6 + 0x289894)
                #16 0x00007f5ba5f12be8 _ZN12QQmlNotifier10emitNotifyEP20QQmlNotifierEndpointPPv (libQt6Qml.so.6 + 0x312be8)
                #17 0x00007f5ba4bda4c8 _Z10doActivateILb0EEvP7QObjectiPPv (libQt6Core.so.6 + 0x1da4c8)
                #18 0x00007f5ba5eb6e72 _ZN8QQmlData9destroyedEP7QObject (libQt6Qml.so.6 + 0x2b6e72)
                #19 0x00007f5ba4bcf702 _ZN7QObjectD2Ev (libQt6Core.so.6 + 0x1cf702)
                #20 0x00007f5ba773bf9a n/a (libPlasmaQuick.so.6 + 0x38f9a)
                #21 0x00007f5ba77362b8 n/a (libPlasmaQuick.so.6 + 0x332b8)
                #22 0x00007f5ba4bdaa83 _ZN9QtPrivate15QSlotObjectBase4callEP7QObjectPPv (libQt6Core.so.6 + 0x1daa83)
                #23 0x00007f5ba74a16e2 _ZN6Plasma6Applet13appletDeletedEPS0_ (libPlasma.so.6 + 0x286e2)
                #24 0x00007f5ba74987a4 _ZN6Plasma6AppletD1Ev (libPlasma.so.6 + 0x1f7a4)
                #25 0x00007f5ba74a46e9 _ZN6Plasma11ContainmentD0Ev (libPlasma.so.6 + 0x2b6e9)
                #26 0x0000000000465581 _ZN11ShellCoronaD2Ev (plasmashell + 0x65581)
                #27 0x00000000004659c9 _ZN11ShellCoronaD0Ev (plasmashell + 0x659c9)
                #28 0x00007f5ba4bcaba7 _ZN7QObject5eventEP6QEvent (libQt6Core.so.6 + 0x1caba7)
                #29 0x00007f5ba6dc1a7e _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt6Widgets.so.6 + 0x1c1a7e)
                #30 0x00007f5ba4b87998 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt6Core.so.6 + 0x187998)
                #31 0x00007f5ba4b87cf7 _ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData (libQt6Core.so.6 + 0x187cf7)
                #32 0x00007f5ba4b8be03 _ZN16QCoreApplication4execEv (libQt6Core.so.6 + 0x18be03)
                #33 0x00000000004288a7 main (plasmashell + 0x288a7)
                #34 0x00007f5ba422a1f0 __libc_start_call_main (libc.so.6 + 0x2a1f0)
                #35 0x00007f5ba422a2b9 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2a2b9)
                #36 0x00000000004289e5 _start (plasmashell + 0x289e5)

(cherry picked from commit 1c22c2dd)

Merge request reports

Loading