On 10/11/10 21:17, Jed Brown wrote:
I think any software that ignores the ISO warning
"If copying takes place between objects that overlap, the behavior is
undefined" needs fixing.
Absolutely, it is incorrect and should be fixed.
Having just replaced the memcpy with Linus safe forward-copy version
from https://bugzilla.redhat.com/show_bug.cgi?id=638477#c38 I can report
no more problems with my Open MPI program which was previously behaving
unpredictably after calls to memcpy with overlapping ranges.
*** Fedora 14 x86_64 and other 64-bit glibc 2.12 distros break Open MPI ***
As for a fix, I suspect glibc developers will dig their heels in, so how
do we fix Open MPI? We could just replace memcpy call with memmove. This
has to be better than rolling an MPI-specific memory copy function for
every architecture.
Simon H.