Bug 423682

Summary: system settings segmentation fault in QtWaylandClient::QWaylandWindow::decoration when selecting activities and closing
Product: [Applications] systemsettings Reporter: Matt Fagnani <matt.fagnani>
Component: kcm_activitiesAssignee: Ivan Čukić <ivan.cukic>
Status: RESOLVED FIXED    
Severity: crash CC: nate, plasma-bugs
Priority: NOR Keywords: drkonqi
Version: 5.19.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Matt Fagnani 2020-06-30 02:47:11 UTC
Application: systemsettings5 (5.19.2)

Qt Version: 5.14.2
Frameworks Version: 5.71.0
Operating System: Linux 5.8.0-0.rc3.1.fc33.x86_64 x86_64
Windowing system: Wayland
Distribution: Fedora 33 (KDE Plasma Prerelease)

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

I was using Plasma 5.19.2 on Wayland in a Fedora Rawhide KDE Plasma spin installation with KF 5.71.0, Qt 5.14.2. I started System Settings on Wayland. I selected Workspace Behavior > Activities. The left menus were black as I reported at https://bugs.kde.org/show_bug.cgi?id=418291 The main part of System Settings wasn't displaying normally. I closed System Settings. A segmentation fault in System Settings happened in QtWaylandClient::QWaylandWindow::decoration at qwaylandwindow.cpp:825. this=0x0 in QtWaylandClient::QWaylandWindow::decoration might indicate a null pointer dereference as the reason for the segmentation fault. qwaylandwindow.cpp:825 returns mWindowDecoration in QtWaylandClient::QWaylandWindow::decoration

QWaylandAbstractDecoration *QWaylandWindow::decoration() const
{
    return mWindowDecoration;
}

-- Backtrace:
Application: System Settings (systemsettings5), signal: Segmentation fault

[KCrash Handler]
#4  QtWaylandClient::QWaylandWindow::decoration (this=0x0) at qwaylandwindow.cpp:825
#5  0x00007f31b8a01759 in QtWaylandClient::QWaylandShmBackingStore::windowDecoration (this=this@entry=0x5623ea6448c0) at qwaylandshmbackingstore.cpp:362
#6  0x00007f31b8a021c6 in QtWaylandClient::QWaylandShmBackingStore::resize (this=this@entry=0x5623ea6448c0, size=...) at qwaylandshmbackingstore.cpp:308
#7  0x00007f31b8a02301 in QtWaylandClient::QWaylandShmBackingStore::ensureSize (this=this@entry=0x5623ea6448c0) at qwaylandshmbackingstore.cpp:205
#8  0x00007f31b8a0233d in QtWaylandClient::QWaylandShmBackingStore::beginPaint (this=this@entry=0x5623ea6448c0, region=...) at qwaylandshmbackingstore.cpp:180
#9  0x00007f31cb08ddad in QBackingStore::beginPaint (this=0x5623ea6bc0c0, region=...) at ../../include/QtGui/5.14.2/QtGui/private/../../../../../src/gui/kernel/qhighdpiscaling_p.h:109
#10 0x00007f31cb4f3e0e in QWidgetRepaintManager::paintAndFlush (this=<optimized out>) at kernel/qwidgetrepaintmanager.cpp:984
#11 0x00007f31cb524a97 in QWidget::event (this=this@entry=0x5623ea4b5020, event=event@entry=0x5623ec3b09d0) at kernel/qwidget.cpp:8978
#12 0x00007f31cb633530 in QMainWindow::event (this=this@entry=0x5623ea4b5020, event=event@entry=0x5623ec3b09d0) at widgets/qmainwindow.cpp:1341
#13 0x00007f31cbfabf4d in KMainWindow::event (this=this@entry=0x5623ea4b5020, ev=ev@entry=0x5623ec3b09d0) at /usr/src/debug/kf5-kxmlgui-5.71.0-1.fc33.x86_64/src/kmainwindow.cpp:885
#14 0x00007f31cbfdac3d in KXmlGuiWindow::event (this=0x5623ea4b5020, ev=0x5623ec3b09d0) at /usr/src/debug/kf5-kxmlgui-5.71.0-1.fc33.x86_64/src/kxmlguiwindow.cpp:121
#15 0x00007f31cb4e3063 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5623ea4b5020, e=0x5623ec3b09d0) at kernel/qapplication.cpp:3685
#16 0x00007f31caaabfc0 in QCoreApplication::notifyInternal2 (receiver=0x5623ea4b5020, event=0x5623ec3b09d0) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:153
#17 0x00007f31caaaec47 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5623ea44b000) at kernel/qcoreapplication.cpp:1815
#18 0x00007f31caaf80a7 in postEventSourceDispatch (s=s@entry=0x5623ea466630) at kernel/qeventdispatcher_glib.cpp:277
#19 0x00007f31c882beaf in g_main_dispatch (context=0x5623ea47aa30) at ../glib/gmain.c:3309
#20 g_main_context_dispatch (context=0x5623ea47aa30) at ../glib/gmain.c:3974
#21 0x00007f31c882c238 in g_main_context_iterate (context=context@entry=0x5623ea47aa30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4047
#22 0x00007f31c882c303 in g_main_context_iteration (context=0x5623ea47aa30, may_block=may_block@entry=1) at ../glib/gmain.c:4108
#23 0x00007f31caaf7b73 in QEventDispatcherGlib::processEvents (this=0x5623ea49d2f0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#24 0x00007f31caaaa91b in QEventLoop::exec (this=this@entry=0x7fff34ad2850, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#25 0x00007f31caab25a6 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#26 0x00005623e98290cf in main (argc=<optimized out>, argv=0x7fff34ad2970) at /usr/src/debug/plasma-systemsettings-5.19.2-1.fc33.x86_64/app/main.cpp:168
[Inferior 1 (process 9398) detached]

