Soldann / MORB_SLAM

MORB-SLAM: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM
GNU General Public License v3.0
29 stars 12 forks source link

Segmentation Fault when shutting down #57

Closed Soldann closed 2 years ago

Soldann commented 2 years ago

Segmentation fault occurs occasionally when shutting down. This occurs typically when closing the map without having moved much.

There is a print map does not exist in atlas right before the segmentation fault. Looking at the stack trace, the error occurs in TrackStereo when the main loop tries to start tracking a new frame in the middle of shutting down.

Ryan-Red commented 2 years ago
ERROR: There is not an active map in the atlas
--Type <RET> for more, q to quit, c to continue without paging--c

Thread 1 "stereo_inertial" received signal SIGSEGV, Segmentation fault.
__GI___pthread_mutex_lock (mutex=0x38) at ../nptl/pthread_mutex_lock.c:67
67      ../nptl/pthread_mutex_lock.c: No such file or directory.
(gdb) 
(gdb) backtrace 
#0  __GI___pthread_mutex_lock (mutex=0x38) at ../nptl/pthread_mutex_lock.c:67
#1  0x00007ffff7dd348b in __gthread_mutex_lock (__mutex=0x38) at /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:749
#2  std::mutex::lock() (this=0x38) at /usr/include/c++/9/bits/std_mutex.h:100
#3  std::unique_lock<std::mutex>::lock() (this=0x7ffffffb3900, this=0x7ffffffb3900) at /usr/include/c++/9/bits/unique_lock.h:141
#4  std::unique_lock<std::mutex>::unique_lock(std::mutex&) (__m=..., this=0x7ffffffb3900) at /usr/include/c++/9/bits/unique_lock.h:71
#5  ORB_SLAM3::Tracking::Track() (this=0x555593a2b9f0) at /home/ryan/MartinRea/MORB_SLAM/src/Tracking.cc:1797
#6  0x00007ffff7dd4c8c in ORB_SLAM3::Tracking::GrabImageStereo(cv::Mat const&, cv::Mat const&, double const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
    (this=this@entry=0x555593a2b9f0, imRectLeft=..., imRectRight=..., timestamp=@0x7fffffffceb8: 1657814453.7243478, filename="")
    at /home/ryan/MartinRea/MORB_SLAM/src/Tracking.cc:1439
#7  0x00007ffff7d820d8 in ORB_SLAM3::System::TrackStereo(cv::Mat const&, cv::Mat const&, double const&, std::vector<ORB_SLAM3::IMU::Point, std::allocator<OR--Type <RET> for more, q to quit, c to continue without paging--c
B_SLAM3::IMU::Point> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (this=0x7fffffffd5c0, imLeft=..., imRight=..., timestamp=@0x7fffffffceb8: 1657814453.7243478, vImuMeas=..., filename="") at /usr/include/c++/9/bits/basic_string.h:940
#8  0x0000555555565e8a in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/include/c++/9/bits/basic_string.h:267