<div>Apparently there is a change coming in glibc which can trigger silent data corruption bugs in existing software that misuses memcpy with overlapping regions.</div>   <a href="http://lwn.net/Articles/414467/#Comments" target="_blank">http://lwn.net/Articles/414467/#Comments</a><div>


<br></div><div><div>Perhaps alpha versions of Natty or Natty+1 should test for this (using LD_PRELOAD or a modified glibc), and emit a backtrace to apport when memcpy is called with overlapping regions?</div>
<div><br></div><div>This would reduce performance somewhat, but alpha versions are for finding bugs, not running fast. Even though testing for overlapping regions could take a large part of the time taken by small memcpy's, apparently less than 1% of time is typically in memcpy, so this shouldn't have a significant effect on system-wide performance.<br>


<div><br></div><div>Valgrind also emits this warning, but it seems important that this gets widespread testing, and even in alpha versions running everything under Valgrind by default is not acceptable.</div><div><br></div>


<div>-- <br>John C. McCabe-Dansted<br>
</div></div></div>