Bug 468880

Summary: Random kwin freezes
Product: [Plasma] kwin Reporter: Pyroman <retratserif>
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: nate
Priority: NOR    
Version: 5.27.5   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Pyroman 2023-04-23 21:06:18 UTC
SUMMARY
***
After upgrading to 5.27 I experience random kwin_x11 freezes multiple times a day. It hapens on my two different laptops with different cpu and gpu, so it's not hardware related.
Content of last active window may remain interactive but I can not switch to other windows.
I have to switch into tty terminal with ctrl+alt+f2, kill kwin with pkill -9 -f kwin  (without -9 it doesn terminate) and then return back to desktop session (kwin restarts automatically).

I have no exact way to reproduce, it just happens randomly. But on both machines apps I often use are Firefox, Kate, Krusader, Thunderbird, Konsole, Discord.

I've recorded a strace log if it's helpful https://pastebin.com/LqRmaaSd When wreezed, strace stops printing anything. These are last 30 lines after freeze.

***
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 5.27 (22.04 jammy)
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.18
Comment 1 Pyroman 2023-05-23 03:03:27 UTC
Still happens on 5.27.5

KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.19
Graphics Platform: X11

I've found a discussion on reddit about same or similar problem https://www.reddit.com/r/kde/comments/y8t97a/kde_hangs_on_quick_alttab_help_please/
Comment 2 Pyroman 2023-05-23 03:34:52 UTC
By the way, in my case it happens during alt+tab too. I'm not shure if it's caused directly by alt+tab though.
Comment 3 Vlad Zahorodnii 2023-05-26 10:26:57 UTC
If kwin is stuck, we need a backtrace. Without it, the bug report is inactionable. Can you get the backtrace of kwin when it's frozen?
Comment 4 Pyroman 2023-05-29 06:41:16 UTC
Ok, I will try to get backtrace when it happens again on holidays.
Comment 5 Pyroman 2023-05-31 02:54:22 UTC
Ok, it already happened multiple times, here are two examples:

#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55c10193eec4) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x55c10193eec4) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55c10193eec4, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007fb395559ac1 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55c10193ee70, cond=0x55c10193ee98) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=0x55c10193ee98, mutex=0x55c10193ee70) at ./nptl/pthread_cond_wait.c:627
#5  0x00007fb39691876b in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fb397b9a14a in ?? () from /lib/x86_64-linux-gnu/libQt5Quick.so.5
#7  0x00007fb397c08f6f in QQuickWindow::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Quick.so.5
#8  0x00007fb395ce0793 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007fb396b0018a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007fb396ed9904 in QPlatformWindow::windowEvent(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#11 0x00007fb395ce79ba in QApplication::notify(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007fb396b0018a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007fb396b58f1b in QTimerInfoList::activateTimers() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007fb396b59864 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007fb393edbd3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007fb393f306c8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007fb393ed93e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007fb396b59be8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007fb396afeaab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007fb396b07044 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x000055c100894c57 in main (argc=<optimized out>, argv=<optimized out>) at ./src/main_x11.cpp:447


Second:

#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55baf2124184) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x55baf2124184) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55baf2124184, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007f220879aac1 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55baf2124130, cond=0x55baf2124158) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=0x55baf2124158, mutex=0x55baf2124130) at ./nptl/pthread_cond_wait.c:627
#5  0x00007f2209b5976b in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f220adda87b in ?? () from /lib/x86_64-linux-gnu/libQt5Quick.so.5
#7  0x00007f220ae49e53 in QQuickWindow::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Quick.so.5
#8  0x00007f2208f21793 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007f2209d4118a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007f220a136dc1 in QWindowPrivate::destroy() () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#11 0x00007f220b58787f in KWin::TabBox::TabBoxHandler::hide (abort=false, this=0x55baf1daefe0) at ./src/tabbox/tabboxhandler.cpp:433
#12 KWin::TabBox::TabBox::hide (this=this@entry=0x55baf1cf07a0, abort=abort@entry=false) at ./src/tabbox/tabbox.cpp:727
#13 0x00007f220b587be5 in KWin::TabBox::TabBox::close (this=this@entry=0x55baf1cf07a0, abort=abort@entry=false) at ./src/tabbox/tabbox.cpp:1429
#14 0x00007f220b587f5a in KWin::TabBox::TabBox::accept (this=0x55baf1cf07a0, closeTabBox=<optimized out>) at ./src/tabbox/tabbox.cpp:1440
#15 0x00007f220b588792 in KWin::TabBox::TabBox::modifiersReleased (this=0x55baf1cf07a0) at ./src/tabbox/tabbox.cpp:1458
#16 0x00007f220b58c9eb in KWin::TabBox::X11Filter::keyRelease (this=<optimized out>, event=0x7f21f401e2d0) at ./src/tabbox/x11_filter.cpp:144
#17 KWin::TabBox::X11Filter::event (this=<optimized out>, event=0x7f21f401e2d0) at ./src/tabbox/x11_filter.cpp:62
#18 0x00007f220b3a9804 in KWin::Application::dispatchEvent (this=<optimized out>, event=0x7f21f401e2d0) at ./src/main.cpp:483
#19 0x00007f2209d3e557 in QAbstractEventDispatcher::filterNativeEvent(QByteArray const&, void*, long*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007f2203fc4575 in QXcbConnection::handleXcbEvent(xcb_generic_event_t*) () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#21 0x00007f2203fc5cb6 in QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#22 0x00007f2203fecde7 in ?? () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#23 0x00007f220711bd3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007f22071706c8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007f22071193e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007f2209d9abe8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007f2209d3faab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#28 0x00007f2209d48044 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x000055baf0183c57 in main (argc=<optimized out>, argv=<optimized out>) at ./src/main_x11.cpp:447
Comment 6 Pyroman 2023-05-31 17:26:34 UTC
Another example, looks a bit different. It occurred while screen was locked. I had to restart kwin to be able to input password to unlock.

#0  0x00007f97e4806d7f in __GI___poll (fds=0x7fff9835eda8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f97e4d7e7e2 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f97e4d7eb20 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f97e4d858e6 in xcb_send_request_with_fds64 () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#4  0x00007f97e4d85bdd in xcb_send_request () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#5  0x00007f97e4d8ba2f in xcb_put_image () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#6  0x00007f97e746ad46 in operator() (geo=..., __closure=<synthetic pointer>) at ./src/x11window.cpp:198
#7  operator() (geo=..., __closure=<synthetic pointer>) at ./src/x11window.cpp:193
#8  KWin::X11DecorationRenderer::render (this=this@entry=0x5613490f20b0, region=...) at ./src/x11window.cpp:205
#9  0x00007f97e746a52b in KWin::X11DecorationRenderer::update (this=0x5613490f20b0) at ./src/x11window.cpp:168
#10 0x00007f97e5d601e4 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f97e5d6426e in QTimer::timeout(QTimer::QPrivateSignal) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007f97e5d55b0f in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007f97e4f08793 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007f97e5d2818a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007f97e5d80f1b in QTimerInfoList::activateTimers() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007f97e5d8181c in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007f97e3103d3b in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007f97e31586c8 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007f97e31013e3 in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007f97e5d81be8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007f97e5d26aab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007f97e5d2f044 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x0000561347b9bc57 in main (argc=<optimized out>, argv=<optimized out>) at ./src/main_x11.cpp:447
Comment 7 Pyroman 2023-08-06 18:37:09 UTC
After updating to 5.27.6 I haven't encountered this problem anymore, so closing it. Thank you anyway.