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:

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.

I just noticed that sys-libs/glibc-2.13-r1 is keyworded, so anyone affected by 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.

(In reply to comment #2)
> I just noticed that sys-libs/glibc-2.13-r1 is keyworded, so anyone affected by
> 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.

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:

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.

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.