Bug 450679 - Qt applications in Kwin Wayland session hang when monitor is turned off / goes to sleep.
Summary: Qt applications in Kwin Wayland session hang when monitor is turned off / goe...
Status: RESOLVED DUPLICATE of bug 448275
Alias: None
Product: kwin
Classification: Unclassified
Component: wayland-generic (show other bugs)
Version: 5.24.4
Platform: Debian testing Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-22 00:18 UTC by Shmerl
Modified: 2022-05-12 16:56 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shmerl 2022-02-22 00:18:10 UTC
There is a persistent bug that causes Wayland session to hang when monitor is explicitly turned off or goes to sleep. After turning it back on it's possible to go into tty and check what's going on, so I collected some gdb logs.

When testing (turning it off), the only shown window on the desktop was kwalletd5 password prompt. What can be observed at that moment is that kwin_wayland and kwalletd5 both eat a lot of CPU:

kwin_wayland backtrace:

#0  0x00007f100a14fe6d in recvmsg () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007f100aebc575 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f100aebd068 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#3  0x000055c306f54300 in KWin::Xwl::Xwayland::dispatchEvents (this=0x55c307b20b60) at ./src/xwl/xwayland.cpp:302
#4  0x00007f100a575183 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f100a593666 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x000055c30703851d in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#7  0x00007f100a53d52b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f100a545800 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x000055c306f39f73 in main (argc=<optimized out>, argv=<optimized out>) at ./src/main_wayland.cpp:727
quit
Detaching from program: /usr/bin/kwin_wayland, process 1580
[Inferior 1 (process 1580) detached]

-------------------------

kwalletd5 backtrace:

