Bug 456235

Summary: System Settings crashes in OutputModel::resolutionsStrings()
Product: [Applications] systemsettings Reporter: Jorge Goncalves <jorgeg>
Component: kcm_kscreenAssignee: kscreen-bugs-null <kscreen-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: gunnar.s.mikkelsen, nate, nicolas.fella, plasma-bugs, xaver.hugl
Priority: NOR Keywords: drkonqi
Version: 5.25.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jorge Goncalves 2022-07-02 11:06:53 UTC
Application: systemsettings (5.25.1)

Qt Version: 5.15.5
Frameworks Version: 5.95.0
Operating System: Linux 5.18.6-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.25.1 [KCrashBackend]

-- Information about the crash:
Sempre que tento configurar o ecran o programa fecha. Abre a janela do "display and monitor" mas não chega a apresentar o desenho do ecrãn

The crash can be reproduced every time.

-- Backtrace:
Application: System Settings (systemsettings), signal: Floating point exception

[KCrash Handler]
#4  0x00007f22981c2048 in OutputModel::resolutionsStrings (output=..., this=<optimized out>) at /usr/src/debug/kscreen5-5.25.1-1.1.x86_64/kcm/output_model.cpp:579
#5  OutputModel::data (this=<optimized out>, index=..., role=<optimized out>) at /usr/src/debug/kscreen5-5.25.1-1.1.x86_64/kcm/output_model.cpp:72
#6  0x00007f22a4226a30 in QModelIndex::data (arole=268, this=0x7fff86a63230) at /usr/include/qt5/QtCore/qabstractitemmodel.h:460
#7  QQmlDMAbstractItemModelData::value (role=268, this=0x55df1657f180) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qmlmodels/qqmladaptormodel.cpp:414
#8  QQmlDMCachedModelData::metaCall (this=0x55df1657f180, call=<optimized out>, id=<optimized out>, arguments=0x7fff86a632e0) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qmlmodels/qqmladaptormodel.cpp:282
#9  0x00007f22a50c26f6 in QQmlPropertyData::readProperty (property=0x7fff86a632c0, target=0x55df1657f180, this=0x55df164add08) at ../../include/QtQml/5.15.5/QtQml/private/../../../../../../src/qml/qml/qqmlpropertydata_p.h:357
#10 loadProperty (v4=0x55df1469c3b0, object=0x55df1657f180, property=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/jsruntime/qv4qobjectwrapper.cpp:176
#11 0x00007f22a50e2ac6 in QV4::Moth::VME::interpret (frame=0x7fff86a63180, engine=0x55df1469c3b0, code=0x7f227e76cc1a ":(\030\a\006\064\a\030\006\002") at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/jsruntime/qv4vme_moth.cpp:641
#12 0x00007f22a50e732f in QV4::Moth::VME::exec (frame=frame@entry=0x7fff86a634e0, engine=engine@entry=0x55df1469c3b0) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/jsruntime/qv4vme_moth.cpp:466
#13 0x00007f22a507a2ce in QV4::Function::call (this=this@entry=0x55df14cb79a0, thisObject=<optimized out>, argv=argv@entry=0x7f227f07d5d0, argc=<optimized out>, context=<optimized out>) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/jsruntime/qv4function.cpp:69
#14 0x00007f22a52023fd in QQmlJavaScriptExpression::evaluate (this=this@entry=0x55df167873c0, callData=0x7f227f07d5a0, isUndefined=isUndefined@entry=0x7fff86a636af) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmljavascriptexpression.cpp:212
#15 0x00007f22a52085a4 in QQmlBinding::evaluate (this=this@entry=0x55df167873c0, isUndefined=isUndefined@entry=0x7fff86a636af) at ../../include/QtQml/5.15.5/QtQml/private/../../../../../../src/qml/jsruntime/qv4jscall_p.h:95
#16 0x00007f22a520c6c3 in QQmlNonbindingBinding::doUpdate (this=0x55df167873c0, watcher=..., flags=..., scope=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlbinding.cpp:254
#17 0x00007f22a520a244 in QQmlBinding::update (this=0x55df167873c0, flags=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlbinding.cpp:194
#18 0x00007f22a50c2a5b in QQmlData::flushPendingBinding (propertyIndex=..., o=0x55df16786630) at ../../include/QtQml/5.15.5/QtQml/private/../../../../../../src/qml/qml/qqmldata_p.h:421
#19 QV4::QObjectWrapper::getProperty (engine=0x55df1469c3b0, object=0x55df16786630, property=0x7f2270119e08) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/jsruntime/qv4qobjectwrapper.cpp:236
#20 0x00007f22a50e2ac6 in QV4::Moth::VME::interpret (frame=0x7fff86a63180, engine=0x55df1469c3b0, code=0x7f227e76ccba ":,\030\v\260-\003\t\030\006\002") at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/jsruntime/qv4vme_moth.cpp:641
#21 0x00007f22a50e732f in QV4::Moth::VME::exec (frame=frame@entry=0x7fff86a639e0, engine=engine@entry=0x55df1469c3b0) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/jsruntime/qv4vme_moth.cpp:466
#22 0x00007f22a507a2ce in QV4::Function::call (this=this@entry=0x55df14cb7820, thisObject=<optimized out>, argv=argv@entry=0x7f227f07d508, argc=<optimized out>, context=<optimized out>) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/jsruntime/qv4function.cpp:69
#23 0x00007f22a52023fd in QQmlJavaScriptExpression::evaluate (this=this@entry=0x55df1678da70, callData=0x7f227f07d4d8, isUndefined=isUndefined@entry=0x7fff86a63baf) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmljavascriptexpression.cpp:212
#24 0x00007f22a52085a4 in QQmlBinding::evaluate (this=this@entry=0x55df1678da70, isUndefined=isUndefined@entry=0x7fff86a63baf) at ../../include/QtQml/5.15.5/QtQml/private/../../../../../../src/qml/jsruntime/qv4jscall_p.h:95
#25 0x00007f22a520c6c3 in QQmlNonbindingBinding::doUpdate (this=0x55df1678da70, watcher=..., flags=..., scope=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlbinding.cpp:254
#26 0x00007f22a520a244 in QQmlBinding::update (this=0x55df1678da70, flags=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlbinding.cpp:194
#27 0x00007f22a52174f2 in QQmlObjectCreator::finalize (this=0x55df14732ed0, interrupt=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlobjectcreator.cpp:1393
#28 0x00007f22a51ae3f2 in QQmlIncubatorPrivate::incubate (this=0x55df164afce0, i=...) at /usr/include/qt5/QtCore/qscopedpointer.h:116
#29 0x00007f22a51ae88d in QQmlEnginePrivate::incubate (this=0x55df146fa3c0, i=..., forContext=<optimized out>) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlincubator.cpp:89
#30 0x00007f22a423a2d8 in QQmlDelegateModelPrivate::object (this=0x55df14a53210, group=QQmlListCompositor::Default, index=1, incubationMode=<optimized out>) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qmlmodels/qqmldelegatemodel.cpp:1311
#31 0x00007f22a572500f in QQuickRepeaterPrivate::requestItems (this=0x55df14d84ec0) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/quick/items/qquickrepeater.cpp:403
#32 0x00007f22a57270ee in QQuickRepeater::setModel (this=0x55df14d84e00, m=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/quick/items/qquickrepeater.cpp:240
#33 0x00007f22a51a3b55 in QQmlPropertyData::writeProperty (flags=..., value=<optimized out>, target=<optimized out>, this=<optimized out>) at ../../include/QtQml/5.15.5/QtQml/private/../../../../../../src/qml/qml/qqmlpropertydata_p.h:375
#34 QQmlPropertyPrivate::write (object=0x55df14d84e00, property=..., value=..., context=0x55df14d48bc0, flags=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlproperty.cpp:1309
#35 0x00007f22a51a5d22 in QQmlPropertyPrivate::writeValueProperty (object=<optimized out>, core=..., valueTypeData=..., value=..., context=<optimized out>, flags=..., flags@entry=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlproperty.cpp:1218
#36 0x00007f22a5209be4 in QQmlBinding::slowWrite (this=this@entry=0x55df14d82300, core=..., valueTypeData=..., result=..., isUndefined=isUndefined@entry=false, flags=..., flags@entry=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlbinding.cpp:474
#37 0x00007f22a520afc0 in GenericBinding<0>::write (this=0x55df14d82300, result=..., isUndefined=<optimized out>, flags=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlbinding.cpp:335
#38 0x00007f22a520c7ee in QQmlNonbindingBinding::doUpdate (this=0x55df14d82300, watcher=..., flags=..., scope=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlbinding.cpp:258
#39 0x00007f22a520a244 in QQmlBinding::update (this=0x55df14d82300, flags=...) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlbinding.cpp:194
#40 0x00007f22a51e774f in QQmlNotifier::emitNotify (endpoint=<optimized out>, a=0x0) at /usr/src/debug/libqt5-qtdeclarative-5.15.5+kde19-1.1.x86_64/src/qml/qml/qqmlnotifier.cpp:104
#41 0x00007f22a74e19ad in doActivate<false> (sender=0x55df1470b760, signal_index=20, argv=0x0) at kernel/qobject.cpp:3778
#42 0x00007f22a74e1e6f in QtPrivate::QSlotObjectBase::call (a=0x7fff86a65ee0, r=0x55df1470b760, this=0x55df1554c4e0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#43 doActivate<false> (sender=0x55df14dbb470, signal_index=3, argv=0x7fff86a65ee0) at kernel/qobject.cpp:3886
#44 0x00007f22a74db22f in QMetaObject::activate (sender=sender@entry=0x55df14dbb470, m=m@entry=0x7f22981e1200 <ConfigHandler::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3946
#45 0x00007f22981c18c4 in ConfigHandler::outputModelChanged (this=<optimized out>) at /usr/src/debug/kscreen5-5.25.1-1.1.x86_64/build/kcm/kcm_kscreen_autogen/EWIEGA46WW/moc_config_handler.cpp:189
#46 ConfigHandler::setConfig (config=..., this=<optimized out>) at /usr/src/debug/kscreen5-5.25.1-1.1.x86_64/kcm/config_handler.cpp:60
#47 KCMKScreen::configReady (this=0x55df1470b760, op=<optimized out>) at /usr/src/debug/kscreen5-5.25.1-1.1.x86_64/kcm/kcm.cpp:73
#48 0x00007f22a74e1e6f in QtPrivate::QSlotObjectBase::call (a=0x7fff86a66130, r=0x55df1470b760, this=0x55df155430a0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#49 doActivate<false> (sender=0x55df14f6d600, signal_index=3, argv=0x7fff86a66130) at kernel/qobject.cpp:3886
#50 0x00007f22a74db22f in QMetaObject::activate (sender=sender@entry=0x55df14f6d600, m=m@entry=0x7f2298143040 <KScreen::ConfigOperation::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fff86a66130) at kernel/qobject.cpp:3946
#51 0x00007f229811a58f in KScreen::ConfigOperation::finished (this=this@entry=0x55df14f6d600, _t1=<optimized out>, _t1@entry=0x55df14f6d600) at /usr/src/debug/libkscreen2-5.25.1-1.1.x86_64/build/src/KF5Screen_autogen/EWIEGA46WW/moc_configoperation.cpp:153
#52 0x00007f229811aa00 in KScreen::ConfigOperationPrivate::doEmitResult (this=0x55df14f0ae80) at /usr/src/debug/libkscreen2-5.25.1-1.1.x86_64/src/configoperation.cpp:47
#53 KScreen::ConfigOperationPrivate::qt_static_metacall (_c=<optimized out>, _a=<optimized out>, _id=<optimized out>, _o=0x55df14f0ae80) at /usr/src/debug/libkscreen2-5.25.1-1.1.x86_64/build/src/KF5Screen_autogen/EWIEGA46WW/moc_configoperation_p.cpp:73
#54 KScreen::ConfigOperationPrivate::qt_static_metacall (_o=0x55df14f0ae80, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/libkscreen2-5.25.1-1.1.x86_64/build/src/KF5Screen_autogen/EWIEGA46WW/moc_configoperation_p.cpp:67
#55 0x00007f22a74d6760 in QObject::event (this=0x55df14f0ae80, e=0x55df158c3fa0) at kernel/qobject.cpp:1314
#56 0x00007f22a816341e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55df14f0ae80, e=0x55df158c3fa0) at kernel/qapplication.cpp:3637
#57 0x00007f22a74aafb8 in QCoreApplication::notifyInternal2 (receiver=0x55df14f0ae80, event=0x55df158c3fa0) at kernel/qcoreapplication.cpp:1064
#58 0x00007f22a74adf51 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55df14337480) at kernel/qcoreapplication.cpp:1821
#59 0x00007f22a7502c53 in postEventSourceDispatch (s=0x55df14441850) at kernel/qeventdispatcher_glib.cpp:277
#60 0x00007f22a59e1ea0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#61 0x00007f22a59e2258 in ?? () from /lib64/libglib-2.0.so.0
#62 0x00007f22a59e22ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#63 0x00007f22a7502456 in QEventDispatcherGlib::processEvents (this=0x55df14452890, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#64 0x00007f22a74a9a2b in QEventLoop::exec (this=this@entry=0x7fff86a66520, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#65 0x00007f22a74b1b96 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#66 0x000055df13677e33 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/systemsettings5-5.25.1-1.1.x86_64/app/main.cpp:183
[Inferior 1 (process 5076) detached]

