hku-mars / loam_livox

A robust LiDAR Odometry and Mapping (LOAM) package for Livox-LiDAR
GNU General Public License v2.0
1.43k stars 435 forks source link

livox_laserMapping crashed #58

Open zyjiang0571 opened 4 years ago

zyjiang0571 commented 4 years ago

Hi, I am trying to use the command: roslaunch loam_livox rosbag.launch + rosbag play HKU_ZYM.bag, but the process of livoxlaserMapping crashed right after I played the rosbag 20s or so, and I got the message as followed: *double free or corruption (out) [livox_laserMapping-3] process has died [pid 9970, exit code -6, cmd /home/jiang/catkin_ws/devel/lib/loam_livox/livox_laserMapping __name:=livox_laserMapping __log:=/home/jiang/.ros/log/0ad68f4c-85ea-11ea-9c8e-001e8c74d8da/livox_laserMapping-3.log]. log file: /home/jiang/.ros/log/0ad68f4c-85ea-11ea-9c8e-001e8c74d8da/livox_laserMapping-3.log**_

Screenshot from 2020-04-24 13-22-09

ziv-lin commented 4 years ago

From my experience, the "double free corruption" is mainly caused by the Eigen alignment issue, and the reason is various with the different environment (e.g. the version of GCC, Eigen, PCL and etc; different compile options). Here might be some suggestions that might help you.

  1. Using C++17 compile option (refer to issue https://github.com/hku-mars/loam_livox/issues/45 ).
  2. Update your Eigen, PCL.
  3. Address the problem by following the solution provided by Eigen. a. https://eigen.tuxfamily.org/dox/group__TopicWrongStackAlignment.html b. https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html
gaofei-forever commented 3 years ago

i meet this problem too. did you have solved? could you tell me how to solve the problem.

yiakwy-mapping-team commented 3 years ago

I also met this problem. in Linux docker environment + clion. gcc 7.5. Everything goes fine before starting the node. My environment works very well with many driving software. We deal with eigen carefully. The Eigen version is 3.3.7, and that of the PCL is 1.8.1.

I checked the gdb, it at first glance relates to Eigen memory alignment:

double free or corruption (out)

Thread 1 "livox_scanRegis" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff44eb921 in __GI_abort () at abort.c:79
#2  0x00007ffff4534967 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff4661b0d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff453b9da in malloc_printerr (str=str@entry=0x7ffff4663818 "double free or corruption (out)") at malloc.c:5342
#4  0x00007ffff4542f6a in _int_free (have_lock=0, p=0x555555989530, av=0x7ffff4896c40 <main_arena>) at malloc.c:4308
#5  __GI___libc_free (mem=0x555555989540) at malloc.c:3134
#6  0x000055555556c7c1 in Eigen::internal::aligned_free (ptr=<optimized out>) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:177
#7  Eigen::aligned_allocator<pcl::PointXYZI>::deallocate (this=0x7fffff9decb8, p=<optimized out>) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:763
#8  std::allocator_traits<Eigen::aligned_allocator<pcl::PointXYZI> >::deallocate (__a=..., __n=<optimized out>, __p=<optimized out>) at /usr/include/c++/7/bits/alloc

Here is clion snapshot in remote docker container

/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /tmp/tmp.UVW2xUU27H
-- Using CATKIN_DEVEL_PREFIX: /tmp/tmp.UVW2xUU27H/cmake-build-debug/devel
-- Using CMAKE_PREFIX_PATH: /catkin_ws/devel;/WorkSpace/Github/catkin_ws/devel;/opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /tmp/tmp.UVW2xUU27H/cmake-build-debug/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- execute_process : COMMAND;/usr/bin/python2;/opt/ros/melodic/share/catkin/cmake/parse_package_xml.py;/opt/ros/melodic/share/catkin/cmake/../package.xml;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin/catkin_generated/version/package.cmake
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- execute_process : COMMAND;/usr/bin/python2;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/generate_cached_setup.py
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- execute_process : COMMAND;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/env_cached.sh;/usr/bin/python2;/opt/ros/melodic/share/catkin/cmake/order_paths.py;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/ordered_paths.cmake;--paths-to-order;/opt/ros/melodic/include;/usr/include;/opt/ros/melodic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp;/usr/include/opencv;--prefixes;/tmp/tmp.UVW2xUU27H/cmake-build-debug/devel;/opt/ros/melodic
-- execute_process : COMMAND;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/env_cached.sh;/usr/bin/python2;/opt/ros/melodic/share/catkin/cmake/order_paths.py;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/ordered_paths.cmake;--paths-to-order;/opt/ros/melodic/lib;--prefixes;/tmp/tmp.UVW2xUU27H/cmake-build-debug/devel;/opt/ros/melodic
-- Found required Ceres dependency: Eigen version 3.3.7 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono
--   atomic
--   regex
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR) 
** WARNING ** io features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR) 
** WARNING ** io features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES) 
** WARNING ** io features related to dssdk will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

