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

SIGSEGV fault in odm_meshing #659

dakotabenjamin opened this Issue Aug 28, 2017 · 1 comment


None yet
2 participants

dakotabenjamin commented Aug 28, 2017

So i'm trying to update ODM so it will actually work with 16.10+ starting with #644 .

gdb debug:

Starting program: /home/ubuntu/opendronemap/build/bin/odm_meshing -inputFile /vagrant_data/Toledo/opensfm/depthmaps/merged.ply -outputFile /vagrant_data/Toledo/odm_meshing/odm_mesh.ply -logFile /vagrant_data/Toledo/odm_meshing/odm_meshing_log.txt -maxVertexCount 100000 -octreeDepth 9 -samplesPerNode 1.0 -solverDivide 9 -verbose
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
Successfully loaded 2876685 points with corresponding normals from file.
Octree depth used for reconstruction is: 9
Estimated initial vertex count: 262144

Reconstruction complete:
Vertex count: 273184
Triangle count: 546103

Decimating mesh, removing 63.3946 percent of vertices.
Decimation complete.
Decimated vertex count: 100073
Decimated triangle count: 199901

Breakpoint 1, OdmMeshing::writePlyFile (this=0x7fffffffe030) at /home/ubuntu/opendronemap/modules/odm_meshing/src/OdmMeshing.cpp:351
351     {
(gdb) next
352         log_ << "Saving mesh to file.\n";
Saving mesh to file.
353         if (pcl::io::savePLYFile(outputFile_.c_str(), *mesh_.get())  == -1) {
359                  << outputFile_ << "\n";
Successfully wrote mesh to:
361     }
OdmMeshing::run (this=0x7fffffffe030, argc=16, argv=0x7fffffffe388) at /home/ubuntu/opendronemap/modules/odm_meshing/src/OdmMeshing.cpp:79
79          log_.printToFile(logFilePath_);
80          return EXIT_SUCCESS;
81      }
main (argc=16, argv=0x7fffffffe388) at /home/ubuntu/opendronemap/modules/odm_meshing/src/main.cpp:17
17          OdmMeshing meshCreator;

Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x91) at malloc.c:2965
2965    malloc.c: No such file or directory.
(gdb) bt
#0  __GI___libc_free (mem=0x91) at malloc.c:2965
#1  0x00005555555a7d7f in boost::checked_delete<pcl::Poisson<pcl::PointNormal> > (x=0x55555580fe70) at /usr/include/boost/core/checked_delete.hpp:34
#2  0x00005555555ae244 in boost::detail::sp_counted_impl_p<pcl::Poisson<pcl::PointNormal> >::dispose (this=0x5555557fc3e0) at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78
#3  0x000055555559b0a0 in boost::detail::sp_counted_base::release (this=0x5555557fc3e0) at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:146
#4  0x000055555559b133 in boost::detail::shared_count::~shared_count (this=0x7fffffffe1c8, __in_chrg=<optimized out>) at /usr/include/boost/smart_ptr/detail/shared_count.hpp:473
#5  0x00005555555a20ee in boost::shared_ptr<pcl::Poisson<pcl::PointNormal> >::~shared_ptr (this=0x7fffffffe1c0, __in_chrg=<optimized out>) at /usr/include/boost/smart_ptr/shared_ptr.hpp:336
#6  0x000055555559ce76 in OdmMeshing::~OdmMeshing (this=0x7fffffffe030, __in_chrg=<optimized out>) at /home/ubuntu/opendronemap/modules/odm_meshing/src/OdmMeshing.cpp:26
#7  0x000055555559a8ac in main (argc=16, argv=0x7fffffffe388) at /home/ubuntu/opendronemap/modules/odm_meshing/src/main.cpp:17
(gdb) Quit

To recreate, in a 16.10 clean build, clone ODM and pull #644. then apply the following patch:

I think there's something wrong deleting things from memory but I'm not well-versed enough in how memory management works in c++ to figure this out.


This comment has been minimized.


fredlllll commented Sep 1, 2017

it seems the error is happening in the destruction of the smart pointer to the pcl::Poisson object.

i saw that this is only used in OdmMeshing::createMesh. you could try to move the variable there and with that get around the smartpointer. after all there is no need for the object to be a member variable/smart pointer. also dynamic memory allocation isnt necessary here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment