Bug 427688 - killing Xwayland freezes entire system
Summary: killing Xwayland freezes entire system
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.20.1
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-14 12:39 UTC by smit
Modified: 2022-01-28 11:28 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments
output of script command (40.62 KB, text/plain)
2020-10-21 19:31 UTC, smit
Details

Note You need to log in before you can comment on or make changes to this bug.
Description smit 2020-10-14 12:39:19 UTC
According to https://kde.org/announcements/plasma-5.20.0 whole desktop no longer crashes even if XWayland does. So if I kill XWayland to simulate random crash, It should just restart Xwayland instead of crashing entire desktop. But when I send KILL signal to Xwayland process from Ksysguard, The entire session crashes.

STEPS TO REPRODUCE
1. start plasma with wayland.

I tried with both GDM and following command on tty:-

QT_QPA_PLATFORM=wayland GDK_BACKEND=wayland XDG_SESSION_TYPE=wayland dbus-run-session startplasma-wayland

2. send KILL signal to Xwayland process

OBSERVED RESULT

entire plasma desktop crashes 

EXPECTED RESULT

Xwayland restarts

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.0
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION

GPU: Intel UHD Graphics 620
Kernel: 5.8.12-zen1-1-zen
Comment 1 Vlad Zahorodnii 2020-10-14 12:52:50 UTC
On my machine, kwin restarts Xwayland if it crashes. Can I have the log output of kwin_wayland?
Comment 2 Vlad Zahorodnii 2020-10-14 12:53:38 UTC
Also, it would be very helpful if you could provide a backtrace of the crash. (you would need to ssh from another computer to get it)
Comment 3 Vlad Zahorodnii 2020-10-14 12:55:33 UTC
Okay, I'm able to reproduce this crash.
Comment 4 smit 2020-10-14 13:50:39 UTC
(In reply to Vlad Zahorodnii from comment #3)
> Okay, I'm able to reproduce this crash.

I guess I don't need to provide any logs then, or do I ?
Comment 5 Bug Janitor Service 2020-10-14 15:26:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/348
Comment 6 Vlad Zahorodnii 2020-10-14 15:30:17 UTC
(In reply to smit from comment #4)
> (In reply to Vlad Zahorodnii from comment #3)
> > Okay, I'm able to reproduce this crash.
> 
> I guess I don't need to provide any logs then, or do I ?

No, you don't
Comment 7 Vlad Zahorodnii 2020-10-14 16:17:56 UTC
Git commit 2093820aba4bbb26130b2b6d788b73584a5a6ebd by Vlad Zahorodnii.
Committed on 14/10/2020 at 16:17.
Pushed by vladz into branch 'master'.

xwayland: Avoid creating a tree query on crash

If Xwayland has crashed, the Workspace will block stacking order updates
and start destroying all X11 clients.

Once stacking order updates are unblocked, the Workspace will mark the X
stacking order as dirty and create a new Xcb::Tree object.

We don't want to create that Xcb::Tree object because accessing it
after the XCB connection has been shut down will lead to a crash.
FIXED-IN: 5.20.1

M  +7    -0    autotests/integration/xwaylandserver_crash_test.cpp
M  +7    -0    autotests/integration/xwaylandserver_restart_test.cpp
M  +11   -0    main.h
M  +1    -1    workspace.cpp
M  +4    -0    xwl/xwayland.cpp

https://invent.kde.org/plasma/kwin/commit/2093820aba4bbb26130b2b6d788b73584a5a6ebd
Comment 8 Vlad Zahorodnii 2020-10-14 16:18:24 UTC
Git commit 0109bdbba9bfef93134e4d2b8e4d4ead2dde84b4 by Vlad Zahorodnii.
Committed on 14/10/2020 at 16:18.
Pushed by vladz into branch 'Plasma/5.20'.

xwayland: Avoid creating a tree query on crash

If Xwayland has crashed, the Workspace will block stacking order updates
and start destroying all X11 clients.

Once stacking order updates are unblocked, the Workspace will mark the X
stacking order as dirty and create a new Xcb::Tree object.

We don't want to create that Xcb::Tree object because accessing it
after the XCB connection has been shut down will lead to a crash.
FIXED-IN: 5.20.1


(cherry picked from commit 2093820aba4bbb26130b2b6d788b73584a5a6ebd)

M  +7    -0    autotests/integration/xwaylandserver_crash_test.cpp
M  +7    -0    autotests/integration/xwaylandserver_restart_test.cpp
M  +11   -0    main.h
M  +1    -1    workspace.cpp
M  +4    -0    xwl/xwayland.cpp

https://invent.kde.org/plasma/kwin/commit/0109bdbba9bfef93134e4d2b8e4d4ead2dde84b4
Comment 9 smit 2020-10-21 19:31:17 UTC
Created attachment 132617 [details]
output of script command
Comment 10 smit 2020-10-21 19:34:51 UTC
hi,
I am still able to crash kde by killing Xwayland with startplasma-wayland and gdm. I don't have second machine so I can't do ssh stuff so I used script command on tty. I have attached the output of that script command above

Also I have found that this crash only happens with gdm and startplasma-wayland. 

I wasn't able to crash kde when I started kwin using following command:-

XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=kde QT_PLUGIN_PATH=`pwd` dbus-run-session /bin/kwin_wayland --drm --xwayland --libinput plasmashell


SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
KDE Plasma Version: 5.20.1
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION

GPU: Intel UHD Graphics 620
Kernel: 5.9.1-zen2-1-zen
Comment 11 Vlad Zahorodnii 2020-10-22 05:25:39 UTC
Did you kill the startplasma-wayland process?
Comment 12 smit 2020-10-22 10:43:24 UTC
(In reply to Vlad Zahorodnii from comment #11)
> Did you kill the startplasma-wayland process?

No. I killed only Xwayland process
Comment 13 Vlad Zahorodnii 2020-10-22 11:30:57 UTC
(In reply to smit from comment #10)
> hi,
> I am still able to crash kde by killing Xwayland with startplasma-wayland
> and gdm. I don't have second machine so I can't do ssh stuff so I used
> script command on tty. I have attached the output of that script command
> above
> 
> Also I have found that this crash only happens with gdm and
> startplasma-wayland. 
> 
> I wasn't able to crash kde when I started kwin using following command:-
> 
> XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=kde QT_PLUGIN_PATH=`pwd`
> dbus-run-session /bin/kwin_wayland --drm --xwayland --libinput plasmashell

can you run the same command, but only with startplasma-wayland instead of plasmashell
Comment 14 smit 2020-10-22 11:51:06 UTC
(In reply to Vlad Zahorodnii from comment #13)
> can you run the same command, but only with startplasma-wayland instead of
> plasmashell

It does not crash.  Xwayland restarts as expected
Comment 15 Vlad Zahorodnii 2020-10-22 11:51:56 UTC
but plasma dies, right?
Comment 16 smit 2020-10-22 11:58:36 UTC
(In reply to Vlad Zahorodnii from comment #15)
> but plasma dies, right?

No. after 4 kills. Xwayland does not restarts. but everything else is usable. whole session does not crashes/dies
Comment 17 Vlad Zahorodnii 2020-10-22 12:02:03 UTC
> Also I have found that this crash only happens with gdm and startplasma-wayland. 
Did you start plasma from gdm? does plasma session crash if you use sddm?
Comment 18 Vlad Zahorodnii 2020-10-22 12:09:06 UTC
> No. after 4 kills. Xwayland does not restarts
kwin won't restart Xwayland if it has crashed more than 3 times over the past 10 minutes
Comment 19 smit 2020-10-22 12:17:44 UTC
(In reply to Vlad Zahorodnii from comment #17)
> > Also I have found that this crash only happens with gdm and startplasma-wayland. 
> Did you start plasma from gdm? does plasma session crash if you use sddm?

I tested sddm also. 

starting plasma with gdm, sddm and startplasma-wayland command and killing Xwayland crashes/terminates the whole session

but when I used 

XDG_SESSION_TYPE=wayland dbus-run-session /bin/kwin_wayland --drm --xwayland --libinput startplasma-wayland

and killed Xwayland, it does not crash. xwayland restarts as expect and everything works fine
Comment 20 Vlad Zahorodnii 2020-10-22 12:41:48 UTC
I've attached a debugger to kwin and it doesn't look like it crashes

(lldb) c
Process 2573 resuming
Process 2573 stopped and restarted: thread 1 received signal: SIGCHLD
Process 2573 stopped and restarted: thread 1 received signal: SIGCHLD
Process 2573 stopped and restarted: thread 1 received signal: SIGCHLD
Process 2573 exited with status = 0 (0x00000000) 

The session process definitely quits. Can you file a bug report against plasmashell?
Comment 21 David Edmundson 2020-10-22 12:46:41 UTC
ksmserver quits
ksmserver is tied to X
and our session is tied to the lifespan of ksmserver


This is valid and needs some refactoring of our boot process (which is an overall topic I've been working on generally.

I've been trying to make ksmserver completely optional on wayland and have a different way of monitoring for exit. It'd be a relatively small patch to start_plasma_  to change what processes we watch for exit.
Comment 22 smit 2020-10-22 13:07:22 UTC
(In reply to Vlad Zahorodnii from comment #20)

> The session process definitely quits. Can you file a bug report against
> plasmashell?


I have edited Product of this bug to plasmashell
Comment 23 David Edmundson 2020-11-22 22:05:31 UTC
Git commit 71ce1f7a5b6c770e2ef7e3b1a0f2b76853c4124a by David Edmundson.
Committed on 22/11/2020 at 22:04.
Pushed by davidedmundson into branch 'master'.

Add an explicit quit mechanism controlled by plasma

On X Kwin's lifespan used to be managed by XSMP. This accidentally broke
in 5.20 as we made kwin start before ksmserver for speed purposes.

This leaves kwin to be killed by the display manager as the X connection
closes, but this can lead to deadlocks.
Related: bug 428817

On wayland kwin's lifespan is mapped to the lifespan of the ksmserver
binary. This is problematic as it makes our entire xwayland robustness
redundant if we ultimately rely on an application that /has/ to run in
xwayland.

M  +3    -0    org.kde.KWin.Session.xml
M  +5    -0    sm.cpp
M  +1    -0    sm.h

https://invent.kde.org/plasma/kwin/commit/71ce1f7a5b6c770e2ef7e3b1a0f2b76853c4124a
Comment 24 Patrick Silva 2020-12-24 11:24:07 UTC
This bug persists on neon unstable.
I started Wayland session with SDDM, opened System Activity by pressing ctrl+esc,
killed xwayland process and my system went to SDDM.
Comment 25 Nate Graham 2021-03-04 18:55:28 UTC
Cannot reproduce. I can kill XWayland now and I don't get booted back to SDDM. Patrick, can you test again on your Neon Unstable machine? Thanks!
Comment 26 Patrick Silva 2021-03-04 22:05:27 UTC
Currently my neon unstable does not go back to login screen when I kill
Xwayland process. It freezes completely instead and I need to force reboot using
the magic key.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Graphics Platform: Wayland
Comment 27 Nate Graham 2021-03-05 19:48:28 UTC
Yikes. For me everything restarts; there is no freeze.
Comment 28 Vlad Zahorodnii 2021-03-09 11:48:41 UTC
(In reply to Patrick Silva from comment #26)
> Currently my neon unstable does not go back to login screen when I kill
> Xwayland process. It freezes completely instead and I need to force reboot
> using
> the magic key.

What do you mean by "it freezes completely"?
Comment 29 Patrick Silva 2021-03-09 13:45:06 UTC
(In reply to Vlad Zahorodnii from comment #28)
> (In reply to Patrick Silva from comment #26)
> > Currently my neon unstable does not go back to login screen when I kill
> > Xwayland process. It freezes completely instead and I need to force reboot
> > using
> > the magic key.
> 
> What do you mean by "it freezes completely"?

Cursor freezes on the screen, keyboard input stops working and I can't even
switch to a tty. If a sound is playing, it stops.
Comment 30 Bug Janitor Service 2021-03-24 04:33:47 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 31 Patrick Silva 2021-03-24 09:18:43 UTC
new info was provided in comment 29.
Comment 32 Vlad Zahorodnii 2021-03-26 08:37:14 UTC
(In reply to Patrick Silva from comment #29)
> Cursor freezes on the screen, keyboard input stops working and I can't even
> switch to a tty. If a sound is playing, it stops.

Odd, there are no such issues on my computer. Is there any chance that you could get the backtrace of kwin when it's frozen?
Comment 33 Patrick Silva 2021-03-26 12:28:04 UTC
I need instructions.
I tried to get a backtrace using another machine connected to problematic one via ssh.
I made my system to freeze, then I pressed ctrl+c in the client machine to get the backtrace
and gdb said "The target is not responding to interrupt requests".
Comment 34 Vlad Zahorodnii 2021-04-01 07:37:52 UTC
Hmm, I've never encountered that issue. Maybe somebody else can explain how to fix it.
Comment 35 Patrick Silva 2021-10-06 11:31:04 UTC
I can reproduce the system freeze on neon unstable by killing Xwayland process
while no Xwayland app is running or when Ungogled Chromium from flathub
is running. However, my system does not freeze when I kill Xwayland process while Firefox or Inkscape is running on Xwayland.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.23.80
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 36 Vlad Zahorodnii 2021-10-06 12:58:31 UTC
(In reply to Patrick Silva from comment #35)
> I can reproduce the system freeze on neon unstable by killing Xwayland
> process
> while no Xwayland app is running or when Ungogled Chromium from flathub
> is running. However, my system does not freeze when I kill Xwayland process
> while Firefox or Inkscape is running on Xwayland.
> 
> Operating System: KDE neon Unstable Edition
> KDE Plasma Version: 5.23.80
> KDE Frameworks Version: 5.87.0
> Qt Version: 5.15.3
> Graphics Platform: Wayland

Are you using systemd boot?
Comment 37 Patrick Silva 2021-10-06 14:11:42 UTC
(In reply to Vlad Zahorodnii from comment #36)
> (In reply to Patrick Silva from comment #35)
> > I can reproduce the system freeze on neon unstable by killing Xwayland
> > process
> > while no Xwayland app is running or when Ungogled Chromium from flathub
> > is running. However, my system does not freeze when I kill Xwayland process
> > while Firefox or Inkscape is running on Xwayland.
> > 
> > Operating System: KDE neon Unstable Edition
> > KDE Plasma Version: 5.23.80
> > KDE Frameworks Version: 5.87.0
> > Qt Version: 5.15.3
> > Graphics Platform: Wayland
> 
> Are you using systemd boot?

No. I think neon unstable does not support systemd startup.
I tried to enable it right now without success.
Comment 38 Vlad Zahorodnii 2021-10-07 10:03:41 UTC
I still can't reproduce the bug. Maybe it's a neon specific issue?
Comment 39 David Edmundson 2021-10-07 11:23:56 UTC
I have seen a bug whereby Xwayland crashing during an X11 blocking call and then kwin_wayland appeared frozen.

I remember my trace was in updateStackingOrder, but I did not save it.
Comment 40 Vlad Zahorodnii 2021-10-07 11:49:06 UTC
Yeah, a backtrace would be very helpful.
Comment 41 Vlad Zahorodnii 2022-01-12 15:13:24 UTC
setting status to NEEDSINFO BACKTRACE
Comment 42 Patrick Silva 2022-01-12 17:09:32 UTC
Currently kwin_wayland crashes on neon unstable when I kill Xwayland via System Activity (ctrl+esc) while no Xwayland app is running.


Thread 10 (Thread 0x7fc345b4f700 (LWP 12303)):
#0  0x00007fc35cd1caff in __GI___poll (fds=0x7fc334005240, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fc35b28c36e in g_main_context_poll (priority=<optimized out>, n_fds=1, fds=0x7fc334005240, timeout=<optimized out>, context=0x7fc334000c20) at ../../../glib/gmain.c:4346
#2  g_main_context_iterate (context=context@entry=0x7fc334000c20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4042
#3  0x00007fc35b28c4a3 in g_main_context_iteration (context=0x7fc334000c20, may_block=may_block@entry=1) at ../../../glib/gmain.c:4108
#4  0x00007fc35d674642 in QEventDispatcherGlib::processEvents (this=0x7fc334000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#5  0x00007fc35d6188db in QEventLoop::exec (this=this@entry=0x7fc345b4ebc0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#6  0x00007fc35d4322e2 in QThread::exec (this=this@entry=0x55ef02925e40) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#7  0x00007fc35ed04559 in QQmlThreadPrivate::run (this=0x55ef02925e40) at qml/ftw/qqmlthread.cpp:155
#8  0x00007fc35d433482 in QThreadPrivate::start (arg=0x55ef02925e40) at thread/qthread_unix.cpp:331
#9  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 9 (Thread 0x7fc3465ed700 (LWP 15873)):
#0  0x00007fc35cd295ce in epoll_wait (epfd=84, events=events@entry=0x7fc3465ec7f0, maxevents=32, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
#1  0x00007fc32167627b in impl_pollfd_wait (object=<optimized out>, pfd=<optimized out>, ev=0x7fc3465ec9a0, n_ev=<optimized out>, timeout=<optimized out>) at ../spa/plugins/support/system.c:155
#2  0x00007fc3216686f4 in loop_iterate (object=0x55ef03eba338, timeout=-1) at ../spa/plugins/support/loop.c:316
#3  0x00007fc35d16f0e0 in do_loop (user_data=0x55ef03e4fac0) at ../src/pipewire/data-loop.c:80
#4  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#5  0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 8 (Thread 0x7fc328a34700 (LWP 12676)):
#0  0x00007fc35cd1caff in __GI___poll (fds=0x7fc324004e60, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fc35b28c36e in g_main_context_poll (priority=<optimized out>, n_fds=1, fds=0x7fc324004e60, timeout=<optimized out>, context=0x7fc324000c20) at ../../../glib/gmain.c:4346
#2  g_main_context_iterate (context=context@entry=0x7fc324000c20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4042
#3  0x00007fc35b28c4a3 in g_main_context_iteration (context=0x7fc324000c20, may_block=may_block@entry=1) at ../../../glib/gmain.c:4108
#4  0x00007fc35d674642 in QEventDispatcherGlib::processEvents (this=0x7fc324000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#5  0x00007fc35d6188db in QEventLoop::exec (this=this@entry=0x7fc328a33bc0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#6  0x00007fc35d4322e2 in QThread::exec (this=this@entry=0x55ef03467f20) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#7  0x00007fc35ed04559 in QQmlThreadPrivate::run (this=0x55ef03467f20) at qml/ftw/qqmlthread.cpp:155
#8  0x00007fc35d433482 in QThreadPrivate::start (arg=0x55ef03467f20) at thread/qthread_unix.cpp:331
#9  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 7 (Thread 0x7fc347fff700 (LWP 12300)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55ef0269e8a8) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55ef0269e858, cond=0x55ef0269e880) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=cond@entry=0x55ef0269e880, mutex=mutex@entry=0x55ef0269e858) at pthread_cond_wait.c:647
#3  0x00007fc35628ab1b in cnd_wait (mtx=0x55ef0269e858, cond=0x55ef0269e880) at ../include/c11/threads_posix.h:155
#4  util_queue_thread_func (input=input@entry=0x55ef0269fe30) at ../src/util/u_queue.c:294
#5  0x00007fc35628a71b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#6  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7fc354f1b700 (LWP 12299)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55ef0269e8a8) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55ef0269e858, cond=0x55ef0269e880) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=cond@entry=0x55ef0269e880, mutex=mutex@entry=0x55ef0269e858) at pthread_cond_wait.c:647
#3  0x00007fc35628ab1b in cnd_wait (mtx=0x55ef0269e858, cond=0x55ef0269e880) at ../include/c11/threads_posix.h:155
#4  util_queue_thread_func (input=input@entry=0x55ef0269fdf0) at ../src/util/u_queue.c:294
#5  0x00007fc35628a71b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#6  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7fc35571c700 (LWP 12298)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55ef0269e8a8) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55ef0269e858, cond=0x55ef0269e880) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=cond@entry=0x55ef0269e880, mutex=mutex@entry=0x55ef0269e858) at pthread_cond_wait.c:647
#3  0x00007fc35628ab1b in cnd_wait (mtx=0x55ef0269e858, cond=0x55ef0269e880) at ../include/c11/threads_posix.h:155
#4  util_queue_thread_func (input=input@entry=0x55ef0269fbc0) at ../src/util/u_queue.c:294
#5  0x00007fc35628a71b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#6  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fc3477fe700 (LWP 12301)):
#0  0x00007fc35cd1caff in __GI___poll (fds=0x7fc33c005240, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fc35b28c36e in g_main_context_poll (priority=<optimized out>, n_fds=2, fds=0x7fc33c005240, timeout=<optimized out>, context=0x7fc33c000c20) at ../../../glib/gmain.c:4346
#2  g_main_context_iterate (context=context@entry=0x7fc33c000c20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4042
#3  0x00007fc35b28c4a3 in g_main_context_iteration (context=0x7fc33c000c20, may_block=may_block@entry=1) at ../../../glib/gmain.c:4108
#4  0x00007fc35d674642 in QEventDispatcherGlib::processEvents (this=0x7fc33c000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#5  0x00007fc35d6188db in QEventLoop::exec (this=this@entry=0x7fc3477fdbe0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#6  0x00007fc35d4322e2 in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#7  0x00007fc35d433482 in QThreadPrivate::start (arg=0x55ef02555ff0) at thread/qthread_unix.cpp:331
#8  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7fc35784e700 (LWP 12296)):
#0  0x00007fc35cd1caff in __GI___poll (fds=0x7fc3500053c0, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fc35b28c36e in g_main_context_poll (priority=<optimized out>, n_fds=3, fds=0x7fc3500053c0, timeout=<optimized out>, context=0x7fc350001ce0) at ../../../glib/gmain.c:4346
#2  g_main_context_iterate (context=context@entry=0x7fc350001ce0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4042
#3  0x00007fc35b28c4a3 in g_main_context_iteration (context=0x7fc350001ce0, may_block=may_block@entry=1) at ../../../glib/gmain.c:4108
#4  0x00007fc35d674642 in QEventDispatcherGlib::processEvents (this=0x7fc350000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#5  0x00007fc35d6188db in QEventLoop::exec (this=this@entry=0x7fc35784dbb0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#6  0x00007fc35d4322e2 in QThread::exec (this=this@entry=0x7fc35fc7fd80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#7  0x00007fc35fbfbf4b in QDBusConnectionManager::run (this=0x7fc35fc7fd80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:179
#8  0x00007fc35d433482 in QThreadPrivate::start (arg=0x7fc35fc7fd80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:331
#9  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#10 0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fc355f1d700 (LWP 12297)):
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55ef0269e8a8) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55ef0269e858, cond=0x55ef0269e880) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=cond@entry=0x55ef0269e880, mutex=mutex@entry=0x55ef0269e858) at pthread_cond_wait.c:647
#3  0x00007fc35628ab1b in cnd_wait (mtx=0x55ef0269e858, cond=0x55ef0269e880) at ../include/c11/threads_posix.h:155
#4  util_queue_thread_func (input=input@entry=0x55ef0269f990) at ../src/util/u_queue.c:294
#5  0x00007fc35628a71b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#6  0x00007fc35d218609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#7  0x00007fc35cd29293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fc3584ff680 (LWP 12289)):
#0  std::__atomic_base<int>::operator++ (this=0x56415741fa1e0ff3) at /usr/include/c++/9/bits/atomic_base.h:318
#1  QAtomicOps<int>::ref<int> (_q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:283
#2  QBasicAtomicInteger<int>::ref (this=0x56415741fa1e0ff3) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:118
#3  QtSharedPointer::ExternalRefCountData::getAndRef (obj=obj@entry=0x55ef03d79720) at tools/qsharedpointer.cpp:1398
#4  0x00007fc35f518ed6 in QWeakPointer<QObject>::QWeakPointer<KWaylandServer::AbstractDataSource, true> (ptr=0x55ef03d79720, this=0x55ef03ad7c68) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:679
#5  QPointer<KWaylandServer::AbstractDataSource>::QPointer (p=0x55ef03d79720, this=0x55ef03ad7c68) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:62
#6  KWaylandServer::DataOfferInterfacePrivate::DataOfferInterfacePrivate (this=0x55ef03ad7c10, _source=0x55ef03d79720, _q=0x55ef03ad9cd0, resource=<optimized out>) at ./src/server/dataoffer_interface.cpp:44
#7  0x00007fc35f519010 in KWaylandServer::DataOfferInterface::DataOfferInterface (this=0x55ef03ad9cd0, source=0x55ef03d79720, resource=<optimized out>) at ./src/server/dataoffer_interface.cpp:157
#8  0x00007fc35f517b52 in KWaylandServer::DataDeviceInterfacePrivate::createDataOffer (this=0x55ef0342cd40, source=0x55ef03d79720) at ./src/server/datadevice_interface.cpp:156
#9  0x00007fc35f517d46 in KWaylandServer::DataDeviceInterface::sendSelection (this=0x55ef035ef630, other=<optimized out>) at ./src/server/datadevice_interface.cpp:191
#10 0x00007fc35f545d15 in KWaylandServer::SeatInterface::setFocusedKeyboardSurface (this=0x55ef02533ba0, surface=0x55ef03508df0) at ./src/server/seat_interface.cpp:916
#11 0x00007fc35f9a100b in KWin::KeyboardInputRedirection::<lambda()>::operator() (__closure=0x55ef02a7e5d0) at ./src/keyboard_input.cpp:141
#12 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::KeyboardInputRedirection::init()::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#13 QtPrivate::Functor<KWin::KeyboardInputRedirection::init()::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#14 QtPrivate::QFunctorSlotObject<KWin::KeyboardInputRedirection::init()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x55ef02a7e5c0, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443
#15 0x00007fc35d650e0e in QtPrivate::QSlotObjectBase::call (a=0x7ffdb776ef50, r=0x55ef026ad090, this=0x55ef02a7e5c0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#16 doActivate<false> (sender=0x55ef02843b70, signal_index=10, argv=0x7ffdb776ef50) at kernel/qobject.cpp:3886
#17 0x00007fc35d64a1d7 in QMetaObject::activate (sender=sender@entry=0x55ef02843b70, m=m@entry=0x7fc35fbd0600 <KWin::Workspace::staticMetaObject>, local_signal_index=local_signal_index@entry=7, argv=argv@entry=0x7ffdb776ef50) at kernel/qobject.cpp:3946
#18 0x00007fc35f8d8416 in KWin::Workspace::clientActivated (this=this@entry=0x55ef02843b70, _t1=<optimized out>) at ./obj-x86_64-linux-gnu/src/kwin_autogen/EWIEGA46WW/moc_workspace.cpp:693
#19 0x00007fc35f9195a6 in KWin::Workspace::setActiveClient (this=0x55ef02843b70, c=c@entry=0x55ef028c6260) at ./src/activation.cpp:267
#20 0x00007fc35f90e1db in KWin::AbstractClient::setActive (this=this@entry=0x55ef028c6260, act=act@entry=true) at ./src/workspace.h:811
#21 0x00007fc35faa86ba in KWin::XdgToplevelClient::takeFocus (this=0x55ef028c6260) at ./src/xdgshellclient.cpp:1027
#22 0x00007fc35f919b04 in KWin::Workspace::takeActivity (this=this@entry=0x55ef02843b70, c=c@entry=0x55ef028c6260, flags=..., flags@entry=...) at ./src/activation.cpp:391
#23 0x00007fc35f919fa4 in KWin::Workspace::requestFocus (this=this@entry=0x55ef02843b70, c=c@entry=0x55ef028c6260, force=force@entry=false) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qflags.h:121
#24 0x00007fc35f91a6c7 in KWin::Workspace::activateNextClient (this=0x55ef02843b70, c=<optimized out>, c@entry=0x55ef027954f0) at ./src/activation.cpp:496
#25 0x00007fc35f91a869 in KWin::Workspace::clientHidden (this=<optimized out>, c=c@entry=0x55ef027954f0) at ./src/activation.cpp:412
#26 0x00007fc35faa3d18 in KWin::XdgToplevelClient::doMinimize (this=0x55ef027954f0) at ./src/workspace.h:811
#27 0x00007fc35f903f45 in KWin::AbstractClient::minimize (avoid_animation=false, this=0x55ef027954f0) at ./src/focuschain.h:208
#28 KWin::AbstractClient::minimize (this=0x55ef027954f0, avoid_animation=<optimized out>) at ./src/abstract_client.cpp:718
#29 0x00007fc35d650e0e in QtPrivate::QSlotObjectBase::call (a=0x7ffdb776f250, r=0x55ef027954f0, this=0x55ef03967830) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#30 doActivate<false> (sender=0x55ef03a96250, signal_index=7, argv=0x7ffdb776f250) at kernel/qobject.cpp:3886
#31 0x00007fc35d64a1d7 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7fc35f649940 <KWaylandServer::PlasmaWindowInterface::staticMetaObject>, local_signal_index=local_signal_index@entry=4, argv=argv@entry=0x7ffdb776f250) at kernel/qobject.cpp:3946
#32 0x00007fc35f505616 in KWaylandServer::PlasmaWindowInterface::minimizedRequested (this=<optimized out>, _t1=<optimized out>, _t1@entry=true) at ./obj-x86_64-linux-gnu/src/server/KWaylandServer_autogen/EWIEGA46WW/moc_plasmawindowmanagement_interface.cpp:661
#33 0x00007fc35f53422e in KWaylandServer::PlasmaWindowInterfacePrivate::org_kde_plasma_window_set_state (this=0x55ef03e33940, resource=<optimized out>, flags=2, state=2) at ./src/server/plasmawindowmanagement_interface.cpp:636
#34 0x00007fc35aeb5ff5 in ffi_call_unix64 () at ../src/x86/unix64.S:101
#35 0x00007fc35aeb540a in ffi_call_int (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:669
#36 0x00007fc35c405628 in wl_closure_invoke (closure=0x55ef03a35520, flags=2, target=<optimized out>, opcode=0, data=<optimized out>) at ../src/connection.c:1018
#37 0x00007fc35c4019e2 in wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=0x55ef035eb6c0) at ../src/wayland-server.c:432
#38 0x00007fc35c40365a in wl_event_loop_dispatch (loop=0x55ef0250ae20, timeout=timeout@entry=0) at ../src/event-loop.c:1027
#39 0x00007fc35f519a4c in KWaylandServer::Display::dispatchEvents (this=<optimized out>) at ./src/server/display.cpp:114
#40 0x00007fc35d650e0e in QtPrivate::QSlotObjectBase::call (a=0x7ffdb776f980, r=0x55ef0253af00, this=0x55ef028cd830) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#41 doActivate<false> (sender=0x55ef0251e390, signal_index=3, argv=0x7ffdb776f980) at kernel/qobject.cpp:3886
#42 0x00007fc35d64a1d7 in QMetaObject::activate (sender=sender@entry=0x55ef0251e390, m=m@entry=0x7fc35d8b5b40 <QSocketNotifier::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffdb776f980) at kernel/qobject.cpp:3946
#43 0x00007fc35d654e93 in QSocketNotifier::activated (this=this@entry=0x55ef0251e390, _t1=..., _t2=<optimized out>, _t3=...) at .moc/moc_qsocketnotifier.cpp:178
#44 0x00007fc35d655633 in QSocketNotifier::event (this=0x55ef0251e390, e=0x7ffdb776fc50) at kernel/qsocketnotifier.cpp:302
#45 0x00007fc35e13ddc3 in QApplicationPrivate::notify_helper (this=this@entry=0x55ef024f8200, receiver=receiver@entry=0x55ef0251e390, e=e@entry=0x7ffdb776fc50) at kernel/qapplication.cpp:3632
#46 0x00007fc35e146bb8 in QApplication::notify (this=0x7ffdb7770080, receiver=0x55ef0251e390, e=0x7ffdb776fc50) at kernel/qapplication.cpp:3156
#47 0x00007fc35d619dda in QCoreApplication::notifyInternal2 (receiver=0x55ef0251e390, event=0x7ffdb776fc50) at ../../include/QtCore/5.15.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#48 0x00007fc35d67186b in QEventDispatcherUNIXPrivate::activateSocketNotifiers (this=0x55ef025048a0) at kernel/qeventdispatcher_unix.cpp:304
#49 0x00007fc35d671ccb in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:511
#50 0x000055ef00c06c41 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#51 0x00007fc35d6188db in QEventLoop::exec (this=this@entry=0x7ffdb776fde0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#52 0x00007fc35d620a94 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#53 0x000055ef00ae7d5c in main (argc=<optimized out>, argv=<optimized out>) at ./src/main_wayland.cpp:733
Comment 43 Bug Janitor Service 2022-01-27 04:37:40 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 44 Patrick Silva 2022-01-27 10:58:13 UTC
Requested info was provided in comment 42.
Comment 45 Vlad Zahorodnii 2022-01-28 11:28:02 UTC
I'm pretty sure that

#0  std::__atomic_base<int>::operator++ (this=0x56415741fa1e0ff3) at /usr/include/c++/9/bits/atomic_base.h:318
#1  QAtomicOps<int>::ref<int> (_q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:283
#2  QBasicAtomicInteger<int>::ref (this=0x56415741fa1e0ff3) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:118
#3  QtSharedPointer::ExternalRefCountData::getAndRef (obj=obj@entry=0x55ef03d79720) at tools/qsharedpointer.cpp:1398
#4  0x00007fc35f518ed6 in QWeakPointer<QObject>::QWeakPointer<KWaylandServer::AbstractDataSource, true> (ptr=0x55ef03d79720, this=0x55ef03ad7c68) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:679
#5  QPointer<KWaylandServer::AbstractDataSource>::QPointer (p=0x55ef03d79720, this=0x55ef03ad7c68) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:62

was fixed with https://bugs.kde.org/show_bug.cgi?id=449101.

Let's track kwin freezing due to blocking calls to xwayland in https://bugs.kde.org/show_bug.cgi?id=442846. This bug report drifted from one issue to another, which makes it hard to wrap head around the actual issue.