-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Reading PLY file produces segmentation fault #675
Comments
I can confirm the bug. Segfault happens at the line
in |
I'm fed up with this poor PLY support 😡 From what I've debugged so far the seg fault happens in this loop when reading the first face. Program received signal SIGSEGV, Segmentation fault.
0x00007ffff721698c in __gnu_cxx::__normal_iterator<pcl::Vertices*, std::vector<pcl::Vertices, std::allocator<pcl::Vertices> > >::__normal_iterator (this=0x7fffffffb9a0, __i=@0x8: <error reading variable>) at /usr/include/c++/4.8/bits/stl_iterator.h:726
726 __normal_iterator(const _Iterator& __i) : _M_current(__i) { } Test fileply
format ascii 1.0
element vertex 4
property float x
property float y
property float z
element face 2
property list uchar int vertex_indices
end_header
0 0 0
0 0 1
0 1 0
0 1 1
3 0 1 2
3 2 1 3 |
Fixed via #1371 |
Is this fixed? I find this segfault with macOSX High Sierra 10.13.6 with Python 3.6. I test it with the test file above and it gives a segfault. |
PCL is still not officially supporting Python bindings. This means you are using custom Python bindings made from another project. It might happen that this project is still wrapping an older version of the library and that is why you're still experiencing this bug. |
This seems to still be occurring for me. My program: #include <pcl/visualization/cloud_viewer.h>
#include <pcl/io/ply_io.h>
int main() {
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>());
std::cout << "loading" << std::endl;
pcl::io::loadPLYFile("/home/rivertam/example.ply", *cloud);
std::cout << "loaded" << std::endl;
pcl::visualization::CloudViewer viewer("Simple Cloud Viewer");
viewer.showCloud(cloud);
while (!viewer.wasStopped()) { }
return 0;
}
and my CMakeLists.txt:
The output is:
I'm almost positive it's because of the PLY. I probably did something wrong (the ply may be even corrupt) but a segfault shouldn't happen anyways. |
The fix was applied in PCL 1.8 and you're using PCL 1.7 (released in 2014) which means either you'll have to backport it yourself or upgrade to a newer version of PCL. |
Some PLY files cannot be loaded and the PLYReader produces a segmentation fault.
Test code
Test file
Error
It happens only with "special" PLY files. I don't know what causes this bug
The text was updated successfully, but these errors were encountered: