After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 494059 - high cpu/network usage (immediate FBUpdate replies with no changes)
high cpu/network usage (immediate FBUpdate replies with no changes)
Status: RESOLVED FIXED
Product: vino
Classification: Applications
Component: Server
2.20.x
Other All
: Normal normal
: ---
Assigned To: Vino Maintainer(s)
Vino Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2007-11-06 08:53 UTC by Michal Babej
Modified: 2008-12-22 19:36 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
reset cursorWasChanged and cursorWasMoved after cursor is drawn (723 bytes, patch)
2008-12-21 21:24 UTC, Oliver Gerlich
committed Details | Review

Description Michal Babej 2007-11-06 08:53:18 UTC
Please describe the problem:
I'm connecting to a vino server running in the same LAN. Once i connect, my cpu load goes to 60% and network to 1-3MB/s. I ran a network sniffer and discovered that vino server responds to FBUpdateRequest immediately with FBUpdate containing update on mouse cursor, even if the mouse did not move at all.

Steps to reproduce:
Start a vino-server, connect to it, with both machines on a fast network (LAN).

Actual results:


Expected results:


Does this happen every time?
yes.

Other information:
Comment 1 Mark McLoughlin 2007-11-06 10:45:45 UTC
I heard someone else mention this problem (immediate FBUpdate replies even when nothing changed) within the last few days - definitely needs to be debugged
Comment 2 Mark McLoughlin 2007-11-06 14:15:50 UTC
Wow, you guys are confusing the hell out of me - now I see that you're the same people that mentioned the problem already!

(i.e. I was talking to franz and then cmeadors and then this mbabej person files a similar bug but that just turns out to be franz again ... :-)
Comment 3 Michal Babej 2007-11-06 14:25:44 UTC
Ah, sorry for that. I just wanted to know what does upstream developers think of this issue :) so i filed this bug.
Comment 4 Eloy Paris 2007-12-18 02:37:27 UTC
I think I am hitting this bug as well - connections via VNC to a Gnome desktop running the vino server generate traffic all the time, even if there is no screen/mouse/keyboard activity in the Gnome desktop.

This definitely does not happen with other VNC servers, i.e. if there is no screen/mouse/keyboard activity then there is no VNC traffic at all.
Comment 5 Oliver Gerlich 2008-12-21 21:22:47 UTC
Attached is a patch which fixes the problem for me - could you give it some review and testing? Apparently the cursorWasMoved and cursorWasChanged flags are never reset when drawing the cursor on server-side, so that the cursor update is indeed sent as reply to every update request.

Btw. the problem does not occur when using krdc as that client supports the "Cursor" pseudo encoding (-239) and the additional (TightVNC?) encodings -239 and -240 - in those cases, Vino only sends cursor position and shape. For Vinagre and xvncviewer, the cursor is drawn on server-side instead which triggers the bug.
Comment 6 Oliver Gerlich 2008-12-21 21:24:17 UTC
Created attachment 125114 [details] [review]
reset cursorWasChanged and cursorWasMoved after cursor is drawn
Comment 7 Mark McLoughlin 2008-12-22 12:26:44 UTC
Oliver, thanks for fixing this. Would something like this work just as well?

 	    rfbDrawCursor(cl->screen, &cursorBounds);
 	    cursorIsDrawn = TRUE;
 
+	    cl->cursorWasMoved = FALSE;
+	    cl->cursorWasChanged = FALSE;
 	    cl->lastDrawnCursorBounds = cursorBounds;
 
 	    sraRgnOr(cl->modifiedRegion, cursorRegion);
Comment 8 Oliver Gerlich 2008-12-22 15:36:01 UTC
Yes, that works as well and is much simpler :-)

There's a package for Ubuntu Intrepid available at https://launchpad.net/~ogerlich/+archive , with this patch (and also the patch for bug 564520) applied.
Comment 9 Jonh Wendell 2008-12-22 19:36:47 UTC
Thanks Oliver. Patch committed:

2008-12-22  Jonh Wendell  <jwendell@gnome.org>

	* server/libvncserver/rfbserver.c (rfbSendFramebufferUpdate):
	Resets cursorWasMoved and cursorWasChanged flags, thus eliminating
	mouse update changes, when there's no mouse change. Closes #494059.
	Thanks to Oliver Gerlich for the patch.