** WARNING ** io features related to libusb-1.0 will be disabled
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR) 
** WARNING ** visualization features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR) 
** WARNING ** visualization features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES) 
** WARNING ** visualization features related to dssdk will be disabled
-- Could NOT find RSSDK (missing: _RSSDK_LIBRARIES) 
** WARNING ** visualization features related to rssdk will be disabled
-- looking for PCL_COMMON
-- looking for PCL_OCTREE
-- looking for PCL_IO
-- looking for PCL_KDTREE
-- looking for PCL_SEARCH
-- looking for PCL_SAMPLE_CONSENSUS
-- looking for PCL_FILTERS
-- looking for PCL_2D
-- looking for PCL_GEOMETRY
-- looking for PCL_FEATURES
-- looking for PCL_ML
-- looking for PCL_SEGMENTATION
-- looking for PCL_VISUALIZATION
-- looking for PCL_SURFACE
-- looking for PCL_REGISTRATION
-- looking for PCL_KEYPOINTS
-- looking for PCL_TRACKING
-- looking for PCL_RECOGNITION
-- looking for PCL_STEREO
-- looking for PCL_APPS
-- looking for PCL_IN_HAND_SCANNER
-- looking for PCL_MODELER
-- looking for PCL_POINT_CLOUD_EDITOR
-- looking for PCL_OUTOFCORE
-- looking for PCL_PEOPLE
-- ***** PCL version: 1.8.1 *****
-- execute_process : COMMAND;/usr/bin/python2;/opt/ros/melodic/share/catkin/cmake/parse_package_xml.py;/tmp/tmp.UVW2xUU27H/package.xml;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/package.cmake
-- execute_process : COMMAND;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/env_cached.sh;/usr/bin/python2;/usr/bin/empy;--raw-errors;-F;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/pkg.develspace.context.pc.py;-o;/tmp/tmp.UVW2xUU27H/cmake-build-debug/devel/lib/pkgconfig/loam_livox.pc;/opt/ros/melodic/share/catkin/cmake/em/pkg.pc.em
-- execute_process : COMMAND;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/env_cached.sh;/usr/bin/python2;/usr/bin/empy;--raw-errors;-F;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/pkg.installspace.context.pc.py;-o;/tmp/tmp.UVW2xUU27H/cmake-build-debug/catkin_generated/installspace/loam_livox.pc;/opt/ros/melodic/share/catkin/cmake/em/pkg.pc.em
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/tmp.UVW2xUU27H/cmake-build-debug

[Finished]
yiakwy-mapping-team commented 3 years ago

From my experience, the "double free corruption" is mainly caused by the Eigen alignment issue, and the reason is various with the different environment (e.g. the version of GCC, Eigen, PCL and etc; different compile options). Here might be some suggestions that might help you.

1. Using C++17 compile option (refer to issue #45 ).

2. Update your Eigen, PCL.

3. Address the problem by following the solution provided by Eigen.
   a. https://eigen.tuxfamily.org/dox/group__TopicWrongStackAlignment.html
   b. https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html

carsh for mapping has nothing to do with Eigen.

yiakwy-mapping-team commented 3 years ago

updating PCL to 1.9 solved the problem:

loop_closure

gaofei-forever commented 3 years ago

@yiakwy-mapping-team Did you used pcl 1.9.0 ??

yiakwy-mapping-team commented 3 years ago

@yiakwy-mapping-team Did you used pcl 1.9.0 ??

Yes I have local installer to do this job. It also works for pcl-1.10.1 (with SSE patch). You can find pcl SSE patch in apollo.auto project.

Fellowflyingsky commented 2 years ago

i have meet this for many times i dont know how to solve yet .my gcc 9.1 eigen3.37 ceres2.0 pcl 1.9 can you help me best thanks

Fellowflyingsky commented 2 years ago

gcc 9.1 can allign eigen 3.37//

Fellowflyingsky commented 2 years ago

From my experience, the "double free corruption" is mainly caused by the Eigen alignment issue, and the reason is various with the different environment (e.g. the version of GCC, Eigen, PCL and etc; different compile options). Here might be some suggestions that might help you.

  1. Using C++17 compile option (refer to issue livox_laserMapping crashes #45 ).
  2. Update your Eigen, PCL.
  3. Address the problem by following the solution provided by Eigen. a. https://eigen.tuxfamily.org/dox/group__TopicWrongStackAlignment.html b. https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html

can you see my problem ,best thanks

Fellowflyingsky commented 2 years ago

From my experience, the "double free corruption" is mainly caused by the Eigen alignment issue, and the reason is various with the different environment (e.g. the version of GCC, Eigen, PCL and etc; different compile options). Here might be some suggestions that might help you.

1. Using C++17 compile option (refer to issue #45 ).

2. Update your Eigen, PCL.

3. Address the problem by following the solution provided by Eigen.
   a. https://eigen.tuxfamily.org/dox/group__TopicWrongStackAlignment.html
   b. https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html

carsh for mapping has nothing to do with Eigen.

can you see my problem ,best thanks

Fellowflyingsky commented 2 years ago

gcc 9.1 can allign eigen 3.37//

gcc 9.1 can allign eigen 3.37?