Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash in nearestKSearch when using enableDynamicDepth #1232

Closed
EJKerr opened this issue May 8, 2015 · 1 comment · Fixed by #4657
Closed

crash in nearestKSearch when using enableDynamicDepth #1232

EJKerr opened this issue May 8, 2015 · 1 comment · Fixed by #4657
Labels
kind: bug Type of issue module: octree needs: testing Specify why not closed/merged yet

Comments

@EJKerr
Copy link

EJKerr commented May 8, 2015

If I build an octree using enableDynamicDepth, the nearestKSearch crashes with an access violation. It seems to be mis-identifying the node type, thinking that a leaf node is a branch node, and trying too traverse too deeply. Avoiding enableDynamicDepth prevents the crash.

In octree_search.hpp,:
pcl::octree::OctreePointCloudSearch<PointT, LeafContainerT, BranchContainerT>::getKNearestNeighborRecursive ...

    if (tree_depth < this->octree_depth_)   // Doesn't the node know if it's is a branch/leaf ? 
    {
      // we have not reached maximum tree depth
      smallest_squared_dist = getKNearestNeighborRecursive (point, K, static_cast<const BranchNode*> (child_node), new_key, tree_depth + 1,
                                                            smallest_squared_dist, point_candidates);
    }
    else
    {
      // we reached leaf node level
@stale
Copy link

stale bot commented May 19, 2020

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Type of issue module: octree needs: testing Specify why not closed/merged yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants