Bug 36165

Summary: [PATCH] Wrong usage of memcpy(3) in fb/fbblt.c
Product: xorg Reporter: Adam Tkac <vonsch>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: thierry.vignaud
Version: unspecified   
Hardware: Other   
OS: All   
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 36141    
Description Flags
Proposed patch
This uses memcpy, but avoids overlap as required none

Description Adam Tkac 2011-04-12 07:48:39 UTC
There is wrong usage of memcpy(3) in fb/fbblt.c, I will attach proposed patch.

Due this issue there are framebuffer corruptions when dragging windows to left. You can see example of FB corruptions on https://bugzilla.redhat.com/show_bug.cgi?id=652590.

When I change memcpy to memmove, everything works fine.
Comment 1 Adam Tkac 2011-04-12 07:50:58 UTC
Created attachment 45528 [details] [review]
Proposed patch
Comment 2 Alan Coopersmith 2011-04-12 08:33:05 UTC
Please submit patches to xorg-devel for review & application, as described in
http://www.x.org/wiki/Development/Documentation/SubmittingPatches and
http://www.x.org/wiki/XServer#DevelopmentProcess .

(It's not necessary to file bug reports for every patch.   X.Org generally
 uses bug reports to track issues needing investigation still.)
Comment 3 Keith Packard 2011-08-15 15:44:40 UTC
Created attachment 50248 [details] [review]
This uses memcpy, but avoids overlap as required

Adam Jackson discovered that memmove was about twice as slow as memcpy, and so finding cases which can use memcpy remains important for performance. This patch avoids all overlapping copies while retaining the use of memcpy for non-overlapping cases, preserving most of the performance benefit.

I'd like to verify that it resolves the problem you're having, please give it a try.
Comment 4 Adam Tkac 2011-09-12 05:08:11 UTC
Sorry for late response.

I just tried to build Xvnc against Fedora's Xorg 1.10.4-1.fc15 (which should have the patch included if I read source correctly) and everything seems fine for me, I see no FB corruptions.

So you can close this bug as fixed.
Comment 5 Jeremy Huddleston Sequoia 2011-09-18 01:42:13 UTC
Thanks for verifying the fix.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.