Bug 978404

Summary: Copy&Paste of images fails over WAN.
Product: Red Hat Enterprise Linux 8 Reporter: Marian Krcmarik <mkrcmari>
Component: spice-vdagent-winAssignee: Gal Hammer <ghammer>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Desktop QE <desktop-qa-list>
Severity: low Docs Contact:
Priority: low    
Version: ---CC: acathrow, cfergeau, dblechte, ghammer, marcandre.lureau, mkrcmari, rhod, tjamrisk, uril
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-20 17:04:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Spice RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1029162    
Attachments:
Description Flags
Log with additional debug messages. none

Description Marian Krcmarik 2013-06-26 14:27:59 UTC
Description of problem:
Copy and paste of images fails over WAN condition - latency around 70-90ms and bandwidth limited to 2Mbps. It works as expected over LAN or copy and paste of text with same or higher size over WAN (the same condition as with failing image copy and paste).
Sometimes it seems that vdagent crashes (wihtout any msg in log) or even qemu-monitor is most likely busy so libvirt assumes that connection with qemu process was lost and tries to kill the qemu process.

Version-Release number of selected component (if applicable):
vdagent-win 0.1-18 (RHEl 6 client adn WInXP/7 guest)

How reproducible:
90%

Steps to Reproduce:
1. Establish spice session to a Windows guest with vdagent-win installed over WAN condition (70-100ms latency, <2Mbps).
2. Press printscreen in windows guest.
3. Open graphics editor in client (mspiant, gimp) and make paste.

Actual results:
Nothing is copied, sometimes vdagent crashes.

Expected results:
Image is successfully copied as It happens over LAN.

Additional info:
Nothing interesting in logs, I can see only sth like:
1752::INFO::2013-06-25 23:37:35,875::VDAgent::handle_clipboard_request::Image encoded to 175898 bytes

Comment 1 Arnon Gilboa 2013-06-30 13:23:06 UTC
1. pasting text of the same size works? that's strange as it's exactly the same path as image.
2. what about client->guest c&p over WAN?
3. can you please provide me a VM in Brno for debugging?

Comment 2 Tomas Jamrisko 2013-07-09 07:29:39 UTC
Created attachment 770829 [details]
Log with additional debug messages.

Comment 3 Arnon Gilboa 2013-07-24 12:11:05 UTC
To reproduce this one we connected wireless via TLV VPN. Pasting a snapshot from Win7 guest desktop (with a "nice" Wallpaper, not single color) to Linux client failed as mentioned. We couldn't reproduce it in LAN.

Debugging with Gal Hammer (vio-serial driver), we have proved that vdagent is not the issue here, and whenever the bug is reproduced, data was correctly written by the agent.

In qemu log, we see clearly see message corruption:
agent_msg_filter_process_data: invalid agent message: data exceeds size from header
((null):15982): Spice-Warning **: reds.c:863:vdi_port_read_buf_process: invalid port
main_channel_handle_parsed: agent start

In vdagent, right after the failure vio-serial write completion fails with error 317 (ERROR_MR_MID_NOT_FOUND).

logging buf_size in the qemu vio-serial device (do_flush_queued_data(), hw/char/virtio-sehw/char/virtio-serial-bus.c), we see that when sending a large enough piece of data (pasting guest desktop snapshot to the client), once in a while a previously read buffer is read again by the function. This seems like a driver bug which caused this duplication/corruption.

Gal says he patched a suspected issue in the driver, but that there is also a bug in qemu reading which is reproduced (e.g. in WAN/VPN) when consuming the data (destinated to teh client) much slower than its written by the guest agent.

Gal, please add insights & status.

Comment 4 Gal Hammer 2013-07-24 13:24:59 UTC
(In reply to Arnon Gilboa from comment #3)

> Gal, please add insights & status.

Nothing much to tell. A bug(?) in qemu, which raise an interrupt even when the consumed buffer wasn't return back to the virt queue, discovered a bug in the virtio-serial Windows' driver. The virtio-serial driver duplicated the last write request and that caused the spice error ("data exceeds size from header").

The driver was fixed and it seems to work okay now but the copy&paste still fails from some to time. It seem that there is still a bug some where in the loop. I don't know where without further investigation.

Comment 6 David Blechter 2013-08-22 19:39:28 UTC
moving to the 3.4

it requires more investigation. 
Thanks to Gal for helping.

Most likely not the vdagent, and will move to the correct component as the picture of the source of the problem will clear up.

Comment 8 Marc-Andre Lureau 2014-03-11 23:31:51 UTC
Can someone still reproduce this bug?

Comment 9 Uri Lublin 2014-03-26 13:01:43 UTC
I've tried reproducing this bug, and it did not reproduced for me.

Tried copy/paste, over WAN, screenshot images from a Windows XP and Windows 7 guests onto RHEL-6 client (and other direction too).
Also ran some tests with WinXP as client.

Comment 10 David Blechter 2014-06-02 17:53:17 UTC
let's move to 3.5, as no conclusions yet