Bug 463485

Summary: Crash after reverting display settings
Product: [Applications] systemsettings Reporter: aeneid <dark0ne>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: dark0ne, nate, qydwhotmail
Priority: NOR Keywords: drkonqi, regression
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi

Description aeneid 2022-12-26 13:36:56 UTC
Application: systemsettings (5.26.80)

Qt Version: 5.15.7
Frameworks Version: 5.102.0
Operating System: Linux 6.1.0-1-default x86_64
Windowing System: Wayland
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.26.80 [KCrashBackend]

-- Information about the crash:
OS: openSUSE Tumbleweed - Krypton

Steps to reproduce:
1. Have two monitors enabled
2. Right click on desktop, Configure Display Settings
3. Disable the primary display and click apply
4. Click on revert display settings

The reporter is unsure if this crash is reproducible.

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

[KCrash Handler]
#4  0x00007fb6fd822a94 in KScreen::Config::outputs (this=0x0) at /usr/src/debug/libkscreen-5.26.80git.20221225T030257~a6d93d8/src/config.cpp:263
#5  0x00007fb6fd874662 in KCMKScreen::checkConfig (this=this@entry=0x565062bd9c40) at /usr/src/debug/kscreen-5.26.80git.20221225T030142~c3add80/kcm/kcm.cpp:352
#6  0x00007fb6fd8748be in KCMKScreen::continueNeedsSaveCheck (this=0x565062bd9c40, needs=<optimized out>) at /usr/src/debug/kscreen-5.26.80git.20221225T030142~c3add80/kcm/kcm.cpp:379
#7  0x00007fb733107c40 in QObject::event (this=0x565062bd9c40, e=0x565064382a10) at kernel/qobject.cpp:1347
#8  0x00007fb733fa53fe in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x565062bd9c40, e=0x565064382a10) at kernel/qapplication.cpp:3637
#9  0x00007fb7330dc128 in QCoreApplication::notifyInternal2 (receiver=0x565062bd9c40, event=0x565064382a10) at kernel/qcoreapplication.cpp:1064
#10 0x00007fb7330df0c1 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5650621e38a0) at kernel/qcoreapplication.cpp:1821
#11 0x00007fb733134353 in postEventSourceDispatch (s=0x56506221b290) at kernel/qeventdispatcher_glib.cpp:277
#12 0x00007fb731b1ba90 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#13 0x00007fb731b1be48 in ?? () from /lib64/libglib-2.0.so.0
#14 0x00007fb731b1bedc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#15 0x00007fb733133b56 in QEventDispatcherGlib::processEvents (this=0x56506221c490, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#16 0x00007fb7330dab9b in QEventLoop::exec (this=this@entry=0x7ffec1e108a0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#17 0x00007fb7330e2d06 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#18 0x0000565060cfe04f in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/systemsettings-5.26.80git.20221225T105913~4ea0e0f/app/main.cpp:188
[Inferior 1 (process 2347) detached]

Reported using DrKonqi
Comment 1 aeneid 2022-12-26 14:26:36 UTC
Created attachment 154830 [details]
New crash information added by DrKonqi

systemsettings (5.26.80) using Qt 5.15.7

Same steps and same hardware on KDE Neon Unstable

-- Backtrace (Reduced):
#6  0x00007fe0981e0dcb in KScreen::Config::outputs (this=0x0) at ./src/config.cpp:263
#7  0x00007fe09823984a in KCMKScreen::checkConfig (this=this@entry=0x55b431676ad0) at ./kcm/kcm.cpp:352
#8  0x00007fe0982399a6 in KCMKScreen::continueNeedsSaveCheck (this=0x55b431676ad0, needs=<optimized out>) at ./kcm/kcm.cpp:379
#9  0x00007fe0eed81afe in QObject::event (this=0x55b431676ad0, e=0x55b432f5a6e0) at kernel/qobject.cpp:1347
#10 0x00007fe0ef971763 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55b431676ad0, e=0x55b432f5a6e0) at kernel/qapplication.cpp:3637
Comment 2 Fushan Wen 2022-12-28 17:54:32 UTC
Created attachment 154867 [details]
New crash information added by DrKonqi

systemsettings (5.26.80) using Qt 5.15.7

Set a new resolution, apply and wait 15 seconds. System settings crashes.

-- Backtrace (Reduced):
#6  0x00007f76700b8a94 in KScreen::Config::outputs (this=0x0) at /usr/src/debug/libkscreen-5.26.80git.20221220T021118~e84d610/src/config.cpp:263
#7  0x00007f7672b63662 in KCMKScreen::checkConfig (this=this@entry=0x564cef15e700) at /usr/src/debug/kscreen-5.26.80git.20221221T021215~dbb98be/kcm/kcm.cpp:352
#8  0x00007f7672b638be in KCMKScreen::continueNeedsSaveCheck (this=0x564cef15e700, needs=<optimized out>) at /usr/src/debug/kscreen-5.26.80git.20221221T021215~dbb98be/kcm/kcm.cpp:379
#9  0x00007f769c907c40 in QObject::event (this=0x564cef15e700, e=0x564cf0f9aff0) at kernel/qobject.cpp:1347
#10 0x00007f769d5a53fe in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x564cef15e700, e=0x564cf0f9aff0) at kernel/qapplication.cpp:3637
Comment 3 Bug Janitor Service 2022-12-29 04:22:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreen/-/merge_requests/170
Comment 4 Fushan Wen 2022-12-29 18:20:09 UTC
Git commit e061c4705383a81c005ea41f2964a0c9af2e9ac4 by Fushan Wen.
Committed on 29/12/2022 at 04:20.
Pushed by ngraham into branch 'master'.

Fix kcm crash after revert timer reaches timeout

load() was called twice and cause use-after-free.

M  +2    -2    kcm/package/contents/ui/main.qml

https://invent.kde.org/plasma/kscreen/commit/e061c4705383a81c005ea41f2964a0c9af2e9ac4