#0  0x00007f18e6d39d61 in ?? () from /lib/x86_64-linux-gnu/libfontconfig.so.1
#1  0x00007f18e6d322e2 in ?? () from /lib/x86_64-linux-gnu/libfontconfig.so.1
#2  0x00007f18e6d32615 in ?? () from /lib/x86_64-linux-gnu/libfontconfig.so.1
#3  0x00007f18e6d329b0 in ?? () from /lib/x86_64-linux-gnu/libfontconfig.so.1
#4  0x00007f18e6d32ac9 in ?? () from /lib/x86_64-linux-gnu/libfontconfig.so.1
#5  0x00007f18e6d338c2 in FcFontMatch () from /lib/x86_64-linux-gnu/libfontconfig.so.1
#6  0x00007f18e8ecf0b6 in ?? () from /lib/x86_64-linux-gnu/libQt5WaylandClient.so.5
#7  0x00007f18e8ecf737 in ?? () from /lib/x86_64-linux-gnu/libQt5WaylandClient.so.5
#8  0x00007f18eaefafd4 in ?? () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#9  0x00007f18eaefb9e3 in QFontDatabase::findFont(QFontDef const&, int) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#10 0x00007f18eaee31ba in QFontEngineMulti::loadEngine(int) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#11 0x00007f18eaee3f07 in QFontEngineMulti::ensureEngineAt(int) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#12 0x00007f18eaee465b in QFontEngineMulti::stringToCMap(QChar const*, int, QGlyphLayout*, int*, QFlags<QFontEngine::ShaperFlag>) const () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#13 0x00007f18eaf0680a in QTextEngine::shapeText(int) const () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#14 0x00007f18eaf187a9 in QTextLine::layout_helper(int) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#15 0x00007f18eaf60005 in ?? () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#16 0x00007f18eaf61405 in ?? () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#17 0x00007f18eaf69170 in ?? () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#18 0x00007f18eaf6975a in ?? () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#19 0x00007f18eaf69d80 in QTextDocumentLayout::doLayout(int, int, int) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#20 0x00007f18eaf6b3b9 in QTextDocumentLayout::documentChanged(int, int, int) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#21 0x00007f18eb645e8b in QLabel::changeEvent(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f18eb548486 in QWidget::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007f18eb5f490e in QFrame::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007f18eb5066bf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007f18ea82ab1a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007f18eb5397d5 in QWidgetPrivate::updateFont(QFont const&) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007f18eb548940 in QWidget::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007f18eb5f490e in QFrame::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#29 0x00007f18eb5066bf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#30 0x00007f18ea82ab1a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00007f18eb561186 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007f18eb5611b6 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#33 0x00007f18eb56127e in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#34 0x00007f18ea8611b8 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007f18eae1439f in QWindow::screenChanged(QScreen*) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#36 0x00007f18eae14bbd in QWindowPrivate::emitScreenChangedRecursion(QScreen*) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#37 0x00007f18eae3a64c in QScreen::~QScreen() () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#38 0x00007f18eae3a739 in QScreen::~QScreen() () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#39 0x00007f18eade65f7 in QWindowSystemInterface::handleScreenRemoved(QPlatformScreen*) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#40 0x00007f18e8ea949d in QtWaylandClient::QWaylandDisplay::registry_global_remove(unsigned int) () from /lib/x86_64-linux-gnu/libQt5WaylandClient.so.5
#41 0x00007f18e6cc67ea in ?? () from /lib/x86_64-linux-gnu/libffi.so.8
#42 0x00007f18e6cc5923 in ?? () from /lib/x86_64-linux-gnu/libffi.so.8
#43 0x00007f18e8e2a661 in ?? () from /lib/x86_64-linux-gnu/libwayland-client.so.0
#44 0x00007f18e8e26a0a in ?? () from /lib/x86_64-linux-gnu/libwayland-client.so.0
#45 0x00007f18e8e2832c in wl_display_dispatch_queue_pending () from /lib/x86_64-linux-gnu/libwayland-client.so.0
#46 0x00007f18e8ea7de3 in QtWaylandClient::QWaylandDisplay::flushRequests() () from /lib/x86_64-linux-gnu/libQt5WaylandClient.so.5
#47 0x00007f18ea8611b8 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#48 0x00007f18ea86454f in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#49 0x00007f18ea864d4b in QSocketNotifier::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#50 0x00007f18eb5066bf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#51 0x00007f18ea82ab1a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#52 0x00007f18ea882d0d in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#53 0x00007f18e8fe3cdb in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#54 0x00007f18e8fe3f88 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#55 0x00007f18e8fe403f in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#56 0x00007f18ea882154 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#57 0x00007f18ea82952b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#58 0x00007f18eb70fb3a in QDialog::exec() () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#59 0x0000563a7386d458 in ?? ()
#60 0x0000563a7386fb5d in ?? ()
#61 0x00007f18ea85712e in QObject::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#62 0x00007f18eb5066bf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#63 0x00007f18ea82ab1a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#64 0x00007f18ea82db67 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#65 0x00007f18ea882ad3 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#66 0x00007f18e8fe3cdb in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#67 0x00007f18e8fe3f88 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#68 0x00007f18e8fe403f in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#69 0x00007f18ea882154 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#70 0x00007f18ea82952b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#71 0x00007f18ea831800 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#72 0x0000563a7386185b in ?? ()
#73 0x00007f18ea1a17fd in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#74 0x0000563a73861c1a in ?? ()
quit
Detaching from program: /usr/bin/kwalletd5, process 1296
[Inferior 1 (process 1296) detached]
Comment 1 Shmerl 2022-02-22 00:20:54 UTC
Some additional details:

Mouse cursor is movable in that hang up session. So it's not some hard hang like GPU one. Even the password prompt window can be moved. But keyboard input in it doesn't work. Switching to virtual terminal works.
Comment 2 maringrly69 2022-02-28 00:24:52 UTC
Can comment that this still persists in 5.24.2
Comment 3 Shmerl 2022-03-09 00:49:03 UTC
Still happens in 5.24.3.

After the hang the desktop is sometimes responsive (like plasmashell is operational). But part of the open windows are frozen.
Comment 4 Linus Dierheimer 2022-03-09 09:53:14 UTC
Can confirm for latest Arch, full KDE patch collection applied.
Comment 5 Shmerl 2022-04-19 22:28:26 UTC
Some additional details on this. I ran a few tests with Plasma 5.24.4 in the Wayland session, and observed the following:

1. When monitor is turned off and turned back on, session doesn't die, but all Qt application windows do. Killing them restores session to normal (pasmashell is OK).
2. GTK applications are not affected! They work normally.

So may be it's some Qt specific bug?

My current config:

Frameworks: 5.93.0
Qt: 5.15.2
Comment 6 Shmerl 2022-05-11 20:22:30 UTC
It's probably a duplicate of bug #448275.
Comment 7 Nate Graham 2022-05-12 16:56:53 UTC
Yep, looks like it. Nice catch.

*** This bug has been marked as a duplicate of bug 448275 ***