Skip to content
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

运行 Segmentation fault 问题 #31

Closed
YongshuaiZ opened this issue Jun 17, 2024 · 1 comment
Closed

运行 Segmentation fault 问题 #31

YongshuaiZ opened this issue Jun 17, 2024 · 1 comment

Comments

@YongshuaiZ
Copy link

作者你好,我在最后一步运行时出现 Segmentation fault 问题,我已经将第三方库和主目录下的 -march=native 去掉了,但还是报错,同时我运行了 原有的ORB-SLAM2,发现没有这个问题,用gdb调试后发现错误出现在 g2o部分,虽有已经看到有人提过这个问题了,但自己尝试后依然无法解决,想问下应该怎么解决?

Thread 1 "sg_slam_tum" received signal SIGSEGV, Segmentation fault.
0x00007ffff3a11518 in g2o::EdgeSE3ProjectXYZOnlyPose::linearizeOplus() ()
from /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/Thirdparty/g2o/lib/libg2o.so
(gdb) bt
#0 0x00007ffff3a11518 in g2o::EdgeSE3ProjectXYZOnlyPose::linearizeOplus() ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/Thirdparty/g2o/lib/libg2o.so
#1 0x00007ffff7723088 in g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::buildSystem() ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/lib/libsg-slam.so
#2 0x00007ffff3a561c9 in g2o::OptimizationAlgorithmLevenberg::solve(int, bool) ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/Thirdparty/g2o/lib/libg2o.so
#3 0x00007ffff3a4ec3c in g2o::SparseOptimizer::optimize(int, bool) ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/Thirdparty/g2o/lib/libg2o.so
#4 0x00007ffff76fba4d in ORB_SLAM2::Optimizer::PoseOptimization(ORB_SLAM2::Frame*) ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/lib/libsg-slam.so
#5 0x00007ffff76b12ee in ORB_SLAM2::Tracking::TrackReferenceKeyFrame() ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/lib/libsg-slam.so
#6 0x00007ffff76b58c5 in ORB_SLAM2::Tracking::Track() ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/lib/libsg-slam.so
#7 0x00007ffff76b6695 in ORB_SLAM2::Tracking::GrabImageRGBD(cv::Mat const&, cv::Mat const&, double const&) ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/lib/libsg-slam.so
#8 0x00007ffff769e729 in ORB_SLAM2::System::TrackRGBD(cv::Mat const&, cv::Mat const&, double const&) ()
at /home/zhu/SlamProjects/Openloris-Scene/SG-SLAM/src/sg-slam/lib/libsg-slam.so
#9 0x0000555555564747 in main ()

@silencht
Copy link
Owner

silencht commented Jul 10, 2024

该问题曾参考:
raulmur/ORB_SLAM2#844
RainerKuemmerle/g2o#314
鉴于你所述情况,有以下建议:

  1. 清空主工程和第三方库g2o两个build目录所有文件,确保删除两个CMakeLists.txt中-march=native,重新编译g2o和slam主程序,确认效果;
  2. 清空主工程和第三方库g2o两个build目录所有文件,确保添加两个CMakeLists.txt中-march=native,重新编译g2o和slam主程序,确认效果;
  3. 检查你引用的PCL库-march=native问题,重新安装/编译PCL库并再次重复进行1、2步骤;
    (检查libsg-slam.so库的pcl引用库可使用ldd libsg-slam.so | grep pcl命令)
    (可参考 Error in `rtabmap': double free or corruption introlab/rtabmap#685 (comment) 等类似issue)
    期待你的进展。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants