首页 > 解决方案 > Open3D 函数中的特征密集存储分段错误

问题描述

我需要使用 Open3D 库对 PointCloud 进行一些操作,但它给了我分段错误,调试器没有提供有关该问题的太多信息。这很奇怪,因为相同的代码在 Windows 上工作,但在 Ubuntu 上给出了这样的错误。

GDB 回溯输出:

#0  0x00005555555f5c77 in open3d::geometry::Geometry3D::ComputeMinBound(std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&) const (this=0x7fffffffd250, points=...) at /home/rufus/Open3D/cpp/open3d/geometry/Geometry3D.cpp:50
#1  0x000055555561d951 in open3d::geometry::PointCloud::GetMinBound() const (this=<optimized out>) at /home/rufus/Open3D/cpp/open3d/geometry/PointCloud.cpp:52
#2  0x0000555555622dcd in open3d::geometry::PointCloud::VoxelDownSample(double) const (this=0x7fffffffd250, voxel_size=0.01) at /home/rufus/Open3D/cpp/open3d/geometry/PointCloud.cpp:312
#3  0x000055555557a690 in colorCloudRegistrationOptimization(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>, boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&) ()
#4  0x000055555557d569 in main ()

Valgrind 输出:

==7030== Process terminating with default action of signal 11 (SIGSEGV)
==7030==  Access not within mapped region at address 0x10
==7030==    at 0x1A9C47: DenseStorage (DenseStorage.h:194)
==7030==    by 0x1A9C47: PlainObjectBase (PlainObjectBase.h:520)
==7030==    by 0x1A9C47: Matrix (Matrix.h:413)
==7030==    by 0x1A9C47: open3d::geometry::Geometry3D::ComputeMinBound(std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&) const (Geometry3D.cpp:50)
==7030==    by 0x1D1920: open3d::geometry::PointCloud::GetMinBound() const (PointCloud.cpp:52)
==7030==    by 0x1D6D9C: open3d::geometry::PointCloud::VoxelDownSample(double) const (PointCloud.cpp:312)
==7030==    by 0x12E68F: colorCloudRegistrationOptimization(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>, boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&) (in /home/rufus/HoloportationLinuxPart/san_holo/build/san_holo

我试图用 EIGEN_DONT_ALIGN_STATICALLY 编译它,但结果是一样的。

标签: c++linuxsegmentation-faulteigenopen3d

解决方案


由于 Valgrind 报告的地址是如此低的 0x10,它让我认为您正在使用指向对象或未初始化对象的 NULL 指针。


推荐阅读