Bug 469497 - Kwin freezes when I try to quickly switch windows twice
Summary: Kwin freezes when I try to quickly switch windows twice
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.27.2
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-08 16:11 UTC by Jiri Palecek
Modified: 2023-08-03 07:29 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Palecek 2023-05-08 16:11:20 UTC
SUMMARY

Sometimes when I press Alt-Tab twice quickly in succession kwin, and therefore all desktop freezes. This is recoverable by killing kwin.

The backtrace when the freeze happened is:

#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55a42bee68d4) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55a42bee68d4, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87
#2  0x00007fe643aa4d9b in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55a42bee68d4, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007fe643aa73f8 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55a42bee6880, cond=0x55a42bee68a8) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=0x55a42bee68a8, mutex=0x55a42bee6880) at ./nptl/pthread_cond_wait.c:618
#5  0x00007fe6448d1a2b in QWaitConditionPrivate::wait(QDeadlineTimer) (deadline=..., this=0x55a42bee6880) at thread/qwaitcondition_unix.cpp:146
#6  QWaitCondition::wait(QMutex*, QDeadlineTimer) (this=<optimized out>, mutex=0x55a42bf61078, deadline=...) at thread/qwaitcondition_unix.cpp:225
#7  0x00007fe64620bd58 in QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window*, bool) (this=0x55a42b174710, w=0x55a42be30f80, inExpose=<optimized out>) at scenegraph/qsgthreadedrenderloop.cpp:1603
#8  0x00007fe646276e20 in QQuickWindow::event(QEvent*) (this=0x55a42beda340, e=0x7ffd9db8e490) at items/qquickwindow.cpp:1863
#9  0x00007fe644162fae in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55a42beda340, e=0x7ffd9db8e490) at kernel/qapplication.cpp:3640
#10 0x00007fe644ab16f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55a42beda340, event=0x7ffd9db8e490) at kernel/qcoreapplication.cpp:1064
#11 0x00007fe644ab18be in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#12 0x00007fe644f2c4b3 in QPlatformWindow::deliverUpdateRequest() (this=<optimized out>) at kernel/qplatformwindow.cpp:796
#13 QPlatformWindow::windowEvent(QEvent*) (this=<optimized out>, event=<optimized out>) at kernel/qplatformwindow.cpp:476
#14 0x00007fe64416a1f9 in QApplication::notify(QObject*, QEvent*) (this=0x7ffd9db8ea10, receiver=0x55a42beda340, e=0x7ffd9db8e6f0) at kernel/qapplication.cpp:2882
#15 0x00007fe644ab16f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55a42beda340, event=0x7ffd9db8e6f0) at kernel/qcoreapplication.cpp:1064
#16 0x00007fe644ab18be in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#17 0x00007fe644b08c31 in QTimerInfoList::activateTimers() (this=0x55a42a60fa60) at kernel/qtimerinfo_unix.cpp:643
#18 0x00007fe644b094c4 in timerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:183
#19 0x00007fe6428627a9 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007fe642862a38 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007fe642862acc in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0

This indicates IMHO that the problem is in QSGThreadedRenderLoop, because it is waiting on a condition variable it uses to wait for processing of the individual events. However, I'm not quite sure what to do about it.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Comment 1 Bug Janitor Service 2023-05-08 16:34:12 UTC
Thank you for the bug report!

Please note that Plasma 5.26.90 will not be supported for much longer by KDE; supported versions are 5.27, and 5.27 or newer.

Please upgrade to the latest version as soon as your distribution makes it available to you. Plasma is a fast-moving project, and bugs in one version are often fixed in the next one.
Comment 2 Roland Pallai 2023-08-03 07:29:15 UTC
I can confirm this on Plasma 5.27.6 + Qt 5.15.10 on X11 with Intel® HD Graphics 4600, Fedora 38. There is nothing interesting in the logs.

What kind of GPU do you have?


#0  0x00007fb2da4ab1d9 in __futex_abstimed_wait_common () at /lib64/libc.so.6
#1  0x00007fb2da4adb79 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libc.so.6
#2  0x00007fb2db4fb677 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /lib64/libQt5Core.so.5
#3  0x00007fb2dca4fed8 in QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window*, bool) () at /lib64/libQt5Quick.so.5
#4  0x00007fb2dcac1863 in QQuickWindow::event(QEvent*) () at /lib64/libQt5Quick.so.5
#5  0x00007fb2dabaeb75 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#6  0x00007fb2db6b4188 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#7  0x00007fb2dbb5c73c in QPlatformWindow::windowEvent(QEvent*) () at /lib64/libQt5Gui.so.5
#8  0x00007fb2dabb62c1 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#9  0x00007fb2db6b4188 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#10 0x00007fb2db705a7b in QTimerInfoList::activateTimers() () at /lib64/libQt5Core.so.5
#11 0x00007fb2db7063b1 in idleTimerSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5Core.so.5
#12 0x00007fb2d8f1348c in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#13 0x00007fb2d8f71638 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#14 0x00007fb2d8f10b13 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#15 0x00007fb2db706729 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#16 0x00007fb2db6b2b4b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#17 0x00007fb2db6baddb in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#18 0x0000561279988c01 in main ()