xpra icon
Bug tracker and wiki

Opened 4 months ago

Closed 4 months ago

#2694 closed defect (fixed)

Client crash when copying >0.5k from Windows client to Linux server Motif gvim

Reported by: pm54389 Owned by: pm54389
Priority: major Milestone: 4.0
Component: clipboard Version: 3.0.x
Keywords: Cc:

Description (last modified by Antoine Martin)

Hi,

Client: Windows 7, v4.0-r25796
Server: RHEL 7.7, v3.0.5-r24939

Client xpra.conf as in #2638

Build instructions for Motif gvim are in #2673

Copying the following text (550 characters) in Windows and pasting it in Motif gvim causes the client to crash. After the crash, it's possible to re-launch the client and reconnect to the server; the session is still alive (but the paste has failed).

12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890

Also, a couple of the times I hit this, the lines I pasted were pasted into an xterm window instead! Fortunately they didn't contain any destructive shell commands...

Things that work as expected:

  • copying from Windows to GTK gvim
  • copying from GTK gvim to Motif gvim
  • copying all but the last line (500 characters)

Client log:

2020-03-31 23:54:07,282 unknown string message: 0xc15f / 0x52 / 0x85f
2020-03-31 23:54:07,283 unknown string message: 0xc15f / 0x50 / 0x0
2020-03-31 23:54:09,602 Error: error in network packet write/format
2020-03-31 23:54:09,602  a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File "E:\Xpra\trunk\src/xpra/net/protocol.py", line 371, in _write_format_thread_loop
  File "E:\Xpra\trunk\src/xpra/net/protocol.py", line 386, in _add_packet_to_queue
  File "E:\Xpra\trunk\src/xpra/net/protocol.py", line 558, in encode
  File "E:\Xpra\trunk\src/xpra/client/mixins/clipboard.py", line 285, in compress_clipboard
  File "E:\Xpra\trunk\src/xpra/client/client_base.py", line 452, in compressed_wrapper
  File "E:\Xpra\trunk\src/xpra/net/compression.py", line 254, in compressed_wrapper
  File "E:\Xpra\trunk\src/xpra/net/compression.py", line 40, in lz4_block_compress
TypeError: a bytes-like object is required, not 'str'
2020-03-31 23:54:10,317 UI thread is now blocked
2020-03-31 23:54:10,483 UI thread is running again, resuming
2020-03-31 23:54:10,483 Connection lost

Server log:

2020-03-31 23:54:07,466 client   4 @08.842 unknown string message: 0xc15f / 0x52 / 0x85f
2020-03-31 23:54:07,467 client   4 @08.843 unknown string message: 0xc15f / 0x50 / 0x0
2020-03-31 23:54:11,283 Warning: remote clipboard request timed out
2020-03-31 23:54:11,283  request id 34, selection=PRIMARY, target=TEXT
2020-03-31 23:54:11,301 xpra client 4 disconnected.
2020-03-31 23:54:12,787 Warning: remote clipboard request timed out
2020-03-31 23:54:12,787  request id 35, selection=PRIMARY, target=STRING

Let me know if you need more info...

Change History (4)

comment:1 Changed 4 months ago by pm54389

Ref to #2368 should be #2638 (seems I can't edit the comment)

comment:2 Changed 4 months ago by Antoine Martin

Description: modified (diff)
Status: newassigned

Ah, forgot to test that.
Any packets bigger than XPRA_MIN_CLIPBOARD_COMPRESS_SIZE will be compressed via the encode thread... and because python3 is a pain to deal with, it chokes on strings.

The temporary workaround is to set:

XPRA_MIN_CLIPBOARD_COMPRESS_SIZE=99999999

Will fix.

comment:3 Changed 4 months ago by Antoine Martin

Owner: changed from Antoine Martin to pm54389
Status: assignednew

Thanks for reporting this!

To trigger this bug, I believe you needed all of these to line up:

  • mswindows clients only
  • python3 client version 4.0 only (xpra 3.0 is not affected, and there are no python2 builds of 4.0)
  • on the server, an X11 application that requests plain-text first (not utf8)
  • an mswindows application that provides the clipboard data as CF_TEXT (not CF_UNICODETEXT)
  • python-brotli installed at both ends (always included on mswindows builds)
  • more than 512 bytes of clipboard data

Should be fixed in r25895. I didn't manage to reproduce it myself, but I am reasonably confident that the fix is correct.

comment:4 Changed 4 months ago by pm54389

Resolution: fixed
Status: newclosed

Confirm fixed in client v4.0-r25898. Thanks!

Note: See TracTickets for help on using tickets.