-
Notifications
You must be signed in to change notification settings - Fork 226
segmentation fault for pcl icp implementation in pytorch cpp extension #20
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
Comments
I'll check out the code, but I don't think this is a bug with C++ extensions per se. Did you run tests of your C++ code before binding it into Python, and made sure it was generally correct and does not segfault? |
Yes. I tried the pure C++ example. There is no segfault.
|
https://github.com/onlytailei/icp_extension/blob/master/icp_op.cpp#L88 looks wrong to me. Change
to
or even better, to
|
Thank you!
As soon as you uncomment this one, the segfault happen. |
From the debug info, it seems that some attributes of icp cannot be released successfully through boost smart pointer. However, I have no idea why nothing is wrong in pure cpp example. Maybe there is some conflict between boost and torch.
Another problem is that you mentioned torch::from_blob. Which extra header file should I include to use it? With torch/torch.h, it cannot find this function. |
For the I spent some time today trying to reproduce your bug in a docker container but I could not. I use this
and then everything seems to work pretty well:
Did you make any progress on your end? |
Thank you @goldsborough ! |
@onlytailei I am having the same issue. Were you able to resolve this problem? I am having segmentation fault at IterativeClosestPoint<pcl::PointXYZ, pcl::PointXYZ> icp; |
I am having the same issue. Were you able to resolve this problem? I am having segmentation fault at kdtree.setInputCloud(clouds); |
I’m trying to build a cpp extension for point cloud iterative closest point using the icp function in pcl-1.7 http://pointclouds.org/documentation/tutorials/iterative_closest_point.php.
The data transforming from at::tensor to pcl::Pointcloud is fine. However, as soon as I declare a new icp object, there will be a segmentation fault.
I also tried to add more arguments to the CppExtension as https://github.com/strawlab/python-pcl/blob/master/setup.py. But it doesn’t help.
To repeat the bug, you can clone the related files from https://github.com/onlytailei/icp_extension.
There should be pcl and eigen in the system
Then build the extension through:
Comment/Uncomment this line in icp_op.cpp.
And rebuild the extension, you will see the difference.
The text was updated successfully, but these errors were encountered: