Bug 491059

Summary: System Settings crashes in std::default_delete<KPageViewPrivate> when closing Wallpaper KCM
Product: [Applications] systemsettings Reporter: Patrick Silva <bugseforuns>
Component: kcm_wallpaperAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: cwo.kde, duha.bugs, filip.kendes1, kdedev, meven29, meven, nate, ric.prog
Priority: NOR Keywords: drkonqi, regression
Version: 6.1.3   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/4500/events/59207991a903445e843d01a5e0caae43/
Attachments: New crash information added by DrKonqi

Description Patrick Silva 2024-07-31 13:22:49 UTC
Application: systemsettings (6.1.3)

Qt Version: 6.7.2
Frameworks Version: 6.4.0
Operating System: Linux 6.10.2-arch1-1 x86_64
Windowing System: Wayland
Distribution: "Arch Linux"
DrKonqi: 6.1.3 [CoredumpBackend]

-- Information about the crash:
1. open System Settings
2. go to Wallpaper KCM
3. close System Settings

Result: Plasma notifies a System Settings crash

The crash can be reproduced every time.

-- Backtrace (Reduced):
#5  0x0000757bd40fcae3 in std::__uniq_ptr_impl<KPageViewPrivate, std::default_delete<KPageViewPrivate> >::_M_ptr (this=<optimized out>, this=<optimized out>) at /usr/include/c++/14.1.1/bits/unique_ptr.h:193
#6  std::unique_ptr<KPageViewPrivate, std::default_delete<KPageViewPrivate> >::get (this=<optimized out>, this=<optimized out>) at /usr/include/c++/14.1.1/bits/unique_ptr.h:464
[...]
#9  KPageWidget::currentPage (this=0x6521ffffffff) at /usr/src/debug/kwidgetsaddons/kwidgetsaddons-6.4.1/src/kpagewidget.cpp:124
#10 0x00006521c59fddfd in ModuleView::stateChanged (this=0x6521d5e4d8a0) at /usr/src/debug/systemsettings/systemsettings-6.1.3/app/ModuleView.cpp:498
#11 0x0000757bd1ba16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469


Reported using DrKonqi
Comment 1 Patrick Silva 2024-07-31 13:22:51 UTC
Created attachment 172141 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 duha.bugs 2024-07-31 15:10:35 UTC
Confirming, can reproduce.

Operating System: Arch Linux 
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.5.0
Qt Version: 6.9.0
Comment 3 cwo 2024-07-31 18:28:23 UTC
Hm I can't reproduce this on Tuxedo OS with 6.1.3 or git master, nor with Fedora 40 (fully upgraded) in a VM. I wonder if it's something Arch-specific.
Comment 4 Nate Graham 2024-07-31 18:38:09 UTC
I can reproduce it with current git master built on top of Fedora KDE 40.
Comment 5 cwo 2024-08-04 23:56:35 UTC
*** Bug 491259 has been marked as a duplicate of this bug. ***
Comment 6 TraceyC 2024-08-07 16:23:38 UTC
I can also reproduce this reliably on git-master running on Solus, as well as 6.1.3 on another Solus system

1. Open System Settings via command line `systemsettings`
2. Click Wallpaper
3. Change Wallpaper type
4. Click close and then Discard on the confirmation pop up
Crash

From command line

❯ systemsettings
qt.qpa.wayland: eglSwapBuffers failed with 0x300d, surface: 0x0
kf.coreaddons: "Could not find plugin org.kde.potd"
qrc:/kcm/kcm_wallpaper/main.qml:132: TypeError: Cannot call method 'hasOwnProperty' of null
kf.coreaddons: "Could not find plugin org.kde.image"
kf.coreaddons: "Could not find plugin org.kde.image"
kf.coreaddons: "Could not find plugin org.kde.slideshow"
file:///usr/share/plasma/wallpapers/org.kde.image/contents/ui/SlideshowComponent.qml: No such file or directory
kf.coreaddons: "Could not find plugin org.kde.image"
KCrash: Application 'systemsettings' crashing... crashRecursionCounter = 2
[1]    290990 segmentation fault (core dumped)  systemsettings

