Bug 449853

Summary: Systemsettings 5.24 crashes when switching from icon view to sidebar view
Product: [Applications] systemsettings Reporter: Christian (Fuchs) <kde>
Component: generic-crashAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED WORKSFORME    
Severity: crash CC: bugseforuns, nate, postix, qydwhotmail, trmdi
Priority: NOR Keywords: drkonqi, regression
Version: 5.24.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=247827
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
Stacktrace: openSUSE TW (SidebarMode::requestToolTip )
New crash information added by DrKonqi
New crash information added by DrKonqi

Description Christian (Fuchs) 2022-02-09 13:25:28 UTC
Application: systemsettings (5.24.0)

Qt Version: 5.15.2
Frameworks Version: 5.90.0
Operating System: Linux 5.16.5-200.fc35.x86_64 x86_64
Windowing System: X11
Distribution: Fedora Linux 35 (KDE Plasma)
DrKonqi: 5.24.0 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:

Switching from icon view to sidebar view via the button in the toolbar. 

This is 100% reproducible, see attached backtrace.

Happens since the update to 5.24

The crash can be reproduced every time.

-- Backtrace:
Application: Systemeinstellungen (systemsettings), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f333cdc2738 in QAbstractAnimation::stop() () from /lib64/libQt5Core.so.5
#5  0x00007f333cdc785b in QPropertyAnimation::~QPropertyAnimation() () from /lib64/libQt5Core.so.5
#6  0x00007f3329850c37 in Breeze::Animation::~Animation() () from /usr/lib64/qt5/plugins/styles/breeze.so
#7  0x00007f333cfc07ca in QObjectPrivate::deleteChildren() () from /lib64/libQt5Core.so.5
#8  0x00007f333cfc80cc in QObject::~QObject() () from /lib64/libQt5Core.so.5
#9  0x00007f3329846f01 in Breeze::WidgetStateData::~WidgetStateData() () from /usr/lib64/qt5/plugins/styles/breeze.so
#10 0x00007f333cfc1d71 in QObject::event(QEvent*) () from /lib64/libQt5Core.so.5
#11 0x00007f333db71443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#12 0x00007f333cf977d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#13 0x00007f333cf9ad46 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt5Core.so.5
#14 0x00007f333cfe9117 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5Core.so.5
#15 0x00007f333aca805f in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#16 0x00007f333acfd2a8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#17 0x00007f333aca5853 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#18 0x00007f333cfe8bb8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#19 0x00007f333cf961e2 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#20 0x00007f333cf9e724 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#21 0x0000559bc2e0e1e1 in main ()
[Inferior 1 (process 21830) detached]

Possible duplicates by query: bug 374941.

Reported using DrKonqi
Comment 1 Patrick Silva 2022-02-10 16:58:59 UTC

*** This bug has been marked as a duplicate of bug 444599 ***
Comment 2 Fushan Wen 2022-02-16 03:52:43 UTC
Created attachment 146798 [details]
New crash information added by DrKonqi

systemsettings (5.24.0) using Qt 5.15.2

- What I was doing when the application crashed:
Switching from icon view to sidebar view via the button in the toolbar.

-- Backtrace (Reduced):
#6  QAbstractAnimation::stop (this=0x560de9da6bb0) at animation/qabstractanimation.cpp:1378
#7  0x00007fee1075a607 in QPropertyAnimation::~QPropertyAnimation (this=this@entry=0x560de9da6bb0, __in_chrg=<optimized out>) at animation/qpropertyanimation.cpp:167
#8  0x00007fee08c80273 in Breeze::Animation::~Animation (this=<optimized out>, this=<optimized out>) at /usr/src/debug/breeze-5.24.0-1.1.x86_64/build/kstyle/breeze_autogen/4NBMFDNHZT/../../../../kstyle/animations/breezeanimation.h:18
#9  Breeze::Animation::~Animation (this=<optimized out>, this=<optimized out>) at /usr/src/debug/breeze-5.24.0-1.1.x86_64/build/kstyle/breeze_autogen/4NBMFDNHZT/../../../../kstyle/animations/breezeanimation.h:18
#10 0x00007fee1097cbae in QObjectPrivate::deleteChildren (this=0x560dea1ac230) at kernel/qobject.cpp:2104
Comment 3 Fushan Wen 2022-02-16 03:58:08 UTC
*** Bug 444599 has been marked as a duplicate of this bug. ***
Comment 4 Fushan Wen 2022-02-16 06:05:08 UTC
I suspect it was caused by some changes in the title. I set a breakpoint at `Breeze::Animation::~Animation()`, and Breeze::Animation::~Animation() refers to the page title.
Comment 5 trmdi 2022-02-16 14:53:55 UTC
I can't reproduce with the same version with OP on Tumbleweed.
Comment 6 Fushan Wen 2022-02-16 16:37:25 UTC
Can also reproduce with Adwaita theme. So the bug is not Breeze-specific.
Comment 7 postix 2022-02-17 12:12:11 UTC
Created attachment 146861 [details]
Stacktrace: openSUSE TW (SidebarMode::requestToolTip )

