Bug 371862 - xclipboard_syncer goes crazy when kwin_wayland goes down
Summary: xclipboard_syncer goes crazy when kwin_wayland goes down
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D5589
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-30 10:53 UTC by Kai Uwe Broulik
Modified: 2017-05-05 17:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:
mgraesslin: Wayland+
mgraesslin: X11-
mgraesslin: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2016-10-30 10:53:19 UTC
When I start kwin_wayland and Ctrl+C it, kwin_wayland quits and leaves a org_kde_kwin_xclipboard_syncer behind that is consuming 100% CPU on one core. Doing so multiple times results in multiple of those processes running.

The clipboard syncer should quit gracefully when kwin exits for whatever reason.

I tried gdb attaching to the process to see where it's looping but that just froze my gdb as well :)
Comment 1 Martin Flöser 2016-10-30 17:24:54 UTC
The xclipboard syncer is bound to the X11 session. Given bug #371861 I assume this is related to running a kwin_wayland without --xwayland. Due to that the xclipboard syncer used the wrong X server.

When kwin_wayland goes down, the Xwayland server goes down, which in turn also takes down the syncer process. Given that the error is not using --xwayland.
Comment 2 Kai Uwe Broulik 2016-10-30 17:27:04 UTC
Without xwayland KWin doesn't even start. I consistently experienced the aforementioned behavior with kwin_wayland --xwayland --windowed --socket wayland-1
Comment 3 Martin Flöser 2016-10-30 17:30:41 UTC
In that case I need a backtrace of the process running amok. For me it always terminated.
Comment 4 Martin Flöser 2017-04-26 05:16:28 UTC
Possible patch at: https://phabricator.kde.org/D5589
Comment 5 Thomas Lübking 2017-04-26 20:05:59 UTC
Kai, what state does the org_kde_kwin_xclipboard_syncer process take when this happens? If it's not waiting for some IO response ("D"), can you stop it (before attaching gdb, in order to prevent stalling that)?

If the process turns into a zombie you could attach "strace -p $PID" to it before sending it to the world of the undead to watch the trailing actions.
Comment 6 Martin Flöser 2017-05-05 17:17:35 UTC
Git commit 572f730e8ecd39767390d9a1568a8cb50625965b by Martin Gräßlin.
Committed on 05/05/2017 at 17:17.
Pushed by graesslin into branch 'master'.

[helper] Terminate xclipboardsyncer if kwin_wayland goes down

Summary:
Normally the xclipboardsyncer should terminate because the socket
becomes unusable. But we have reports of it not really going down and
running amok.

In order to prevent such situations this change registers SIGTERM to be
sent to xclipboardsyncer when the parent process (that is kwin_wayland)
dies in whatever way. This ensures that xclipboardsyncer cannot become
an orphan.

Test Plan: Only compile tested, no way to get into the problematic situation

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5589

M  +1    -0    CMakeLists.txt
M  +1    -0    config-kwin.h.cmake
M  +9    -0    helpers/xclipboardsync/main.cpp

https://commits.kde.org/kwin/572f730e8ecd39767390d9a1568a8cb50625965b