Reported using DrKonqi
Comment 1 Nate Graham 2020-10-12 22:44:35 UTC
#4  QtWaylandClient::QWaylandWindow::decoration (this=0x0) at qwaylandwindow.cpp:825
#5  0x00007f31b8a01759 in QtWaylandClient::QWaylandShmBackingStore::windowDecoration (this=this@entry=0x5623ea6448c0) at qwaylandshmbackingstore.cpp:362
#6  0x00007f31b8a021c6 in QtWaylandClient::QWaylandShmBackingStore::resize (this=this@entry=0x5623ea6448c0, size=...) at qwaylandshmbackingstore.cpp:308
#7  0x00007f31b8a02301 in QtWaylandClient::QWaylandShmBackingStore::ensureSize (this=this@entry=0x5623ea6448c0) at qwaylandshmbackingstore.cpp:205
#8  0x00007f31b8a0233d in QtWaylandClient::QWaylandShmBackingStore::beginPaint (this=this@entry=0x5623ea6448c0, region=...) at qwaylandshmbackingstore.cpp:180
#9  0x00007f31cb08ddad in QBackingStore::beginPaint (this=0x5623ea6bc0c0, region=...) at ../../include/QtGui/5.14.2/QtGui/private/../../../../../src/gui/kernel/qhighdpiscaling_p.h:109
Comment 2 Bug Janitor Service 2020-10-21 12:34:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/197
Comment 3 David Edmundson 2020-10-22 11:49:24 UTC
Git commit 8d33d2d7372308d0b1f4d3ab7af645ebe9677e83 by David Edmundson.
Committed on 22/10/2020 at 11:49.
Pushed by davidedmundson into branch 'master'.

[kcms/activities] Port to QQuickWidget from nested QQuickWindows

Nested QQuickWindows are still somewhat problematic especially when used
in systemsettings which is already a very hybrid mix.

At some point this will all be fully ported to QtQuick anyway, there
isn't anything especially complex going on in the UI that isn't QtQuick
already. This is a small backportable patch to supress the bugs.
Related: bug 394899, bug 416253
Fixed-in: 5.20.0

M  +5    -12   kcms/activities/ActivitiesTab.cpp
M  +2    -2    kcms/activities/ActivitiesTab.h
M  +1    -0    kcms/activities/CMakeLists.txt
M  +3    -13   kcms/activities/PrivacyTab.cpp
M  +6    -3    kcms/activities/imports/dialog.cpp
M  +44   -46   kcms/activities/ui/PrivacyTabBase.ui
D  +0    -57   kcms/activities/utils.h

https://invent.kde.org/plasma/plasma-desktop/commit/8d33d2d7372308d0b1f4d3ab7af645ebe9677e83
Comment 4 David Edmundson 2020-10-22 11:50:06 UTC
Git commit 7079d0952b313b636126c39f0437ff6ba8687ca7 by David Edmundson.
Committed on 22/10/2020 at 11:49.
Pushed by davidedmundson into branch 'Plasma/5.20'.

[kcms/activities] Port to QQuickWidget from nested QQuickWindows

Nested QQuickWindows are still somewhat problematic especially when used
in systemsettings which is already a very hybrid mix.

At some point this will all be fully ported to QtQuick anyway, there
isn't anything especially complex going on in the UI that isn't QtQuick
already. This is a small backportable patch to supress the bugs.
Related: bug 394899, bug 416253
Fixed-in: 5.20.0


(cherry picked from commit 8d33d2d7372308d0b1f4d3ab7af645ebe9677e83)

M  +5    -12   kcms/activities/ActivitiesTab.cpp
M  +2    -2    kcms/activities/ActivitiesTab.h
M  +1    -0    kcms/activities/CMakeLists.txt
M  +3    -13   kcms/activities/PrivacyTab.cpp
M  +6    -3    kcms/activities/imports/dialog.cpp
M  +44   -46   kcms/activities/ui/PrivacyTabBase.ui
D  +0    -57   kcms/activities/utils.h

https://invent.kde.org/plasma/plasma-desktop/commit/7079d0952b313b636126c39f0437ff6ba8687ca7