I could reproduce a crash on openSUSE TW (Wayland) once too, when I switched from one view to another, but I got a different stacktrace:

```
#4  <signal handler called>
#5  QWeakPointer<QObject>::internalData (this=0x5648837943b0) at ../../include/QtCore/../../src/corelib/tools/qsharedpointer_impl.h:696
#6  QPointer<QObject>::data (this=0x5648837943b0) at ../../include/QtCore/../../src/corelib/kernel/qpointer.h:77
#7  QPointer<QObject>::operator QObject* (this=0x5648837943b0) at ../../include/QtCore/../../src/corelib/kernel/qpointer.h:83
#8  QCoreApplicationPrivate::sendThroughObjectEventFilters (event=<optimized out>, receiver=<optimized out>) at kernel/qcoreapplication.cpp:1183
#9  QCoreApplicationPrivate::sendThroughObjectEventFilters (receiver=receiver@entry=0x564a8368b450, event=event@entry=0x7ffce32e9370) at kernel/qcoreapplication.cpp:1179
#10 0x00007f202f072a6e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x564a8368b450, e=0x7ffce32e9370) at kernel/qapplication.cpp:3626
#11 0x00007f202e3bfe2a in QCoreApplication::notifyInternal2 (receiver=0x564a8368b450, event=0x7ffce32e9370) at kernel/qcoreapplication.cpp:1064
#12 0x00007f202f0b44dd in QWidgetPrivate::setVisible (this=<optimized out>, visible=<optimized out>) at kernel/qwidget.cpp:8145
#13 0x00007f201c3364da in ToolTipManager::requestToolTip (rect=..., index=..., this=0x564a83791790) at /usr/src/debug/systemsettings5-5.24.0-1.1.x86_64/sidebar/ToolTips/tooltipmanager.cpp:110
#14 ToolTipManager::requestToolTip (this=0x564a83791790, index=..., rect=...) at /usr/src/debug/systemsettings5-5.24.0-1.1.x86_64/sidebar/ToolTips/tooltipmanager.cpp:105
#15 0x00007f201c33919d in SidebarMode::requestToolTip (rect=..., index=..., this=0x564a835d7040) at /usr/src/debug/systemsettings5-5.24.0-1.1.x86_64/sidebar/SidebarMode.cpp:415
```
Comment 8 Fushan Wen 2022-02-18 13:16:52 UTC
(In reply to postix from comment #7)
> Created attachment 146861 [details]
> Stacktrace: openSUSE TW (SidebarMode::requestToolTip )
> 
> I could reproduce a crash on openSUSE TW (Wayland) once too, when I switched
> from one view to another, but I got a different stacktrace:

Your stack trace is very useful. I can prevent the crash by not initializing the most used model.
Comment 9 Bug Janitor Service 2022-02-18 14:07:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/systemsettings/-/merge_requests/129
Comment 10 Fushan Wen 2022-02-18 14:21:12 UTC
My assumption:

The bug can only occur on not-so-fast computers because the placeholder widget is loaded and hidden instantly on fast computers, but on not-so-fast computers, the placeholder widget is loaded, and starts processing events. However during the event processing process, the module widget is loaded and the placeholder widget is hidden, therefore some events that are still being processed can't be handled correctly anymore (is it possible?).

I marked my fix as CCBUG because I was not sure if it's the real fix or not. I have tested many times and no crash happened.
Comment 11 postix 2022-02-18 14:25:17 UTC
(In reply to Fushan Wen from comment #10)
> My assumption:
> The bug can only occur on not-so-fast computers 

I could only reproduce it once so far, though I wouldn't say that my computer does belong to the group of "not-so-fast" computers:

Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 31,2 GiB of RAM
Graphics Processor: AMD Radeon RX 580 Series
NVMe SSD
Comment 12 trmdi 2022-02-18 14:56:19 UTC
I can't reproduce it on both X and Wayland. If you use intel and have xf86-video-intel installed, try removing it?
Comment 13 Fushan Wen 2022-02-18 15:20:17 UTC
(In reply to trmdi from comment #12)
> I can't reproduce it on both X and Wayland. If you use intel and have
> xf86-video-intel installed, try removing it?

The package is not installed. Now I can still sometimes (better than every time)  reproduce the crash with my patch applied.
Comment 14 Fushan Wen 2022-02-18 15:25:48 UTC
Created attachment 146916 [details]
New crash information added by DrKonqi

systemsettings (5.24.0) using Qt 5.15.2

- What I was doing when the application crashed:
Adwaita theme, with my patch applied, and the bug still occurs sometimes.

-- Backtrace (Reduced):
#6  QAbstractAnimation::stop (this=0x55da9d892660) at animation/qabstractanimation.cpp:1378
#7  0x00007fc075612607 in QPropertyAnimation::~QPropertyAnimation (this=this@entry=0x55da9d892660, __in_chrg=<optimized out>) at animation/qpropertyanimation.cpp:167
#8  0x00007fc06daeaf47 in Adwaita::Animation::~Animation (this=<optimized out>, this=<optimized out>) at /usr/src/debug/adwaita-qt-1.4.0-1.4.x86_64/build/src/lib/adwaitaqtpriv_autogen/4NBMFDNHZT/../../../../../src/lib/animations/adwaitaanimation.h:46
#9  Adwaita::Animation::~Animation (this=<optimized out>, this=<optimized out>) at /usr/src/debug/adwaita-qt-1.4.0-1.4.x86_64/build/src/lib/adwaitaqtpriv_autogen/4NBMFDNHZT/../../../../../src/lib/animations/adwaitaanimation.h:46
#10 0x00007fc075834bae in QObjectPrivate::deleteChildren (this=0x55da9dc7c080) at kernel/qobject.cpp:2104
Comment 15 Fushan Wen 2022-02-19 13:09:35 UTC
Git commit e7dab85368331b97ed859c50353a5681ad3daf12 by Fushan Wen.
Committed on 18/02/2022 at 14:05.
Pushed by fusionfuture into branch 'master'.

sidebar: Load placeHolderWidget only when needed

This slightly reduces the startup time of the sidebar mode, and
potentially fixes the crash when switching from the icon mode to
the sidebar mode.

M  +35   -18   sidebar/SidebarMode.cpp
M  +1    -0    sidebar/SidebarMode.h

https://invent.kde.org/plasma/systemsettings/commit/e7dab85368331b97ed859c50353a5681ad3daf12
Comment 16 Fushan Wen 2022-02-19 13:10:46 UTC
Git commit f2909a903e125d904ae3e49f372634c2fc39db9d by Fushan Wen.
Committed on 19/02/2022 at 13:10.
Pushed by fusionfuture into branch 'Plasma/5.24'.

sidebar: Load placeHolderWidget only when needed

This slightly reduces the startup time of the sidebar mode, and
potentially fixes the crash when switching from the icon mode to
the sidebar mode.


(cherry picked from commit e7dab85368331b97ed859c50353a5681ad3daf12)

M  +35   -18   sidebar/SidebarMode.cpp
M  +1    -0    sidebar/SidebarMode.h

https://invent.kde.org/plasma/systemsettings/commit/f2909a903e125d904ae3e49f372634c2fc39db9d
Comment 17 Nate Graham 2022-03-02 16:51:31 UTC

*** This bug has been marked as a duplicate of bug 444599 ***
Comment 18 Fushan Wen 2022-12-04 11:52:33 UTC
Created attachment 154303 [details]
New crash information added by DrKonqi

systemsettings (5.26.80) using Qt 5.15.7

Switched from Icon View to Sidebar View, and system settings crashed.

-- Backtrace (Reduced):
#6  QAbstractAnimation::stop (this=0x55a19d06de30) at animation/qabstractanimation.cpp:1378
#7  0x00007f53c68e23e7 in QPropertyAnimation::~QPropertyAnimation (this=this@entry=0x55a19d06de30, __in_chrg=<optimized out>) at animation/qpropertyanimation.cpp:167
#8  0x00007f53c0118313 in Breeze::Animation::~Animation (this=<optimized out>, this=<optimized out>) at /usr/src/debug/breeze-5.26.80git.20221202T030836~0eca335/build/kstyle/breeze_autogen/4NBMFDNHZT/../../../../kstyle/animations/breezeanimation.h:17
#9  Breeze::Animation::~Animation (this=<optimized out>, this=<optimized out>) at /usr/src/debug/breeze-5.26.80git.20221202T030836~0eca335/build/kstyle/breeze_autogen/4NBMFDNHZT/../../../../kstyle/animations/breezeanimation.h:17
#10 0x00007f53c6b057de in QObjectPrivate::deleteChildren (this=this@entry=0x55a19cfaf7b0) at kernel/qobject.cpp:2137
Comment 19 Fushan Wen 2023-04-09 03:23:24 UTC
Cannot reproduce recently