Reported using DrKonqi
Comment 1 Nicolas Fella 2022-08-01 10:46:45 UTC
*** Bug 457350 has been marked as a duplicate of this bug. ***
Comment 2 Nicolas Fella 2022-08-01 10:49:33 UTC
Please run "kscreen-doctor -o" and past the output here
Comment 3 Jorge Goncalves 2022-08-01 10:53:28 UTC
kscreen-doctor -o
Output: 70 Virtual1 enabled connected primary Unknown Modes: 79:3840x2400@60 80:3840x2160@60 81:2880x1800@60 82:2560x1600@60 83:2560x1440@60 84:1920x1440@60 85:1856x1392@60 86:1792x1344@60 87:1920x1200@60 88:1920x1080@60 89:1600x1200@60 90:1680x1050@60 91:1400x1050@60 92:1280x1024@60 93:1440x900@60 94:1280x960@60 95:1360x768@60 96:1280x800@60 97:1152x864@75 98:1280x768@60 99:1280x720@60 100:1024x768@60 101:800x600@60 102:640x480@60 1354:1280x1024@60*! Geometry: 0,0 1280x1024 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown primary
Output: 71 Virtual2 disabled connected  Unknown Modes: 79:3840x2400@60 80:3840x2160@60 81:2880x1800@60 82:2560x1600@60 83:2560x1440@60 84:1920x1440@60 85:1856x1392@60 86:1792x1344@60 87:1920x1200@60 88:1920x1080@60 89:1600x1200@60 90:1680x1050@60 91:1400x1050@60 92:1280x1024@60 93:1440x900@60 94:1280x960@60 95:1360x768@60 96:1280x800@60 97:1152x864@75 98:1280x768@60 99:1280x720@60 100:1024x768@60 101:800x600@60 102:640x480@60 1351:0x0@60! Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 72 Virtual3 disabled disconnected  Unknown Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 73 Virtual4 disabled disconnected  Unknown Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 74 Virtual5 disabled disconnected  Unknown Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 75 Virtual6 disabled disconnected  Unknown Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 76 Virtual7 disabled disconnected  Unknown Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 77 Virtual8 disabled disconnected  Unknown Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown
Comment 4 Bug Janitor Service 2022-08-01 11:09:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreen/-/merge_requests/122
Comment 5 Nicolas Fella 2022-08-01 11:13:07 UTC
Thanks, that matches what I expected.

