tum-vision / lsd_slam

LSD-SLAM
GNU General Public License v3.0
2.59k stars 1.23k forks source link

Crash on running live_slam #161

Closed mihaibujanca closed 8 years ago

mihaibujanca commented 8 years ago

I'm on Ubuntu 14.04.3 x64, using ROS indigo. When I'm trying to run live_slam, I'm getting (straight, away, no frames seem to be processed) live_slam: /usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h:91: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double, int Size = 4, int MatrixOrArrayOptions = 0]: Assertion(reinterpret_cast(array) & (32-1)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " READ THIS WEB PAGE !!! "' failed.`

Backtrace:

#0  0x00007ffff52cecc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff52d20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff52c7b86 in __assert_fail_base (
    fmt=0x7ffff5418830 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x7ffff7910da8 "(reinterpret_cast<size_t>(array) & (32-1)) == 0 && \"this assertion is explained here: \" \"http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html\" \" **** READ THIS WEB PAGE !!! ****\"", 
    file=file@entry=0x7ffff7910d70 "/usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h", line=line@entry=91, 
    function=function@entry=0x7ffff79116a0 <Eigen::internal::plain_array<double, 4, 0, 32>::plain_array()::__PRETTY_FUNCTION__> "Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double, int Size = 4, int MatrixOrArrayOptions = 0]") at assert.c:92
#3  0x00007ffff52c7c32 in __GI___assert_fail (
    assertion=0x7ffff7910da8 "(reinterpret_cast<size_t>(array) & (32-1)) == 0 && \"this assertion is explained here: \" \"http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html\" \" **** READ THIS WEB PAGE !!! ****\"", 
    file=0x7ffff7910d70 "/usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h"---Type <return> to continue, or q <return> to quit---
, line=91, 
    function=0x7ffff79116a0 <Eigen::internal::plain_array<double, 4, 0, 32>::plain_array()::__PRETTY_FUNCTION__> "Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double, int Size = 4, int MatrixOrArrayOptions = 0]") at assert.c:101
#4  0x00007ffff76ff5ef in Eigen::internal::plain_array<double, 4, 0, 32>::plain_array (this=0x6f4e30)
    at /usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h:91
#5  0x00007ffff76fd89a in Eigen::DenseStorage<double, 4, 4, 1, 0>::DenseStorage
    (this=0x6f4e30)
    at /usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h:131
#6  0x00007ffff76fb2a6 in Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 1, 0, 4, 1> >::PlainObjectBase (this=0x6f4e30)
    at /usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h:450
#7  0x00007ffff76f8498 in Eigen::Matrix<double, 4, 1, 0, 4, 1>::Matrix (
    this=0x6f4e30) at /usr/local/include/eigen3/Eigen/src/Core/Matrix.h:209
#8  0x00007ffff779702e in Eigen::Quaternion<double, 0>::Quaternion (
    this=0x6f4e30)
    at /usr/local/include/eigen3/Eigen/src/Geometry/Quaternion.h:242
#9  0x00007ffff229f2a0 in g2o::SE3Quat::SE3Quat() ()
---Type <return> to continue, or q <return> to quit---
   from /opt/ros/indigo/lib/libg2o_types_sba.so
#10 0x00007ffff229fc56 in g2o::SBACam::SBACam() ()
   from /opt/ros/indigo/lib/libg2o_types_sba.so
#11 0x00007ffff22a5a6f in g2o::BaseVertex<6, g2o::SBACam>::BaseVertex() ()
   from /opt/ros/indigo/lib/libg2o_types_sba.so
#12 0x00007ffff2298f74 in g2o::VertexCam::VertexCam() ()
   from /opt/ros/indigo/lib/libg2o_types_sba.so
#13 0x00007ffff22cc298 in g2o::HyperGraphElementCreator<g2o::VertexCam>::construct() () from /opt/ros/indigo/lib/libg2o_types_sba.so
#14 0x00007ffff2a39331 in g2o::Factory::registerType(std::string const&, g2o::AbstractHyperGraphElementCreator*) () from /opt/ros/indigo/lib/libg2o_core.so
#15 0x00007ffff22a5396 in g2o::RegisterTypeProxy<g2o::VertexCam>::RegisterTypeProxy(std::string const&) () from /opt/ros/indigo/lib/libg2o_types_sba.so
#16 0x00007ffff229db7c in ?? () from /opt/ros/indigo/lib/libg2o_types_sba.so
#17 0x00007ffff229e015 in ?? () from /opt/ros/indigo/lib/libg2o_types_sba.so
#18 0x00007ffff7dea13a in call_init (l=<optimized out>, argc=argc@entry=3, 
    argv=argv@entry=0x7fffffffdab8, env=env@entry=0x7fffffffdad8)
    at dl-init.c:78
#19 0x00007ffff7dea223 in call_init (env=<optimized out>, argv=<optimized out>, 
    argc=<optimized out>, l=<optimized out>) at dl-init.c:36
---Type <return> to continue, or q <return> to quit---
#20 _dl_init (main_map=0x7ffff7ffe1c8, argc=3, argv=0x7fffffffdab8, 
    env=0x7fffffffdad8) at dl-init.c:126
#21 0x00007ffff7ddb30a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#22 0x0000000000000003 in ?? ()
#23 0x00007fffffffde8f in ?? ()
#24 0x00007fffffffdec7 in ?? ()
#25 0x00007fffffffded8 in ?? ()
#26 0x0000000000000000 in ?? ()

While I looked at both issue #14 and #3 neither of them seem to actually have the same issue, as per the stack trace. Mine seems to be related to g2o, and more specifically, seem to have to do with either of G2O_REGISTER_TYPE(VERTEX_SIM3_SOPHUS:EXPMAP, VertexSim3); G2O_REGISTER_TYPE(EDGE_SIM3_SOPHUS:EXPMAP, EdgeSim3); in g2oTypeSim3Sophus.cpp, since that's the only place where g2o::RegisterTypeProxy might be called from.

mihaibujanca commented 8 years ago

Update: after some digging, it looks as if the problem is caused in rosConfigure.h. If I comment out everything inside the methods there, it doesn't fail with the same error (of course it fails afterwards, as configs are all over the place), but anyway, looks like if I change anything that's in settings.h, it crashes with the error I mentioned.

Both

freeDebugParam1 = config.freeDebugParam1;
freeDebugParam1 = 1;

Will result in the error.

I'll update again after I dig into the settings a bit.

Also this happens regardless of the input or calib file I am providing

mihaibujanca commented 8 years ago

Solved: It worked for me after I removed -march=native from my CMakeLists.txt So

set(CMAKE_CXX_FLAGS
  "${CMAKE_CXX_FLAGS} ${SSE_FLAGS} -g -Wall -std=c++0x"
)

instead of

set(CMAKE_CXX_FLAGS
 "${CMAKE_CXX_FLAGS} ${SSE_FLAGS} -g -march=native -Wall -std=c++0x"
 )