colmap / colmap

COLMAP - Structure-from-Motion and Multi-View Stereo
https://colmap.github.io/
Other
7.84k stars 1.54k forks source link

core dumped when start reconstruction #87

Closed qiuyuanWang closed 7 years ago

qiuyuanWang commented 7 years ago

Hi, all

I met some question when I started reconstruction. There is the bug report:

Error in `colmap': double free or corruption (out): 0x00007f23c04f19e0 Aborted at 1489130959 (unix time) try "date -d @1489130959" if you are using GNU date PC: @ 0x7f240172dc37 (unknown) SIGABRT (@0x3e800006557) received by PID 25943 (TID 0x7f23c9ffb700) from PID 25943; stack trace: @ 0x7f24040f1330 (unknown) @ 0x7f240172dc37 (unknown) @ 0x7f2401731028 (unknown) @ 0x7f240176a2a4 (unknown) @ 0x7f240177655e (unknown) @ 0x7f24046a6962 ceres::internal::DenseSchurComplementSolver::SolveReducedLinearSystem() @ 0x7f24046a45da ceres::internal::SchurComplementSolver::SolveImpl() @ 0x7f24045ed7f5 ceres::internal::TypedLinearSolver<>::Solve() @ 0x7f240465bfe2 ceres::internal::LevenbergMarquardtStrategy::ComputeStep() @ 0x7f24046cebb9 ceres::internal::TrustRegionMinimizer::ComputeTrustRegionStep() @ 0x7f24046d264c ceres::internal::TrustRegionMinimizer::Minimize() @ 0x7f24046bafe2 ceres::Solver::Solve() @ 0x7f24046bc319 ceres::Solve() @ 0x7148f6 colmap::BundleAdjuster::Solve() @ 0x584d9c colmap::IncrementalMapper::AdjustGlobalBundle() @ 0x57c381 colmap::(anonymous namespace)::AdjustGlobalBundle() @ 0x57e5a3 colmap::IncrementalMapperController::Reconstruct() @ 0x57fdf2 colmap::IncrementalMapperController::Run() @ 0x65574c colmap::Thread::RunFunc() @ 0x7f2402298a60 (unknown) @ 0x7f24040e9184 start_thread @ 0x7f24017f137d (unknown) @ 0x0 (unknown) [1] 25943 abort (core dumped) colmap

There is my colmap cmake report:

-- Boost version: 1.54.0 -- Found the following Boost libraries: -- program_options -- filesystem -- regex -- system -- unit_test_framework -- Found Eigen3 -- Includes : /usr/local/include/eigen3 -- Found FreeImage -- Includes : /usr/include -- Libraries : /usr/lib/libfreeimage.so -- Found Glog -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libglog.so -- Found required Ceres dependency: Eigen version 3.3.90 in /usr/local/include/eigen3/ -- Found required Ceres dependency: glog -- Found required Ceres dependency: gflags -- Ceres version 1.12.0 detected here: /usr/local was built with C++11. Ceres target will add C++11 flags to compile options for targets using it. -- Found Ceres version: 1.12.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, C++11, OpenMP] -- Found Glew -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so -- Found Qt 5.2.1 -- Build type not specified, using RelWithDebInfo -- Enabling OpenMP support -- Disabling link-time optimization (-flto) -- Disabling CUDA support -- Disabling profiling support -- Configuring done -- Generating done -- Build files have been written to: /home/wqy/Documents/colmap/build

Besides, when I run "make test", I get 4 tests failed:

Test project /home/wqy/Documents/colmap/build Start 1: base/camera_database_test 1/57 Test #1: base/camera_database_test ............... Passed 0.01 sec Start 2: base/camera_models_test 2/57 Test #2: base/camera_models_test ................. Passed 0.03 sec Start 3: base/camera_rig_test 3/57 Test #3: base/camera_rig_test .................... Passed 0.69 sec Start 4: base/camera_test 4/57 Test #4: base/camera_test ........................ Passed 0.08 sec Start 5: base/cost_functions_test 5/57 Test #5: base/cost_functions_test ................ Passed 0.04 sec Start 6: base/database_cache_test 6/57 Test #6: base/database_cache_test ................ Passed 0.11 sec Start 7: base/database_test 7/57 Test #7: base/database_test ...................... Passed 0.34 sec Start 8: base/essential_matrix_utils_test

Error in `/home/wqy/Documents/colmap/build/src/base/essential_matrix_utils_test': double free or corruption (out): 0x0000000001c22340

