Bug 36165 - [PATCH] Wrong usage of memcpy(3) in fb/fbblt.c
Summary: [PATCH] Wrong usage of memcpy(3) in fb/fbblt.c
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: xserver-1.11
  Show dependency treegraph
 
Reported: 2011-04-12 07:48 UTC by Adam Tkac
Modified: 2011-09-18 01:42 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch (1.55 KB, patch)
2011-04-12 07:50 UTC, Adam Tkac
no flags Details | Splinter Review
This uses memcpy, but avoids overlap as required (2.50 KB, patch)
2011-08-15 15:44 UTC, Keith Packard
no flags Details | Splinter Review

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.