SDL rendering issue: graphic corruption while scrolling right
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| The Battle For Wesnoth |
Unknown
|
Unknown
|
||
| libsdl |
Fix Released
|
Medium
|
||
| Fedora |
New
|
Undecided
|
Unassigned | |
| Gentoo Linux |
Fix Released
|
Medium
|
||
| libsdl1.2 (Ubuntu) |
Low
|
Unassigned | ||
| Natty |
Low
|
Unassigned | ||
| wesnoth-1.8 (Ubuntu) |
Undecided
|
Unassigned | ||
| Natty |
Undecided
|
Unassigned |
Bug Description
Binary package hint: wesnoth-1.8
using natty 11.04 with latest updates as of today (25.2)
when playing and scrolling to the right the screen gets corrupted, scrolling up/down/left works as expected
there is also a screenshot + a small diff available in the wesnoth forums ->
http://
it happens using nouveau and nvidia binary driver..
Related branches
- Ubuntu branches: Pending requested 2011-03-13
-
Diff: 47 lines (+27/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/900_sdlblitmemcpyfix.diff (+18/-0)
debian/patches/series (+1/-0)
cuc (cuc+) wrote : | #1 |
|
#6 |
There is an upstream bug report regarding this that contains a patch:
http://
Bug #354175 involves a program that is affected by this. Applying the upstream patch to media-libs/
ebuild $(equery which media-libs/
cd /var/tmp/
wget -O - http://
ebuild $(equery which media-libs/
The other ebuild versions, including the media-libs/
ebuild $(equery which media-libs/
cd /var/tmp/
wget -O - http://
ebuild $(equery which media-libs/
The reason we are seeing this issue in programs that rely on libsdl now is because of a change to glibc's memcpy() function late last year. The old implementation allowed programs to call memcpy() on overlapping regions. The new implementation copies memory in reverse, which broke any code that relied on the old implementation. The assumption that memcpy() works between overlapping regions of memory is illegal under ANSI C. There is a fairly lengthy bug report at the Fedora Linux bug tracker about this where Linus Torvalds commented on the issue:
https:/
I recommend inserting media-libs/
|
#7 |
I made a small mistake in my previous comment. The commands to test the application of this patch to unstable should be:
ebuild $(equery which media-libs/
cd /var/tmp/
wget -O - http://
ebuild $(equery which media-libs/
The commands to test the application of this patch to stable should be:
ebuild $(equery which media-libs/
cd /var/tmp/
wget -O - http://
ebuild $(equery which media-libs/
Sorry about any confusion my mistake might have caused. I had already modified the ebuild in a local overlay, so when I was testing these commands, I had to first reverse the patch and then apply it. I accidentally copied one of the --dry-run commands I had done during the course of this and then carried that mistake over the other set I had posted.
|
#8 |
I just noticed that sys-libs/
|
#9 |
(In reply to comment #2)
> I just noticed that sys-libs/
> this is likely using the unstable tree. Please disregard the instructions I
> posted for users of the stable tree. As long as they do not unkeyword glibc,
> they will likely not need to worry about this.
>
Actually disregard comment #2. That was meant for bug #354175. I posted it in this bug by mistake.
|
#11 |
(In reply to comment #4)
> fixed in libsdl-1.2.14-r6
libsdl-1.2.13-r1 also misuses memcpy(), so you might want to patch it too. Otherwise, this issue will occur again when glibc-2.13 becomes stable.
|
#12 |
guess we'll mark the later version of libsdl stable before making glibc-2.13 stable.
Dave Gilbert (ubuntu-treblig) wrote : | #2 |
srk9 on #ubuntu-devel says this is a memcpy v memmove issue in libsdl and that it just needs a trivial fix from:
http://
this is likely to impact multiple SDL apps with odd corruption on x86.
Dave
Richard (shiningarcanine) wrote : | #3 |
This is caused by an optimization introduced in glibc that causes memcpy() to copy in reverse. This breaks code that used memcpy() for overlapping copies in violation of ANSI C. There is a bug at the Fedora bug tracker documenting this where Linus Torvalds posted his two cents:
https:/
Anyway, the fix is to apply the patch at the libsdl bug tracker to libsdl. While the fix is trivial, it would be problematic if a major Linux distribution shipped a release with this bug in it. I suggest that this be made a blocker to Ubuntu 11.04's release to ensure that this is addressed before Ubuntu 11.04 ships next month.
Also, would the package maintainer take the initiative to notify his Debian counterpart? I am the Gentoo Linux user that filed the Gentoo bug about this and I don't plan to notify many more people. The only reason I cared about this bug on Ubuntu to talk about it here is because it affects someone I know.
Dave Gilbert (ubuntu-treblig) wrote : | #4 |
I can confirm the fix at:
http://
fixes this issue from a simple test in wesnoth.
Dave
summary: |
- graphic corruption while scrolling right + SDL rendering issue: graphic corruption while scrolling right |
Changed in wesnoth-1.8 (Ubuntu): | |
status: | New → Invalid |
tags: | added: patch |
Richard (shiningarcanine) wrote : | #5 |
The bug has not been filed with Fedora yet, although the original upstream bug with the Battle for Wesnoth project was reported by a Fedora user.
Changed in fedora: | |
importance: | Unknown → Undecided |
status: | Unknown → New |
Changed in libsdl1.2 (Ubuntu): | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in gentoo: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
Richard (shiningarcanine) wrote : | #13 |
Battle for Wesnoth implemented a workaround for the libsdl issue in the 1.8.x branch in svn commit r48934 and the 1.9.x trunk in svn commit r48935. It should be available for the general public in the 1.8.6 maintenance release.
Launchpad Janitor (janitor) wrote : | #14 |
This bug was fixed in the package libsdl1.2 - 1.2.14-6.1ubuntu3
---------------
libsdl1.2 (1.2.14-6.1ubuntu3) natty; urgency=low
* Replace memcpy by memmove in SDL_blit.c, as per SDL bug 1090
see http://
(LP: #725044).
-- <email address hidden> (Dr. David Alan Gilbert) Sun, 13 Mar 2011 01:05:52 +0000
Changed in libsdl1.2 (Ubuntu Natty): | |
status: | Triaged → Fix Released |
Changed in libsdl: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
https:/ /gna.org/ bugs/index. php?17573