8/57 Test #8: base/essential_matrix_utils_test ........Failed 0.21 sec Start 9: base/feature_test 9/57 Test #9: base/feature_test ....................... Passed 0.07 sec Start 10: base/feature_extraction_test 10/57 Test #10: base/feature_extraction_test ............ Passed 4.73 sec Start 11: base/feature_matching_test 11/57 Test #11: base/feature_matching_test ..............Exception: SegFault 1.47 sec Start 12: base/homography_matrix_utils_test 12/57 Test #12: base/homography_matrix_utils_test ....... Passed 0.11 sec Start 13: base/image_test 13/57 Test #13: base/image_test ......................... Passed 0.12 sec Start 14: base/line_test 14/57 Test #14: base/line_test .......................... Passed 0.05 sec Start 15: base/point2d_test 15/57 Test #15: base/point2d_test ....................... Passed 0.07 sec Start 16: base/point3d_test 16/57 Test #16: base/point3d_test ....................... Passed 0.11 sec Start 17: base/polynomial_test 17/57 Test #17: base/polynomial_test .................... Passed 0.04 sec Start 18: base/pose_test 18/57 Test #18: base/pose_test .......................... Passed 0.31 sec Start 19: base/projection_test 19/57 Test #19: base/projection_test .................... Passed 0.17 sec Start 20: base/reconstruction_test 20/57 Test #20: base/reconstruction_test ................ Passed 0.25 sec Start 21: base/reconstruction_manager_test 21/57 Test #21: base/reconstruction_manager_test ........ Passed 0.22 sec Start 22: base/scene_graph_test 22/57 Test #22: base/scene_graph_test ................... Passed 0.10 sec Start 23: base/similarity_transform_test 23/57 Test #23: base/similarity_transform_test .......... Passed 0.09 sec Start 24: base/track_test 24/57 Test #24: base/track_test ......................... Passed 0.04 sec Start 25: base/triangulation_test 25/57 Test #25: base/triangulation_test ................. Passed 0.17 sec Start 26: base/undistortion_test 26/57 Test #26: base/undistortion_test .................. Passed 0.52 sec Start 27: base/visibility_pyramid_test 27/57 Test #27: base/visibility_pyramid_test ............ Passed 0.08 sec Start 28: base/warp_test 28/57 Test #28: base/warp_test .......................... Passed 0.21 sec Start 29: estimators/coordinate_frame_test 29/57 Test #29: estimators/coordinate_frame_test ........ Passed 0.24 sec Start 30: estimators/epnp_test 30/57 Test #30: estimators/epnp_test .................... Passed 0.10 sec Start 31: estimators/essential_matrix_test 31/57 Test #31: estimators/essential_matrix_test ........ Passed 0.08 sec Start 32: estimators/fundamental_matrix_test 32/57 Test #32: estimators/fundamental_matrix_test ...... Passed 0.04 sec Start 33: estimators/gp3p_test 33/57 Test #33: estimators/gp3p_test .................... Passed 0.20 sec Start 34: estimators/homography_matrix_test 34/57 Test #34: estimators/homography_matrix_test ....... Passed 0.08 sec Start 35: estimators/p3p_test 35/57 Test #35: estimators/p3p_test ..................... Passed 0.14 sec Start 36: estimators/translation_transform_test 36/57 Test #36: estimators/translation_transform_test ... Passed 0.04 sec Start 37: estimators/utils_test 37/57 Test #37: estimators/utils_test ................... Passed 0.14 sec Start 38: mvs/depth_map_test 38/57 Test #38: mvs/depth_map_test ...................... Passed 0.00 sec Start 39: mvs/mat_test 39/57 Test #39: mvs/mat_test ............................ Passed 0.00 sec Start 40: mvs/normal_map_test 40/57 Test #40: mvs/normal_map_test ..................... Passed 0.00 sec Start 41: optim/bundle_adjustment_test

Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x000000000262db20 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x0000000002680340 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x00000000026d32a0 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x00000000027257e0 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x000000000277b520 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x00000000027f7fe0 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x0000000002852120 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x00000000028ae960 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x0000000002908720 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x000000000296e440 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x0000000002a15700 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x0000000002ab3440 Error in `/home/wqy/Documents/colmap/build/src/optim/bundle_adjustment_test': double free or corruption (out): 0x0000000002b5af80

41/57 Test #41: optim/bundle_adjustment_test ............Failed 0.11 sec Start 42: optim/combination_sampler_test 42/57 Test #42: optim/combination_sampler_test .......... Passed 0.00 sec Start 43: optim/loransac_test 43/57 Test #43: optim/loransac_test ..................... Passed 0.01 sec Start 44: optim/progressive_sampler_test 44/57 Test #44: optim/progressive_sampler_test .......... Passed 0.01 sec Start 45: optim/random_sampler_test 45/57 Test #45: optim/random_sampler_test ............... Passed 0.00 sec Start 46: optim/ransac_test 46/57 Test #46: optim/ransac_test ....................... Passed 0.01 sec Start 47: optim/support_measurement_test 47/57 Test #47: optim/support_measurement_test .......... Passed 0.00 sec Start 48: retrieval/visual_index_test 48/57 Test #48: retrieval/visual_index_test ............. Passed 0.99 sec Start 49: util/bitmap_test 49/57 Test #49: util/bitmap_test ........................ Passed 0.01 sec Start 50: util/cache_test 50/57 Test #50: util/cache_test ......................... Passed 0.00 sec Start 51: util/math_test 51/57 Test #51: util/math_test .......................... Passed 0.00 sec Start 52: util/misc_test 52/57 Test #52: util/misc_test .......................... Passed 0.00 sec Start 53: util/opengl_utils_test 53/57 Test #53: util/opengl_utils_test ..................Exception: SegFault 0.18 sec Start 54: util/random_test 54/57 Test #54: util/random_test ........................ Passed 0.02 sec Start 55: util/string_test 55/57 Test #55: util/string_test ........................ Passed 0.00 sec Start 56: util/threading_test 56/57 Test #56: util/threading_test ..................... Passed 3.94 sec Start 57: util/timer_test 57/57 Test #57: util/timer_test ......................... Passed 0.01 sec

93% tests passed, 4 tests failed out of 57

Total Test time (real) = 16.92 sec

The following tests FAILED: 8 - base/essential_matrix_utils_test (Failed) 11 - base/feature_matching_test (SEGFAULT) 41 - optim/bundle_adjustment_test (Failed) 53 - util/opengl_utils_test (SEGFAULT) Errors while running CTest make: *** [test] Error 8

Then, I just run one of these failed tests manually, I get this:

Running 8 test cases... Error in `./src/base/essential_matrix_utils_test': double free or corruption (out): 0x0000000000d80320 unknown location(0): fatal error in "TestRefineEssentialMatrix": signal: SIGABRT (application abort requested) /home/wqy/Documents/colmap/src/base/essential_matrix_test.cc(151): last checkpoint

