Bug 958051

Summary: vdagent: check validity when iterating the _displays vector
Product: Red Hat Enterprise Linux 8 Reporter: Uri Lublin <uril>
Component: spice-vdagent-winAssignee: Uri Lublin <uril>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: acathrow, cfergeau, cpelland, dblechte, marcandre.lureau, mkrcmari
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Windows   
Whiteboard:
Fixed In Version: vdagent-win-3.3-1 Doc Type: Bug Fix
Doc Text:
There are were cases where the _displays vector was being iterated, and some of the vector entries were NULL. This caused the agent to be aborted and restarted by the service several times. This has been fixed, now the agent enables virtual machines with multiple monitors to show all monitors correctly.
Story Points: ---
Clone Of:
: 975442 (view as bug list) Environment:
Last Closed: 2014-01-21 14:43:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 975442    

Description Uri Lublin 2013-04-30 09:05:08 UTC
Description of problem:
In the code, there are two cases where the _displays vector is being iterated.
Some of the vector entries may be NULL, so add code to check for it.

I encountered the problem when running a Windows XP guest with 4 QXL devices, each with both ram_size and vram_size set to 64MB. The guest could only use 3 of them.
The 4'th device could not be used due to "out of resources" problem.
The 4'th had NULL in its _displays entry.

Version-Release number of selected component (if applicable):
vdagent-win-0.1-17 (probably happens with earlier versions too)

How reproducible:
Always

Steps to Reproduce:
1. Run a Windows XP guest with 4 QXL devices, each with ram_size=64MB and vram_size=64MB (different size may work too)
2. Make sure from in-guest display-settings that only 3 QXL devices are available. (Also possible to see it with device-manager)
3. Install vdagent-win-0.1-17, if not already installed
4. Run service-manager and try to start RHEV Spice Agent

Actual results:
Agent aborts, restarted by the service, aborts ... for a few times.

Expected results:
Agent runs successfully.

Comment 1 Arnon Gilboa 2013-04-30 09:34:47 UTC
Nice catch, waiting for your patch.

Comment 2 Uri Lublin 2013-04-30 12:44:30 UTC
A patch you say ? I sent it your way:
http://lists.freedesktop.org/archives/spice-devel/2013-April/013223.html

Comment 3 Marc-Andre Lureau 2013-05-03 12:05:55 UTC
Things will turn bad on client side if the agent is running but all monitors are not QXL devices: the mapping  channel-monitor is no longer be correct..

I think it would make sense to fail starting the agent, and show a big fat warning dialog about the issue.

Comment 6 Arnon Gilboa 2013-06-19 13:03:33 UTC
revert change (should have been in z-stream bug 975442)

Comment 10 errata-xmlrpc 2014-01-21 14:43:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-0063.html