PointCloudLibrary / PointCloudLibrary/pcl
Kinfu MarchingCubes writes unbounded data to hardcode sized buffer
Open
@haritha-j is already working on this.
Since Jun 8, 2020.
help wanted
kind: bug
module: gpu
skill: cuda
status: stale
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
pcl::gpu::MarchingCubes::run:
if (triangles_buffer.empty())
triangles_buffer.create(DEFAULT_TRIANGLES_BUFFER_SIZE);
DEFAULT_TRIANGLES_BUFFER_SIZE = 2 * 1000 * 1000 * POINTS_PER_TRIANGLE
marching_cubes.cu/store_point():
triangles_buffer[index] = ...; // index is dependent on how many voxels we have
I suggest changing DEFAULT_TRIANGLES_BUFFER_SIZE to WHY_WOULD_ANYONE_EVER_HAVE_MORE_TRIANGLES, that will make the out of bounds crash on the GPU much easier to find.
I also like how it starts with 2 * - that looks almost like somebody thought "hmm for some reason the code works if I make this bigger".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.