*** 1 failure detected in test suite "base/essential_matrix"

So, any body can tell we what should I do ?

Thank you

ahojnnes commented 7 years ago

Seems like there is a problem with your Ceres compilation. Can you successfully run the Ceres-Solver unit tests?

lfrschkn commented 7 years ago

hi all

I got a similar error, but my ceres tests are all successful.

Aborted at 1490195475 (unix time) try "date -d @1490195475" if you are using GNU date PC: @ 0x6e9450 Eigen::internal::call_assignment_no_alias<>() SIGSEGV (@0x0) received by PID 26327 (TID 0x7f380bfff700) from PID 0; stack trace: @ 0x7f3846383390 (unknown) @ 0x6e9450 Eigen::internal::call_assignment_no_alias<>() @ 0x7f38468da0a9 ceres::internal::DenseSparseMatrix::DenseSparseMatrix() @ 0x7f38468edbed ceres::internal::ProgramEvaluator<>::CreateJacobian() @ 0x7f384696e1cc ceres::internal::TrustRegionPreprocessor::Preprocess() @ 0x7f3846965d40 ceres::Solver::Solve() @ 0x7f3846966e29 ceres::Solve() @ 0x66a8ec colmap::RefineAbsolutePose() @ 0x5946eb colmap::IncrementalMapper::RegisterNextImage() @ 0x58ac7d colmap::IncrementalMapperController::Reconstruct() @ 0x58c35a colmap::IncrementalMapperController::Run() @ 0x665fbc colmap::Thread::RunFunc() @ 0x7f384492ec80 (unknown) @ 0x7f38463796ba start_thread @ 0x7f3843e7282d clone @ 0x0 (unknown) Segmentation fault (core dumped)

for colmap:

The following tests FAILED: 8 - base/essential_matrix_utils_test (Failed) 11 - base/feature_matching_test (SEGFAULT) 41 - optim/bundle_adjustment_test (Failed)

has anyone an idea how to fix that?

Thank you

lfrschkn commented 7 years ago

I was able to resolve the issue by using Eigen 3.2.0-8 http://packages.ubuntu.com/uk/trusty/all/libeigen3-dev/download instead of Eigen 3.3.

theNded commented 7 years ago

It seems that the version of Eigen significantly influences the compiling and running onf COLMAP. Having tested Eigen 3.3.3, 3.3; 3.2.10, 3.2.8 and 3.2.5. In all situations, ceres unit tests have all passed. For 3.3.x, code can compile, but tests will fail similarly. For 3.2.10, only feature_matching and opengl_utils will fail For 3.2.x, x<10, code cannot compile, due to the problems in camera_rig.cc

ahojnnes commented 7 years ago

Can you check if defining EIGEN_DONT_ALIGN_STATICALLY and EIGEN_DONT_ALIGN in COLMAP solves the problem?

qiuyuanWang commented 7 years ago

Thanks for everyone! I reinstall Eigen 3.3.3 and work !!!

ahojnnes commented 7 years ago

Did it work with the default COLMAP build or just the definitions I mentioned in my previous post?

ahojnnes commented 7 years ago

So, my experience with this issue on multiple machines is that there is some bug in the default Eigen version in the Ubuntu 16.04 repository. Upgrading to a non-Beta, stable version of Eigen fixes the problem for me on all machines. Closing this issue for now. Thanks for the feedback.