microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.26k stars 309 forks source link

Copy and paste on CLion running in wslg crashes the ap completely #589

Open rcosnita opened 2 years ago

rcosnita commented 2 years ago

Environment

Windows build number: Version 10.0.22000.348
Your Distribution version: Ubuntu-20.04
Your WSLg version: 1.0.26

Steps to reproduce

This issue reproduces after a period of time running the Jetbrains CLion app (or any other Java based UI app for that matter). Mainly, once I try to copy and paste things the app crashes immediately.

stderr.log

WSL logs:

pulseaudio.log weston.log

Versions.txt contains the following content:

WSLg ( x86_64 ): 1.0.26+Branch.main.Sha.26ce2c09b86442f3c7f4f6462f770ed2afa76a25
Mariner: VERSION="1.0.20210224"
FreeRDP: b05321cd4e6a862aef76163a69db4e1910245736
weston: 46756d0e77e5c01b5995fbbee6f3ab0db9b30612
pulseaudio: 2f0f0b8c3872780f15e275fc12899f4564f01bd5
mesa:

Expected behavior

No crash should occur and copy / paste must work as expected.

Actual behavior

The application crashes and the following log entries appear in the error log:

Errors from xkbcomp are not fatal to the X server
weston: ../libweston/backend-rdp/rdpclip.c:1189: clipboard_data_source_request: Assertion `peerCtx->clipboard_data_request_event_source' failed.
<4>WSLGd: /usr/bin/weston terminated with signal 6.
(EE) failed to read Wayland events: Broken pipe
<4>WSLGd: /mnt/c/Windows/System32/mstsc.exe exited with status 0.
/usr/share/icons/hicolor/scalable/apps/ibus-setup.svg: unrecognized file header 0x3c 0x3f 0x78 0x6d
glamor: 'wl_drm' not supported
Missing Wayland requirements for glamor GBM backend
Failed to initialize glamor, falling back to sw
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Internal error:   Could not resolve keysym XF86FullScreen
Errors from xkbcomp are not fatal to the X server
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 569, clipping.
>                   X11 cannot support keycodes above 255.
> Internal error:   Could not resolve keysym XF86FullScreen
Errors from xkbcomp are not fatal to the X server
rcosnita commented 2 years ago

FYI: I have just applied https://digitalfortress.tech/debug/what-should-you-do-when-ubuntu-freezes/. Maybe it fixes the issue.

rcosnita commented 2 years ago

I have just tried to apply the fix mentioned in the above link but the problem still occurs.

hideyukn88 commented 2 years ago

@rcosnita, thanks for trying out WSLg. It looks you are on older WSLg build, would you please upgrade by installing WSL from Store app (from https://www.microsoft.com/en-us/p/windows-subsystem-for-linux-preview/9p9tqf7mrm4r) ? While there are some fixes aren't included in this release, but this release has several key fixes, so it might be worth to try out, thanks!

rcosnita commented 2 years ago

After opening the issue I migrated to the latest WSLg version from app store:

C:\Users\raduc>wsl --status Default Distribution: Ubuntu-20.04 Default Version: 2 WSL version: 0.50.2.0 Kernel version: 5.10.74.3 WSLg version: 1.0.29 Windows version: 10.0.22000.376

The problem is still occuring but at a slower pace. Not sure if this is related to the Ubuntu version or is a more general problem.

RFHold commented 2 years ago

Issue also exists in other IDEA IDEs Microsoft Windows NT 10.0.22000.0 Ubuntu 20.04 WSLg 1.0.26 Kernel 5.10.60.1

pulseaudio.log stderr.log weston.log

rcosnita commented 2 years ago

With WSLg version 1.0.30 the issue still persist but it occurs rarely (maybe once per day). In the previous versions I was hitting this bug once every two - three hours.

hideyukn88 commented 2 years ago

@rcosnita, thanks for update. Do you see any core file created under /mnt/wslg/dumps? if so please share with us, thanks!

rcosnita commented 2 years ago

Not yet. As soon as I manage to reproduce the issue again I will attach the resulting core file.

rcosnita commented 2 years ago

Here is the core dump resulting from WebStorm crashing.

core.zip

Here is the result of wsl status:

C:\Users\raduc>wsl --status
Default Distribution: Ubuntu-20.04
Default Version: 2
WSL version: 0.51.3.0
Kernel version: 5.10.93.2
WSLg version: 1.0.30
Windows version: 10.0.22000.527
rcosnita commented 2 years ago

I managed to reproduce the issue again so I'm attaching the new core dump collected. core.zip

hideyukn88 commented 2 years ago

@rcosnita, thanks for dump.

0 0x00007fe197408115 in raise () from /lib/libc.so.6

1 0x00007fe1973f2555 in abort () from /lib/libc.so.6

2 0x00007fe1973f2429 in __assert_fail_base.cold () from /lib/libc.so.6

3 0x00007fe197400806 in __assert_fail () from /lib/libc.so.6

4 0x00007fe19663c929 in clipboard_client_format_list (context=, formatList=)

at ../libweston/backend-rdp/rdpclip.c:1581

5 0x00007fe196462355 in cliprdr_server_receive_format_list (header=, header=,

s=0x55a8639d62e0, context=0x55a8639e5d90) at /work/vendor/FreeRDP/channels/cliprdr/server/cliprdr_main.c:620

6 cliprdr_server_receive_pdu (header=, s=0x55a8639d62e0, context=0x55a8639e5d90)

at /work/vendor/FreeRDP/channels/cliprdr/server/cliprdr_main.c:858

7 cliprdr_server_read (context=0x55a8639e5d90) at /work/vendor/FreeRDP/channels/cliprdr/server/cliprdr_main.c:1082

8 cliprdr_server_check_event_handle (context=0x55a8639e5d90)

at /work/vendor/FreeRDP/channels/cliprdr/server/cliprdr_main.c:1349

9 0x00007fe19645f65e in cliprdr_server_thread (arg=0x55a8639e5d90)

at /work/vendor/FreeRDP/channels/cliprdr/server/cliprdr_main.c:1192

10 0x00007fe19638ea1c in thread_launcher (arg=0x55a8639d07e0)

at /work/vendor/FreeRDP/winpr/libwinpr/thread/thread.c:316

11 0x00007fe1972d209a in start_thread () from /lib/libpthread.so.0

12 0x00007fe1974cb833 in clone () from /lib/libc.so.6

$1 = {base = {resource = 0x0, destroy_signal = {listener_list = {prev = 0x55a8639bfcc8, next = 0x55a863f3fb50}}, mime_types = {size = 24, alloc = 32, data = 0x7fe164000f10}, offer = 0x55a863f3fb40, seat = 0x0, accepted = false, actions_set = false, set_selection = true, dnd_actions = 0, current_dnd_action = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE, compositor_action = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE, accept = 0x7fe19663a4b0 , send = 0x7fe19663cf90 , cancel = 0x7fe19663ca60 }, transfer_event_source = 0x0, defer_event_source = 0x0, data_contents = {size = 0, alloc = 0, data = 0x0}, context = 0x55a863690810, refcount = 2, data_source_fd = 106, format_index = 4, state = RDP_CLIPBOARD_SOURCE_FAILED, data_response_fail_count = 0, inflight_write_count = 0, inflight_data_to_write = 0x0, inflight_data_size = 0, is_data_processed = 0, is_canceled = 0, client_format_id_table = {13, 1, 0, 0, 49379}}

linghengqian commented 1 year ago
rusefillc commented 1 year ago

does not work for me on IDEA (and Eclipse) WLS 2.0.4 wlsg 1.0.58 is this a java issue?

Wielding commented 10 months ago

I have the same problem running Clion (and other JetBrains IDEs) on Ubuntu. After a long coding session, it eventually crashes the entire window manager upon a copy/paste and kicks me back to the console. I have had to stop using it and move to using VSCode which is a bummer.

hsuh commented 5 months ago

I am also having the same issue. on WSL version: 2.1.5.0. Ubuntun. RubyMine 2024.1.2. When I use 'p/P' with ideaVim the IDE crashes

jhare-rectangle commented 2 months ago

Just for kicks. I use PyCharm in WSL2. I had a functional Ubuntu 20.04 that did not crash. I installed 24.04 and crashes when I use 'p'. So I tried Debian 12. Same problem. I had previously reported this issue to Jetbrains with Ubuntu 22.04 on a different machine.

sbj0 commented 3 weeks ago

Crashes observed when doing y/p (yank/paste) on IntelliJ/IdeaVim with

WSL version: 2.3.24.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.19045.5011

WSL distro: Ubuntu 24.04.1 LTS

cubimon commented 1 week ago

I have the same issue

uname -a Linux OPTCN7181 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

PS C:\Users\me> wsl --version WSL-Version: 2.3.24.0 Kernelversion: 5.15.153.1-2 WSLg-Version: 1.0.65 MSRDC-Version: 1.2.5620 Direct3D-Version: 1.611.1-81528511 DXCore-Version: 10.0.26100.1-240331-1435.ge-release Windows-Version: 10.0.19045.5011 PS C:\Users\me>

cubimon commented 1 week ago

Setting set clipboard=+unnamed in ~/.ideavimrc would be a workaround

jhare-rectangle commented 1 week ago

Throughout the experience of this bug, I had set clipboard+=unnamed in my .ideavimrc file. But I also had set clipboard+=ideaput. I don't have the setup any more to test if removing the second one resolves the issue.

sbj0 commented 1 week ago

Thank you both for sharing these suggestions.

It runs successfully (tested with 1'000+ put operations) on my system with any of

set clipboard=unnamed set clipboard=unnamedplus set clipboard+=unnamedplus

It crashes (after ~10 put operations or fewer) with any of

set clipboard+=unnamed << empty .ideavimrc >>