cwi-dis / cwi-pcl-codec

Point Cloud Codec invented by Rufael Mekuria, based on PCL (Point Cloud Library)
Other
48 stars 18 forks source link

crush in a sequence of pointclouds #9

Closed yonasteodros closed 4 years ago

yonasteodros commented 4 years ago

Hello everyone , I tried to encode a sequence of point clouds in a while loop and the encoder managed to encode the first sequence but in the second loop I have got a segmentation fault . I have attached the GDB: If it can help.

1  __GI___libc_free                                                                                                                                                                                                                                            malloc.c                       3103 0x7fffe83bd98d 
2  Eigen::internal::handmade_aligned_free                                                                                                                                                                                                                      Memory.h                       98   0x5555556db80e 
3  Eigen::internal::aligned_free                                                                                                                                                                                                                               Memory.h                       179  0x5555556db80e 
4  Eigen::aligned_allocator<pcl::PointXYZRGB>::deallocate                                                                                                                                                                                                      Memory.h                       747  0x5555556db80e 
5  std::allocator_traits<Eigen::aligned_allocator<pcl::PointXYZRGB>>::deallocate                                                                                                                                                                               alloc_traits.h                 328  0x5555556db80e 
6  std::_Vector_base<pcl::PointXYZRGB, Eigen::aligned_allocator<pcl::PointXYZRGB>>::_M_deallocate                                                                                                                                                              stl_vector.h                   180  0x5555556db80e 
7  std::_Vector_base<pcl::PointXYZRGB, Eigen::aligned_allocator<pcl::PointXYZRGB>>::~_Vector_base                                                                                                                                                              stl_vector.h                   162  0x5555556db80e 
8  std::vector<pcl::PointXYZRGB, Eigen::aligned_allocator<pcl::PointXYZRGB>>::~vector                                                                                                                                                                          stl_vector.h                   435  0x5555556db80e 
9  pcl::PointCloud<pcl::PointXYZRGB>::~PointCloud                                                                                                                                                                                                              point_cloud.h                  177  0x5555556db80e 
10 boost::checked_delete<pcl::PointCloud<pcl::PointXYZRGB>>                                                                                                                                                                                                    checked_delete.hpp             34   0x5555556db80e 
11 boost::detail::sp_counted_impl_p<pcl::PointCloud<pcl::PointXYZRGB>>::dispose                                                                                                                                                                                sp_counted_impl.hpp            92   0x5555556db80e 
12 boost::detail::sp_counted_base::release                                                                                                                                                                                                                     sp_counted_base_std_atomic.hpp 110  0x5555556cfb0a 
13 boost::detail::shared_count::~shared_count                                                                                                                                                                                                                  shared_count.hpp               426  0x555555705ffb 
14 boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>::~shared_ptr                                                                                                                                                                                     shared_ptr.hpp                 341  0x5555557114ea 
15 boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>::operator=                                                                                                                                                                                       shared_ptr.hpp                 549  0x55555571d07f 
16 pcl::octree::OctreePointCloud<pcl::PointXYZRGB, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty, pcl::octree::Octree2BufBase<pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty>>::setInputCloud       octree_pointcloud.h            112  0x555555714597 
17 pcl::io::OctreePointCloudCodecV2<pcl::PointXYZRGB, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty, pcl::octree::Octree2BufBase<pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty>>::encodePointCloud point_cloud_codec_v2_impl.hpp  93   0x555555706d99 

18 sequencencoder::compression                                                                                                                                                                                                                             sequencencoder.cpp         118  0x5555556eb322 
keesblom commented 4 years ago

Hello Yonasteodros,

at first glance this looks like a memory corruption problem:, e.g. may be somewhere in your software ‘free’ was called (maybe indirectly) with an invalid pointer, or memory was modified that had been free’d, etc. To find errors like this some specialised tools maybe useful, e.g. ‘valgrind’ on Ubuntu.

Hope this helps a bit.

Kees Blom.

On 18 Feb 2020, at 12:30,yonasteodros notifications@github.com wrote:

Hello everyone , I tried to encode a sequence of point clouds in a while loop and the encoder managed to encode the first sequence but in the second loop I have got a segmentation fault . I have attached the GDB: If it can help.

1 __GI___libc_free malloc.c 3103 0x7fffe83bd98d 2 Eigen::internal::handmade_aligned_free Memory.h 98 0x5555556db80e 3 Eigen::internal::aligned_free Memory.h 179 0x5555556db80e 4 Eigen::aligned_allocator::deallocate Memory.h 747 0x5555556db80e 5 std::allocator_traits<Eigen::aligned_allocator>::deallocate alloc_traits.h 328 0x5555556db80e 6 std::_Vector_base<pcl::PointXYZRGB, Eigen::aligned_allocator>::_M_deallocate stl_vector.h 180 0x5555556db80e 7 std::_Vector_base<pcl::PointXYZRGB, Eigen::aligned_allocator>::~_Vector_base stl_vector.h 162 0x5555556db80e 8 std::vector<pcl::PointXYZRGB, Eigen::aligned_allocator>::~vector stl_vector.h 435 0x5555556db80e 9 pcl::PointCloud::~PointCloud point_cloud.h 177 0x5555556db80e 10 boost::checked_delete<pcl::PointCloud> checked_delete.hpp 34 0x5555556db80e 11 boost::detail::sp_counted_impl_p<pcl::PointCloud>::dispose sp_counted_impl.hpp 92 0x5555556db80e 12 boost::detail::sp_counted_base::release sp_counted_base_std_atomic.hpp 110 0x5555556cfb0a 13 boost::detail::shared_count::~shared_count shared_count.hpp 426 0x555555705ffb 14 boost::shared_ptr<pcl::PointCloud const>::~shared_ptr shared_ptr.hpp 341 0x5555557114ea 15 boost::shared_ptr<pcl::PointCloud const>::operator= shared_ptr.hpp 549 0x55555571d07f 16 pcl::octree::OctreePointCloud<pcl::PointXYZRGB, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty, pcl::octree::Octree2BufBase<pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty>>::setInputCloud octree_pointcloud.h 112 0x555555714597 17 pcl::io::OctreePointCloudCodecV2<pcl::PointXYZRGB, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty, pcl::octree::Octree2BufBase<pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty>>::encodePointCloud point_cloud_codec_v2_impl.hpp 93 0x555555706d99

18 sequencencoder::compression sequencencoder.cpp 118 0x5555556eb322

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

yonasteodros commented 4 years ago

Hello @keesblom ,

Thank you so much! I have solved this issue by specifying compiler options something like the following in my CMakeLists

set(CMAKE_CXX_FLAGS "-march=native -Wextra")