Bug 85475 - Copy and paste not working properly + crash
Summary: Copy and paste not working properly + crash
Status: RESOLVED MOVED
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-26 09:46 UTC by Jonas Heinrich
Modified: 2018-06-08 23:53 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
weston freeze on copy and paste (9.29 KB, text/plain)
2014-10-27 08:46 UTC, Jonas Heinrich
Details
Hacky patch (511 bytes, patch)
2015-09-25 14:49 UTC, Artem Chudinov
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Heinrich 2014-10-26 09:46:47 UTC
Hi,
I'm using the latest Wayland and Weston version 1.6. 
Trying to copy text in Epiphany or files in Nautilus sometimes work but often there is nothing in the clipboard. Trying to copy something repeatedly could cause a crash and Weston quits.
Comment 1 Pekka Paalanen 2014-10-27 07:15:52 UTC
Could you tell us the usual information as for any bug report:
- Is there a reliable way to always trigger "nothing to paste" or crash? What are those ways exactly?
- Is Xwayland involved?
- Weston log when it crashes, showing an automatic backtrace?
Comment 2 Jonas Heinrich 2014-10-27 08:46:04 UTC
Created attachment 108495 [details]
weston freeze on copy and paste

Thank you for your replay.
It happens to all applications, native and Xwayland ones. And the bug is easy repeatable.

The log above includes launching Weston and then Epiphany (browser). There I right click on a link and "copy link address" two times. Always on the secont try Weston freezes. The last part of the log repeats infinately.
Comment 3 Pekka Paalanen 2014-10-27 10:18:24 UTC
Ok, that looks like an infinite loop related to Xwayland.

Can you reproduce the crash or hang even when you do not let Weston load xwayland.so?
Comment 4 Jonas Heinrich 2014-10-27 12:35:44 UTC
(In reply to Pekka Paalanen from comment #3)
> Ok, that looks like an infinite loop related to Xwayland.
> 
> Can you reproduce the crash or hang even when you do not let Weston load
> xwayland.so?

You are right, it doesn't crash anymore when I disable Xwayland module.

In some cases copy and paste still does not work. For example copy an URL from the address bar in Epiphany, the clipboard remains empty if I try to paste it somewhere else :(

So we need to debug Xwayland module and maybe GTK?
Comment 5 Artem Chudinov 2015-09-25 14:40:56 UTC
In Weston 1.9.0 the steps to reproduce are:
(Optional step) 0. Run in another tty:
sleep 60 && killall -9 Xwayland
(-9 is necessary). It helps to get rid of the lockup.
1. Run `weston` in any X11 environment or run `weston-launch` in a tty.
2. Open any X11 app (firefox, for example).
(Optional step) 3. Close it.
4. Open gnome-terminal (also you can this step before step 2).
5. Select something.
6. Copy the selection using Ctrl+Shift+C or using a context menu.
(Optional step 7). Deselect the selection.
(Optional step 8). Click in the terminal with the right mouse button, select "Profile" -> "Profile Preferences". Close the popup window, nothing bad should happen.
9. Either repeat step 6 or just close gnome-terminal.
10. Now keyboard and mouse don't work. Switching to another tty doesn't work. Process `weston` (or `weston-launch`) slowly increases its CPU usage to 100% (only 1 thread).

After the recent commit http://cgit.freedesktop.org/wayland/weston/commit/?id=a1f3f3c9f209be52d19793d36bbda68ca24a714e the steps to reproduce now are:
1-8 steps are the same.
9. Now you can safely copy & paste a text, and you can safely close gnome-terminal.
10. Run an X11 app. The same lockup happens immediately.

My weston's log's last messages are the same as for Jonas Heinrich.

The infinite loop is `weston_wm_handle_event`'s `while`: http://cgit.freedesktop.org/wayland/weston/tree/xwayland/window-manager.c#n1913
The message `xfixes selection notify event: owner 0` is output by `weston_wm_handle_selection_event` which is called in the loop.

By the way, there is no such issue in sway (i3-compatible window manager for Wayland, it uses wlc).
Comment 6 Artem Chudinov 2015-09-25 14:49:23 UTC
Created attachment 118444 [details] [review]
Hacky patch

This patch helps me, though I don't even know what is XCB_ALLOC_COLOR_PLANES (I am not familiar with the code). I suppose my patch breaks something, but I couldn't find what.
Comment 7 Daniel Stone 2018-06-04 09:07:03 UTC
(In reply to Artem Chudinov from comment #6)
> Created attachment 118444 [details] [review] [review]
> Hacky patch
> 
> This patch helps me, though I don't even know what is XCB_ALLOC_COLOR_PLANES
> (I am not familiar with the code). I suppose my patch breaks something, but
> I couldn't find what.

XCB_ALLOC_COLOR_PLANES is referring to a request. An event numbered 87 must be an extension event: if you run xdpyinfo -queryExtensions, you can find out which extension this would belong to.
Comment 8 GitLab Migration User 2018-06-08 23:53:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/wayland/weston/issues/58.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.