dddooozzz9 / recastnavigation

Automatically exported from code.google.com/p/recastnavigation
zlib License
1 stars 0 forks source link

valgrind reports Source and destination overlap in memcpy #232

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected output? What do you see instead?

Calling rcBuildPolyMesh() on a simple mesh under valgrind reports a problem in 
Recast:

==10421== Source and destination overlap in memcpy(0x7c32c7c, 0x7c32c7c, 12)
==10421==    at 0x4C2CC30: memcpy@@GLIBC_2.14 (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10421==    by 0x4F66897: rcBuildPolyMesh(rcContext*, rcContourSet&, int, 
rcPolyMesh&) (string3.h:52)

It looks like we are calling memcpy with the same pointer as source and 
destination arguments. Reading quickly recast source-code, it seems to be when 
merging polygons in RecastMesh.cpp:1108:
memcpy(pb, &polys[(npolys-1)*nvp], sizeof(unsigned short)*nvp);

What version of the product are you using? On what operating system?
Running on Ubuntu 12.10 64bits.

Please provide any additional information below.

Original issue reported on code.google.com by jeremy.c...@gmail.com on 5 Feb 2013 at 1:42

GoogleCodeExporter commented 8 years ago
Fixed in github repo:
https://github.com/memononen/recastnavigation

Original comment by memono...@gmail.com on 17 Sep 2013 at 7:19