Operating System: Solus 4.5
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.9.12-297.current (64-bit)
Graphics Platform: Wayland
Comment 7 Méven Car 2024-09-13 10:17:21 UTC
(In reply to TraceyC from comment #6)
> I can also reproduce this reliably on git-master running on Solus, as well
> as 6.1.3 on another Solus system
> 
> 1. Open System Settings via command line `systemsettings`
> 2. Click Wallpaper
> 3. Change Wallpaper type
> 4. Click close and then Discard on the confirmation pop up
> Crash
> 
> From command line
> 
> ❯ systemsettings
> qt.qpa.wayland: eglSwapBuffers failed with 0x300d, surface: 0x0
> kf.coreaddons: "Could not find plugin org.kde.potd"
> qrc:/kcm/kcm_wallpaper/main.qml:132: TypeError: Cannot call method
> 'hasOwnProperty' of null
> kf.coreaddons: "Could not find plugin org.kde.image"
> kf.coreaddons: "Could not find plugin org.kde.image"
> kf.coreaddons: "Could not find plugin org.kde.slideshow"
> file:///usr/share/plasma/wallpapers/org.kde.image/contents/ui/
> SlideshowComponent.qml: No such file or directory
> kf.coreaddons: "Could not find plugin org.kde.image"
> KCrash: Application 'systemsettings' crashing... crashRecursionCounter = 2
> [1]    290990 segmentation fault (core dumped)  systemsettings
> 
> Operating System: Solus 4.5
> KDE Plasma Version: 6.1.3
> KDE Frameworks Version: 6.4.0
> Qt Version: 6.7.2
> Kernel Version: 6.9.12-297.current (64-bit)
> Graphics Platform: Wayland

I don't reproduce it with:

Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.6-arch1-1 (64-bit)
Graphics Platform: Wayland

Would appreciate a confirmation, from someone else.
Then mark this as RESOLVED WORKSFORME.

I believe this was fixed by a Plasma maintenance version.
Comment 8 Patrick Silva 2024-09-13 14:01:08 UTC
Can reproduce on Plasma 6.2 beta with the steps from comment 0.

Operating System: Arch Linux 
KDE Plasma Version: 6.1.90
KDE Frameworks Version: 6.5.0
Qt Version: 6.8.0
Graphics Platform: Wayland
Comment 9 Bug Janitor Service 2024-09-13 14:54:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4693
Comment 10 Méven Car 2024-09-13 17:00:54 UTC
(In reply to Patrick Silva from comment #8)
> Can reproduce on Plasma 6.2 beta with the steps from comment 0.
> 
> Operating System: Arch Linux 
> KDE Plasma Version: 6.1.90
> KDE Frameworks Version: 6.5.0
> Qt Version: 6.8.0
> Graphics Platform: Wayland

Could you someone reproducing the issue could test my merge request ?
Comment 11 Patrick Silva 2024-09-13 17:33:35 UTC
Unfortunately I can't build plasma-workspace on my system.

$ cmake ..
...
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Checking for module 'xkbcommon'
--   Found xkbcommon, version 1.7.0
CMake Error at libkmpris/autotests/CMakeLists.txt:16 (find_program):
  Could not find kglobalacceld_PATH using the following names: kglobalacceld


-- Configuring incomplete, errors occurred!
Comment 12 Ricardo Bastos 2024-09-13 18:05:44 UTC
Operating System: Arch Linux
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.9-arch1-2 (64-bit)
Graphics Platform: Wayland

1 = Crash!
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: Dell Inc.
Product Name: Latitude 3420

2 = Ok
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 15,3 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: LENOVO
Product Name: 82TB
System Version: Legion 5 15IAH7H

3 = Ok
Processors: 28 × Intel® Xeon® CPU E5-2697 v3 @ 2.60GHz
Memory: 62,7 GiB of RAM
Graphics Processor: AMD Radeon RX 580 2048SP
Manufacturer: INTEL
Comment 13 duha.bugs 2024-09-13 21:30:59 UTC
>Could you someone reproducing the issue could test my merge request ?

I can unfortunately no longer reproduce, neither with 6.1.5 nor with master.

(In reply to Patrick Silva from comment #11)
> Unfortunately I can't build plasma-workspace on my system.
> 
> $ cmake ..
> ...
> -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
> -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
> -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
> -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
> -- Performing Test COMPILER_HAS_DEPRECATED_ATTR
> -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
> -- Checking for module 'xkbcommon'
> --   Found xkbcommon, version 1.7.0
> CMake Error at libkmpris/autotests/CMakeLists.txt:16 (find_program):
>   Could not find kglobalacceld_PATH using the following names: kglobalacceld
> 
> 
> -- Configuring incomplete, errors occurred!

Can you try building without tests? Not sure how you build, I do this in kde-builder with: kde-builder --cmake-options=-DBUILD_TESTING=OFF
Comment 14 Patrick Silva 2024-09-13 23:10:35 UTC
Thank you very much, the following command worked:

$ cmake .. -DBUILD_TESTING=OFF

Méven's merge request fixes the crash on my system. :)
Comment 15 Méven 2024-09-14 10:21:17 UTC
(In reply to Patrick Silva from comment #14)
> Thank you very much, the following command worked:
> 
> $ cmake .. -DBUILD_TESTING=OFF
> 
> Méven's merge request fixes the crash on my system. :)

I merged to master https://invent.kde.org/plasma/plasma-workspace/-/commit/6893ad4d4c53ceb62b998b73e012f7f9f13ffff7.

This should be fixed in master, can you (one last time) confirm :)

If it does not fix it then it is missing:

```
    disconnect(m_outputOrderWatcher, &OutputOrderWatcher::outputOrderChanged, this, nullptr);
``` 
in dtor, or another way to avoid the wallpaper config to get updated.

I still don't quite pinpoint how the application can be in the stacktrace state exactly.

> KDE Frameworks Version: 6.5.0

Do you still have this version @Patrick Silva ?
Comment 16 Méven 2024-09-17 09:04:55 UTC
Git commit b757708b06611fb521b75120266a498d4a70b1a0 by Méven Car.
Committed on 17/09/2024 at 09:04.
Pushed by meven into branch 'master'.

WallpaperKcm: disconnect from child object

To avoid it triggering a slot during destruction.

M  +5    -0    kcms/wallpaper/wallpapermodule.cpp
M  +1    -1    kcms/wallpaper/wallpapermodule.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/b757708b06611fb521b75120266a498d4a70b1a0
Comment 17 Méven 2024-09-18 07:08:47 UTC
Git commit 7a6d37654aaefcaae38cb20cfe62031ab159f3b3 by Méven Car.
Committed on 18/09/2024 at 07:08.
Pushed by meven into branch 'Plasma/6.2'.

WallpaperKcm: disconnect from child object

To avoid it triggering a slot during destruction.
(cherry picked from commit b757708b06611fb521b75120266a498d4a70b1a0)

M  +5    -0    kcms/wallpaper/wallpapermodule.cpp
M  +1    -1    kcms/wallpaper/wallpapermodule.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/7a6d37654aaefcaae38cb20cfe62031ab159f3b3
Comment 18 Méven Car 2024-09-19 12:18:31 UTC
*** Bug 486572 has been marked as a duplicate of this bug. ***