Ungraceful behaviour when Xwayland dies
If I kill Xwayland with SIGINT in a Plasma Wayland session, I observe the following:
- Xwayland windows stay where they are, they appear in the tabbox and window decorations can be interacted with.
- Kwin consumes 100% CPU, although it is not unresponsive.
If I kill Xwayland with SIGKILL or SIGABRT, Kwin crashes:
Backtrace
#0 0x0000000000000020 in ()
#1 0x00007fb9ae830160 in KWin::FocusChain::isUsableFocusCandidate(KWin::AbstractClient*, KWin::AbstractClient*) const (this=0x5564f8a439a0, c=0x5564f8bf4340, prev=0x5564f89faf00) at /usr/src/debug/kwin/focuschain.cpp:217
#2 0x00007fb9ae8303e3 in KWin::FocusChain::nextForDesktop(KWin::AbstractClient*, unsigned int) const (this=0x5564f8a439a0, reference=reference@entry=0x5564f89faf00, desktop=<optimized out>, desktop@entry=1) at /usr/src/debug/kwin/focuschain.cpp:231
#3 0x00007fb9ae7cdcca in KWin::Workspace::activateNextClient(KWin::AbstractClient*) (this=0x5564f846fec0, c=<optimized out>) at /usr/src/debug/kwin/focuschain.h:224
#4 0x00007fb9ae919e58 in operator() (c=0x5564f89faf00, __closure=0x5564f8abe930) at /usr/src/debug/kwin/workspace.cpp:379
#5 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KWin::XdgShellClient*>, void, KWin::Workspace::init()::<lambda(KWin::XdgShellClient*)> >::call (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#6 QtPrivate::Functor<KWin::Workspace::init()::<lambda(KWin::XdgShellClient*)>, 1>::call<QtPrivate::List<KWin::XdgShellClient*>, void> (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#7 QtPrivate::QFunctorSlotObject<KWin::Workspace::init()::<lambda(KWin::XdgShellClient*)>, 1, QtPrivate::List<KWin::XdgShellClient*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x5564f8abe920, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#8 0x00007fb9ad94ed56 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffc0d42f150, r=0x5564f846fec0, this=0x5564f8abe920) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#9 doActivate<false>(QObject*, int, void**) (sender=0x5564f80ad740, signal_index=4, argv=argv@entry=0x7ffc0d42f150) at kernel/qobject.cpp:3870
#10 0x00007fb9ad948b30 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7fb9aea69840 <KWin::WaylandServer::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc0d42f150) at kernel/qobject.cpp:3930
#11 0x00007fb9ae797fc3 in KWin::WaylandServer::shellClientRemoved(KWin::XdgShellClient*) (this=<optimized out>, _t1=<optimized out>, _t1@entry=0x5564f89faf00) at /usr/src/debug/build/kwin_autogen/EWIEGA46WW/moc_wayland_server.cpp:189
#12 0x00007fb9ae907a92 in KWin::WaylandServer::removeClient(KWin::XdgShellClient*) (this=<optimized out>, c=c@entry=0x5564f89faf00) at /usr/src/debug/kwin/wayland_server.cpp:652
#13 0x00007fb9ae94edfd in KWin::XdgShellClient::destroyClient() (this=0x5564f89faf00) at /usr/src/debug/kwin/wayland_server.h:298
#14 0x00007fb9ae91f895 in KWin::Workspace::~Workspace() (this=0x5564f846fec0, __in_chrg=<optimized out>) at /usr/src/debug/kwin/workspace.cpp:574
#15 0x00007fb9ae92032a in KWin::Workspace::~Workspace() (this=0x5564f846fec0, __in_chrg=<optimized out>) at /usr/src/debug/kwin/workspace.cpp:543
#16 0x00005564f742d173 in KWin::ApplicationWayland::~ApplicationWayland() (this=0x7ffc0d42f500, __in_chrg=<optimized out>) at /usr/src/debug/kwin/main_wayland.cpp:136
#17 0x00005564f7427b7b in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kwin/main_wayland.cpp:704
Obviously, people don't just kill Xwayland during normal usage, but Xwayland may occasionally die on its own.
For instance, there was a case where I killed an Xwayland client from the 'unresponsive applicaiton' dialog, and Xwayland crashed for whatever reason. Kwin became stuck in poll
:
Backtrace
#0 0x00007f2c49bab05f in poll () at /usr/lib/libc.so.6
#1 0x00007f2c49e8263b in poll (__timeout=-1, __nfds=1, __fds=0x7ffe96d18698) at /usr/include/bits/poll2.h:46
#2 _xcb_conn_wait (c=c@entry=0x560983a28580, cond=cond@entry=0x7ffe96d187b0, vector=vector@entry=0x0, count=count@entry=0x0) at xcb_conn.c:480
#3 0x00007f2c49e8408f in wait_for_reply (c=c@entry=0x560983a28580, request=19642, e=e@entry=0x0) at xcb_in.c:516
#4 0x00007f2c49e841a2 in xcb_wait_for_reply (c=0x560983a28580, request=19642, e=e@entry=0x0) at xcb_in.c:532
#5 0x00007f2c49e89e86 in xcb_query_tree_reply (c=<optimized out>, cookie=..., e=e@entry=0x0) at xproto.c:3159
#6 0x00007f2c4b05bf10 in KWin::Xcb::AbstractWrapper<KWin::Xcb::TreeData>::getReply() (this=0x7ffe96d18880) at /usr/src/debug/kwin/libkwineffects/kwinglobals.h:160
#7 KWin::Xcb::AbstractWrapper<KWin::Xcb::TreeData>::getReply() (this=0x7ffe96d18880) at /usr/src/debug/kwin/xcbutils.h:330
#8 KWin::Xcb::AbstractWrapper<KWin::Xcb::TreeData>::isNull() (this=0x7ffe96d18880) at /usr/src/debug/kwin/xcbutils.h:265
#9 KWin::Xcb::Tree::parent() (this=0x7ffe96d18880) at /usr/src/debug/kwin/xcbutils.h:592
#10 KWin::X11Client::unmapNotifyEvent(xcb_unmap_notify_event_t*) (this=0x560983cafb70, e=<optimized out>) at /usr/src/debug/kwin/events.cpp:648
#11 0x00007f2c4b05d9e4 in KWin::X11Client::windowEvent(xcb_generic_event_t*) (this=0x560983cafb70, e=0x560984233da0) at /usr/src/debug/kwin/events.cpp:494
#12 0x00007f2c4b05e225 in KWin::Workspace::workspaceEvent(xcb_generic_event_t*) (this=0x5609834824a0, e=0x560984233da0) at /usr/src/debug/kwin/events.cpp:262
#13 0x00007f2c4a147707 in QAbstractEventDispatcher::filterNativeEvent(QByteArray const&, void*, long*) (this=<optimized out>, eventType=..., message=message@entry=0x560984233da0, result=result@entry=0x7ffe96d18ad8) at kernel/qabstracteventdispatcher.cpp:488
#14 0x0000560982a1ad83 in operator() (__closure=<optimized out>) at /usr/src/debug/kwin/xwl/xwayland.cpp:229
#15 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::Xwl::Xwayland::continueStartupWithX()::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#16 QtPrivate::Functor<KWin::Xwl::Xwayland::continueStartupWithX()::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#17 QtPrivate::QFunctorSlotObject<KWin::Xwl::Xwayland::continueStartupWithX()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x7f2c18005290, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#18 0x00007f2c4a17fd56 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffe96d18c10, r=0x560983a21070, this=0x7f2c18005290) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#19 doActivate<false>(QObject*, int, void**) (sender=0x56098329f0d0, signal_index=3, argv=argv@entry=0x7ffe96d18c10) at kernel/qobject.cpp:3870
#20 0x00007f2c4a179b30 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x56098329f0d0, m=m@entry=0x7f2c4a3d4200 <QSocketNotifier::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffe96d18c10) at kernel/qobject.cpp:3930
#21 0x00007f2c4a1832e2 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) (this=this@entry=0x56098329f0d0, _t1=<optimized out>, _t2=...) at .moc/moc_qsocketnotifier.cpp:141
#22 0x00007f2c4a183672 in QSocketNotifier::event(QEvent*) (this=0x56098329f0d0, e=0x7ffe96d18d10) at kernel/qsocketnotifier.cpp:266
#23 0x00007f2c4a537652 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x56098329f0d0, e=0x7ffe96d18d10) at kernel/qapplication.cpp:3685
#24 0x00007f2c4a14a2d2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x56098329f0d0, event=0x7ffe96d18d10) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:153
#25 0x00007f2c4a19e3f4 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() (this=0x560983108590) at kernel/qeventdispatcher_unix.cpp:304
#26 0x00007f2c4a19e875 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:509
#27 0x00007f2c43a904de in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/qt/plugins/platforms/KWinQpaPlugin.so
#28 0x00007f2c4a148c0c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffe96d18ea0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#29 0x00007f2c4a1510a6 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#30 0x0000560982a01a3f in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kwin/main_wayland.cpp:704
Software versions:
linux 5.6.13
mesa 20.0.7
Plasma 5.18.5
KF5 5.70.0
Qt 5.14.2
kwinft 5.18.0.beta.0.r99.g916dd1220
kscreenlocker v5.17.90.r20.gf2c89ed
libkscreen r1525.fe0bad4
wrapland 0.518.0.beta.0.r231.g9214ac1
libwayland 1.18.0
wayland-egl 18.1.0
xwayland 1.20.8
libxkbcommon 0.10.0
libinput 1.15.5
libdrm 2.4.101
libxcb 1.14
libx11 1.6.9
Edited by magiblot