Bug 468443 - KWin freezes for a little while after the first time activating anything run in-process that queries Kirigami.Settings.tabletMode (Window View, Overview, new Thumbnail Grid window switcher)
Summary: KWin freezes for a little while after the first time activating anything run ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-window-management (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-04-13 00:46 UTC by Nicolas Fella
Modified: 2023-06-23 14:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2023-04-13 00:46:47 UTC
STEPS TO REPRODUCE
1. Reboot 
2. Activate window view effect

OBSERVED RESULT
KWin freezes for 25 seconds

EXPECTED RESULT
No freeze

SOFTWARE/OS VERSIONS
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 6.5

Backtrace for the freeze:

#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x1c335b0) at futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x1c335b0, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
#2  0x00007fef578aad7f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x1c335b0, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
#3  0x00007fef578ad510 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x1c33560, cond=0x1c33588) at pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=0x1c33588, mutex=0x1c33560) at pthread_cond_wait.c:618
#5  0x00007fef581111cb in QWaitConditionPrivate::wait(QDeadlineTimer) (deadline=..., this=0x1c33560) at /usr/src/debug/qt6-qtbase-6.4.3-2.fc37.x86_64/src/corelib/thread/qwaitcondition_unix.cpp:111
#6  QWaitCondition::wait(QMutex*, QDeadlineTimer) (this=this@entry=0x25d2b80, mutex=mutex@entry=0x25d2b78, deadline=...) at /usr/src/debug/qt6-qtbase-6.4.3-2.fc37.x86_64/src/corelib/thread/qwaitcondition_unix.cpp:184
#7  0x00007fef59a5d46a in QDBusPendingCallPrivate::waitForFinished() (this=0x25d2b30) at /usr/src/debug/qt6-qtbase-6.4.3-2.fc37.x86_64/src/dbus/qdbuspendingcall.cpp:203
#8  0x00007fef59a5ea65 in QDBusPendingReplyBase::argumentAt(int) const (this=this@entry=0x7ffd26575ca0, index=index@entry=0) at /usr/src/debug/qt6-qtbase-6.4.3-2.fc37.x86_64/src/dbus/qdbuspendingreply.cpp:236
#9  0x00007fef4653cd87 in QDBusPendingReply<QMap<QString, QMap<QString, QVariant> > >::argumentAt<0>() const (this=this@entry=0x7ffd26575ca0) at /usr/include/qt6/QtDBus/qdbuspendingreply.h:81
#10 0x00007fef4653d65b in QDBusPendingReply<QMap<QString, QMap<QString, QVariant> > >::value() const (this=0x7ffd26575ca0) at /usr/include/qt6/QtDBus/qdbuspendingreply.h:95
#11 Kirigami::TabletModeWatcherPrivate::TabletModeWatcherPrivate(Kirigami::TabletModeWatcher*) (this=<optimized out>, watcher=<optimized out>) at /home/nico/kde6/src/kirigami/src/libkirigami/tabletmodewatcher.cpp:64
#12 0x00007fef465379c4 in Kirigami::TabletModeWatcher::TabletModeWatcher(QObject*) (this=0x7fef46552a10 <QGlobalStatic<QtGlobalStatic::Holder<Kirigami::(anonymous namespace)::Q_QGS_privateTabletModeWatcherSelf> >::instance()::holder>, parent=<optimized out>)
    at /home/nico/kde6/src/kirigami/src/libkirigami/tabletmodewatcher.cpp:115
#13 0x00007fef46537a38 in Kirigami::TabletModeWatcherSingleton::TabletModeWatcherSingleton() (this=0x7fef46552a10 <QGlobalStatic<QtGlobalStatic::Holder<Kirigami::(anonymous namespace)::Q_QGS_privateTabletModeWatcherSelf> >::instance()::holder>)
    at /home/nico/kde6/src/kirigami/src/libkirigami/tabletmodewatcher.cpp:24
#14 Kirigami::(anonymous namespace)::Q_QGS_privateTabletModeWatcherSelf::innerFunction (pointer=0x7fef46552a10 <QGlobalStatic<QtGlobalStatic::Holder<Kirigami::(anonymous namespace)::Q_QGS_privateTabletModeWatcherSelf> >::instance()::holder>)
    at /home/nico/kde6/src/kirigami/src/libkirigami/tabletmodewatcher.cpp:30
#15 QtGlobalStatic::Holder<Kirigami::(anonymous namespace)::Q_QGS_privateTabletModeWatcherSelf>::Holder (this=0x7fef46552a10 <QGlobalStatic<QtGlobalStatic::Holder<Kirigami::(anonymous namespace)::Q_QGS_privateTabletModeWatcherSelf> >::instance()::holder>)
    at /usr/include/qt6/QtCore/qglobalstatic.h:37
#16 QGlobalStatic<QtGlobalStatic::Holder<Kirigami::(anonymous namespace)::Q_QGS_privateTabletModeWatcherSelf> >::instance () at /usr/include/qt6/QtCore/qglobalstatic.h:91
#17 QGlobalStatic<QtGlobalStatic::Holder<Kirigami::(anonymous namespace)::Q_QGS_privateTabletModeWatcherSelf> >::operator() (this=<optimized out>) at /usr/include/qt6/QtCore/qglobalstatic.h:73
#18 Kirigami::TabletModeWatcher::self() () at /home/nico/kde6/src/kirigami/src/libkirigami/tabletmodewatcher.cpp:126
#19 0x00007feee6a5d505 in Settings::Settings(QObject*) (this=0x7feee6aa6120 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_privateSettingsSelf> >::instance()::holder>, parent=<optimized out>) at /home/nico/kde6/src/kirigami/src/settings.cpp:42
#20 0x00007feee6a5db2b in SettingsSingleton::SettingsSingleton() (this=0x7feee6aa6120 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_privateSettingsSelf> >::instance()::holder>) at /home/nico/kde6/src/kirigami/src/settings.cpp:29
#21 (anonymous namespace)::Q_QGS_privateSettingsSelf::innerFunction (pointer=0x7feee6aa6120 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_privateSettingsSelf> >::instance()::holder>) at /home/nico/kde6/src/kirigami/src/settings.cpp:35
#22 QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_privateSettingsSelf>::Holder (this=0x7feee6aa6120 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_privateSettingsSelf> >::instance()::holder>) at /usr/include/qt6/QtCore/qglobalstatic.h:37
#23 QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_privateSettingsSelf> >::instance () at /usr/include/qt6/QtCore/qglobalstatic.h:91
#24 QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_privateSettingsSelf> >::operator() (this=<optimized out>) at /usr/include/qt6/QtCore/qglobalstatic.h:73
#25 Settings::self() () at /home/nico/kde6/src/kirigami/src/settings.cpp:103
#26 0x00007feee6a44acb in operator() (__closure=0x0, e=<optimized out>) at /home/nico/kde6/src/kirigami/src/kirigamiplugin.cpp:124
#27 _FUN(QQmlEngine*, QJSEngine*) () at /home/nico/kde6/src/kirigami/src/kirigamiplugin.cpp:129
#28 0x00007fef5a91a0ef in std::function<QObject* (QQmlEngine*, QJSEngine*)>::operator()(QQmlEngine*, QJSEngine*) const (__args#1=0xec1510, __args#0=0xec1510, this=<optimized out>) at /usr/include/c++/12/bits/std_function.h:587
#29 QQmlEnginePrivate::singletonInstance<QJSValue>(QQmlType const&) (this=0xf78130, type=...) at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmlengine.cpp:1699
#30 0x00007fef5aa11e7c in QQmlEnginePrivate::singletonInstance<QObject*>(QQmlType const&) (type=..., this=<optimized out>)
    at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/redhat-linux-build/include/QtQml/6.4.3/QtQml/private/../../../../../../src/qml/qml/qqmlengine_p.h:380
#31 QV4::QQmlTypeWrapper::virtualResolveLookupGetter(QV4::Object const*, QV4::ExecutionEngine*, QV4::Lookup*) (object=0x7fef257bc528, engine=0xf25fa0, lookup=0x23e5460) at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmltypewrapper.cpp:414
#32 0x00007fef5a89a196 in QV4::Moth::VME::interpret(QV4::JSTypesStackFrame*, QV4::ExecutionEngine*, char const*) (frame=0x1c335b0, frame@entry=0x7ffd265762e0, engine=0xf25fa0, code=0x7fef263ffb2c "<bP\b.c<d<eL\006.f<g<h\030\006\002")
    at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/jsruntime/qv4vme_moth.cpp:729
#33 0x00007fef5a89f9f7 in QV4::Moth::VME::exec(QV4::JSTypesStackFrame*, QV4::ExecutionEngine*) (frame=frame@entry=0x7ffd265762e0, engine=engine@entry=0xf25fa0) at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/jsruntime/qv4vme_moth.cpp:542
#34 0x00007fef5a7f413a in QV4::Function::call(QV4::Value const*, QV4::Value const*, int, QV4::ExecutionContext*) (context=<optimized out>, argc=<optimized out>, argv=0x7fef257bc548, thisObject=0x7fef257bc530, this=<optimized out>)
    at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/jsruntime/qv4function.cpp:62
#35 QV4::Function::call(QV4::Value const*, QV4::Value const*, int, QV4::ExecutionContext*) (this=<optimized out>, thisObject=thisObject@entry=0x7fef257bc500, argv=argv@entry=0x7fef257bc518, argc=<optimized out>, context=<optimized out>)
    at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/jsruntime/qv4function.cpp:44
#36 0x00007fef5a94cf9b in QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) (this=this@entry=0x2489f00, callData=callData@entry=0x7fef257bc4e8, isUndefined=isUndefined@entry=0x7ffd26576490)
    at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmljavascriptexpression.cpp:238
#37 0x00007fef5a8e0f12 in QQmlBinding::evaluate(bool*) (this=this@entry=0x2489f00, isUndefined=isUndefined@entry=0x7ffd26576490) at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmlbinding.cpp:187
#38 0x00007fef5a8e7ca0 in QQmlNonbindingBinding::doUpdate(QQmlJavaScriptExpression::DeleteWatcher const&, QFlags<QQmlPropertyData::WriteFlag>, QV4::Scope&) (this=0x2489f00, watcher=..., flags=..., scope=...)
    at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmlbinding.cpp:247
#39 0x00007fef5a8e3961 in QQmlBinding::update(QFlags<QQmlPropertyData::WriteFlag>) (this=0x2489f00, flags=...) at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmlbinding.cpp:163
#40 0x00007fef5a976eae in QQmlObjectCreator::finalize(QQmlInstantiationInterrupt&) (this=0x24993a0, interrupt=...) at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmlobjectcreator.cpp:1391
#41 0x00007fef5a94882a in QQmlIncubatorPrivate::incubate(QQmlInstantiationInterrupt&) (this=this@entry=0x2455270, i=...) at /usr/include/qt6/QtCore/qscopedpointer.h:89
#42 0x00007fef5a949685 in QQmlEnginePrivate::incubate(QQmlIncubator&, QQmlRefPointer<QQmlContextData> const&) (this=0xf78130, i=<optimized out>, forContext=<optimized out>) at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmlincubator.cpp:54
#43 0x00007fef5a8fd024 in QQmlComponent::create(QQmlIncubator&, QQmlContext*, QQmlContext*) (this=<optimized out>, incubator=..., context=<optimized out>, forContext=<optimized out>)
    at /usr/src/debug/qt6-qtdeclarative-6.4.3-1.fc37.x86_64/src/qml/qml/qqmlcomponent.cpp:1219
#44 0x00007fef5bdd8fc2 in KWin::QuickSceneEffect::addScreen(KWin::EffectScreen*) (this=this@entry=0xb35c00, screen=<optimized out>) at /home/nico/kde6/src/kwin/src/libkwineffects/kwinquickeffect.cpp:425
#45 0x00007fef5bdd99b7 in KWin::QuickSceneEffect::startInternal() (this=0xb35c00) at /home/nico/kde6/src/kwin/src/libkwineffects/kwinquickeffect.cpp:457
#46 0x00007fef5b90fda2 in std::function<void (double)>::operator()(double) const (__args#0=<optimized out>, this=0x17fd980) at /usr/include/c++/12/bits/std_function.h:591
#47 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<double>, void, std::function<void (double)> >::call(std::function<void (double)>&, void**) (arg=<optimized out>, f=...) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:127
#48 QtPrivate::Functor<std::function<void (double)>, 1>::call<QtPrivate::List<double>, void>(std::function<void (double)>&, void*, void**) (arg=<optimized out>, f=...) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:241

TL;DR effect calls Kirigami.Settings.tabletMode, that makes a DBus call to KWin -> freeze
Comment 1 Nicolas Fella 2023-04-13 00:47:45 UTC
We've had a similar problem in Breeze/xdg-desktop-portla-kde, see https://invent.kde.org/plasma/breeze/-/merge_requests/299
Comment 2 Bug Janitor Service 2023-04-13 06:34:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3967
Comment 3 Nate Graham 2023-06-13 16:09:00 UTC
Looks like this also affects the new Thumbnail Grid window switcher since it queries Kirigami.Settings.tabletMode to determine whether the close buttons should be shown when not hovered.
Comment 4 Nate Graham 2023-06-23 14:55:19 UTC
Fixed by Harald Sitter with https://invent.kde.org/frameworks/kirigami/-/commit/ec99c54fed450004dee02ca7ab5a9e0ccee5277b in Frameworks 6.0.