NVIDIA-AI-IOT / cuPCL

A project demonstrating how to use the libs of cuPCL.
MIT License
573 stars 93 forks source link

Segmentation Fault depending on the point cloud in `cuCluster` #35

Open hycakir opened 1 year ago

hycakir commented 1 year ago

Hello,

I receive segmentation fault only for some point clouds and with small voxel size parameters to the cuCluster. It does not seem related to the point cloud size. If I make the voxel sizes larger, however, the segmentation fault disappears. I thought may be the number of voxels necessary for the volume is larger than INT_MAX, and it causes integer overflow but my calculation shows the required number of voxels is not even near the limit.

I could provide you with some point cloud data that produce the error, if you wish to reproduce.

Because the library is not open source, I cannot really debug. It looks like the cudaExtractClusterImpl::extract function tries to write into the output array, however, the position it tries to write is out of bounds.

// call stack inside the library
libcudacluster.so!cudaExtractClusterImpl::extract(float*, int, float*, unsigned int*)
libcudacluster.so!cudaExtractCluster::extract(float*, int, float*, unsigned int*)
// The limits of the  point cloud
// is [0m,0m,0m] to ~[3m, 2m, 6m] meters.
// I see segmentation faults for voxel size 0.05.
// for 0.1, I do not.
ecp.voxelX = 0.05;
ecp.voxelY = 0.05;
ecp.voxelZ = 0.05;