eglibc (2.13-7) unstable; urgency=low
Starting with version 2.13, eglibc provides an SSSE3 optimized version
of memcpy() on the amd64 architecture. This version might copy memory
backward in some conditions, which causes issues if the source and
destination overlap. memmove() should be used in such cases, but some
programs still wrongly use memcpy().
For this reason, on the amd64 architecture the Debian package provides
two wrappers which can be use to workaround and/or debug the issue:
- /usr/lib/x86_64-linux-gnu/libc/memcpy-preload.so simply replace all
calls to memcpy() by a call to memmove()
- /usr/lib/x86_64-linux-gnu/libc/memcpy-syslog-preload.so does the same,
but in addition logs (with rate limit) the issue to syslog, so that it
can be detected and fixed.
To use these wrapper on a single binary, the easiest way is to use the
LD_PRELOAD environment variable:
- LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libc/memcpy-preload.so /path/to/binary
- LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libc/memcpy-syslog-preload.so /path/to/binary
For system-wide usage, it is possible to add the path of one of the
wrapper to /etc/ld.so.preload.
For more details about the issue, please see:
http://bugs.debian.org/625521
http://sourceware.org/bugzilla/show_bug.cgi?id=12518