Bug 281828 - false memmove warning: "Source and destination overlap in memcpy"
Summary: false memmove warning: "Source and destination overlap in memcpy"
Status: RESOLVED DUPLICATE of bug 275284
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.6.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-11 21:02 UTC by Sergio Martins
Modified: 2011-09-11 21:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Martins 2011-09-11 21:02:09 UTC
Version:           3.6.0 (using KDE 4.7.1) 
OS:                Linux

#include <string.h>
#include <iostream>

int main()
{
  int a[4] = { 0, 1, 2, 3 };

  memmove( a, a+1, 2*sizeof(int) );
  
  std::cout << a[0];
  std::cout << a[1];
  std::cout << a[2];
  std::cout << a[3];

  return 0;
}

Results in:

==30707== Source and destination overlap in memcpy(0x7ff000080, 0x7ff000084, 8)
==30707==    at 0x4C27B46: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30707==    by 0x400753: main (main.cpp:8)


Reproducible: Always

Steps to Reproduce:
.

Actual Results:  
.

Expected Results:  
.

I'm using valgrind 3.6.1, glibc 2.14, gcc 4.6.1, 64 bit archlinux
Comment 1 Tom Hughes 2011-09-11 21:41:59 UTC

*** This bug has been marked as a duplicate of bug 275284 ***