The above MR should fix it
Comment 6 Nicolas Fella 2022-08-12 15:06:15 UTC
Git commit 97e612c2652e47b017ecba93397f98ccf45098c2 by Nicolas Fella.
Committed on 12/08/2022 at 15:03.
Pushed by nicolasfella into branch 'master'.

Don't compute aspect ratio for empty screen geometries

Apparently some kinds of virtual screens have a geometry of 0x0, which causes a divide-by-zero when computing the aspect ratio

Since the aspect ratio is meaningless in that case just don't show it

M  +28   -19   kcm/output_model.cpp

https://invent.kde.org/plasma/kscreen/commit/97e612c2652e47b017ecba93397f98ccf45098c2
Comment 7 Nicolas Fella 2022-08-12 15:07:10 UTC
Git commit b3aee3d86f509deda9a5423041386f04e9df5f6d by Nicolas Fella.
Committed on 12/08/2022 at 15:06.
Pushed by nicolasfella into branch 'Plasma/5.25'.

Don't compute aspect ratio for empty screen geometries

Apparently some kinds of virtual screens have a geometry of 0x0, which causes a divide-by-zero when computing the aspect ratio

Since the aspect ratio is meaningless in that case just don't show it
(cherry picked from commit 97e612c2652e47b017ecba93397f98ccf45098c2)

M  +28   -19   kcm/output_model.cpp

https://invent.kde.org/plasma/kscreen/commit/b3aee3d86f509deda9a5423041386f04e9df5f6d
Comment 8 Nicolas Fella 2022-08-12 15:12:06 UTC
Git commit a327e16950de9fbb352be01485fb0275298d9921 by Nicolas Fella.
Committed on 12/08/2022 at 15:10.
Pushed by nicolasfella into branch 'Plasma/5.24'.

Don't compute aspect ratio for empty screen geometries

Apparently some kinds of virtual screens have a geometry of 0x0, which causes a divide-by-zero when computing the aspect ratio

Since the aspect ratio is meaningless in that case just don't show it
(cherry picked from commit 97e612c2652e47b017ecba93397f98ccf45098c2)

M  +24   -15   kcm/output_model.cpp

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