Open mrbemani opened 7 years ago
oh, here is the backtrace from gdb:
(gdb) backtrace
#0 0x00007ffff4d79cc0 in _IO_vfprintf_internal (s=s@entry=0x7fffffffd130, format=<optimized out>,
format@entry=0xb04da8 "Reference image %3u sees %u views:%s (%u shared points)",
ap=ap@entry=0x7fffffffd2b0) at vfprintf.c:1632
#1 0x00007ffff4da1a49 in _IO_vsnprintf (
string=0x7fffffffd220 "Reference image 1842106639 sees 3758096384 views:",
maxlen=<optimized out>,
format=0xb04da8 "Reference image %3u sees %u views:%s (%u shared points)", args=0x7fffffffd2b0)
at vsnprintf.c:114
#2 0x0000000000adbd42 in _vscprintf (
format=0xb04da8 "Reference image %3u sees %u views:%s (%u shared points)", pargs=0x7fffffffdcd0)
at /home/shiqi/cv/openMVS/libs/Common/Types.cpp:24
#3 0x00000000008d988d in SEACAVE::String::FormatStringSafe (
szFormat=0xb04da8 "Reference image %3u sees %u views:%s (%u shared points)", args=0x7fffffffdcd0)
at /home/shiqi/cv/openMVS/apps/ReconstructMesh/../../libs/MVS/../Common/Strings.h:83
#4 0x0000000000ad80d9 in SEACAVE::Log::_Record (
this=0xe1da40 <SEACAVE::Log::GetInstance()::instance>, lt=4294967295,
szFormat=0xb04da8 "Reference image %3u sees %u views:%s (%u shared points)", args=0x7fffffffdcd0)
at /home/shiqi/cv/openMVS/libs/Common/Log.cpp:154
#5 0x0000000000ad7e66 in SEACAVE::Log::Write (this=0xe1da40 <SEACAVE::Log::GetInstance()::instance>,
szFormat=0xb04da8 "Reference image %3u sees %u views:%s (%u shared points)")
---Type <return> to continue, or q <return> to quit---
at /home/shiqi/cv/openMVS/libs/Common/Log.cpp:88
#6 0x0000000000a114a0 in MVS::Scene::SelectNeighborViews (this=0x7fffffffe3f0, ID=111, points=...,
nMinViews=3, nMinPointViews=2, fOptimAngle=0.209439516)
at /home/shiqi/cv/openMVS/libs/MVS/Scene.cpp:480
#7 0x00000000008dd2e3 in main (argc=5, argv=0x7fffffffe6a8)
at /home/shiqi/cv/openMVS/apps/ReconstructMesh/ReconstructMesh.cpp:265
(gdb)
I tried to use "-v 0", then I got this error:
15:42:12 [App ] Build date: Mar 14 2017, 15:22:11
15:42:12 [App ] CPU: Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz
15:42:12 [App ] RAM: 137.72GB Physical Memory 0B Virtual Memory
15:42:12 [App ] OS: Linux 4.4.0-66-generic (x86_64)
15:42:12 [App ] SSE & AVX compatible CPU & OS detected
15:42:12 [App ] Command line: -v 0 -i scene.mvs -o m.mvs
ReconstructMesh: /home/shiqi/cv/openMVS/libs/MVS/SceneReconstruct.cpp:1009: bool MVS::Scene::ReconstructMesh(float, bool, unsigned int, float, float, float, float, float, float, float, float): Assertion `facets.empty() && inter.type == intersection_t::VERTEX && inter.v1 == vi' failed.
Thread 1 "ReconstructMesh" received signal SIGABRT, Aborted.
0x00007ffff4d60428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtrace
#0 0x00007ffff4d60428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007ffff4d6202a in __GI_abort () at abort.c:89
#2 0x00007ffff4d58bd7 in __assert_fail_base (fmt=<optimized out>,
assertion=assertion@entry=0xaf5c00 "facets.empty() && inter.type == intersection_t::VERTEX && inter.v1 == vi", file=file@entry=0xaf58e0 "/home/shiqi/cv/openMVS/libs/MVS/SceneReconstruct.cpp",
line=line@entry=1009,
function=function@entry=0xaf8680 <MVS::Scene::ReconstructMesh(float, bool, unsigned int, float, float, float, float, float, float, float, float)::__PRETTY_FUNCTION__> "bool MVS::Scene::ReconstructMesh(float, bool, unsigned int, float, float, float, float, float, float, float, float)") at assert.c:92
#3 0x00007ffff4d58c82 in __GI___assert_fail (
assertion=0xaf5c00 "facets.empty() && inter.type == intersection_t::VERTEX && inter.v1 == vi",
file=0xaf58e0 "/home/shiqi/cv/openMVS/libs/MVS/SceneReconstruct.cpp", line=1009,
function=0xaf8680 <MVS::Scene::ReconstructMesh(float, bool, unsigned int, float, float, float, float, float, float, float, float)::__PRETTY_FUNCTION__> "bool MVS::Scene::ReconstructMesh(float, bool, unsigned int, float, float, float, float, float, float, float, float)") at assert.c:101
#4 0x00000000009aeb42 in MVS::Scene::ReconstructMesh (this=0x7fffffffe3e0, distInsert=2,
bUseFreeSpaceSupport=false, nItersFixNonManifold=4, kSigma=2, kQual=1, kb=4, kf=3,
kRel=0.100000001, kAbs=1000, kOutl=400, kInf=268435456)
at /home/shiqi/cv/openMVS/libs/MVS/SceneReconstruct.cpp:1009
#5 0x00000000008dd3ab in main (argc=7, argv=0x7fffffffe698)
---Type <return> to continue, or q <return> to quit---
at /home/shiqi/cv/openMVS/apps/ReconstructMesh/ReconstructMesh.cpp:276
I'm encountering a similar segfault with ReconstructMesh when working through the tutorial on https://github.com/cdcseacave/openMVS/wiki/Usage .
I'm running the current master branch of openMVS, with cmake . ../openMVS -DCMAKE_BUILD_TYPE=Debug -DOpenMVS_USE_CUDA=OFF -DVCG_DIR="$main_path/vcglib"
I have Eigen 3.3.3 and CERES 1.13.0 in /usr/local/ , compiled from current Github repositories.
$ gdb ../../../../openMVS_debug_build/bin/ReconstructMesh GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1 ... This GDB was configured as "x86_64-linux-gnu". ... Reading symbols from ../../../../openMVS_debug_build/bin/ReconstructMesh...done. (gdb) run scene_dense.mvs Starting program: /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS_debug_build/bin/ReconstructMesh scene_dense.mvs [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 16:22:58 [App ] Build date: May 9 2017, 16:06:01 16:22:58 [App ] CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz 16:22:58 [App ] RAM: 15.50GB Physical Memory 15.82GB Virtual Memory 16:22:59 [App ] OS: Linux 4.4.0-77-generic (x86_64) 16:22:59 [App ] SSE & AVX compatible CPU & OS detected 16:22:59 [App ] Command line: scene_dense.mvs [New Thread 0x7fffee8d3700 (LWP 24325)] [New Thread 0x7fffee0d2700 (LWP 24326)] [New Thread 0x7fffed8d1700 (LWP 24327)] [New Thread 0x7fffed0d0700 (LWP 24328)] [New Thread 0x7fffec8cf700 (LWP 24329)] [New Thread 0x7fffe7fff700 (LWP 24330)] [New Thread 0x7fffe77fe700 (LWP 24331)] 16:23:00 [App ] Scene loaded (1s738ms): 11 images (11 calibrated) with a total of 3.95 MPixels (0.36 MPixels/image) 390483 points, 0 vertices, 0 faces [New Thread 0x7fffe6ffd700 (LWP 24332)] [New Thread 0x7fffe67fc700 (LWP 24333)] [New Thread 0x7fffe5ffb700 (LWP 24334)] [New Thread 0x7fffe57fa700 (LWP 24335)] [New Thread 0x7fffe4ff9700 (LWP 24336)] [New Thread 0x7fffdffff700 (LWP 24337)] [New Thread 0x7fffdf7fe700 (LWP 24338)] Points inserted 390483 (100%, 1m16s386ms)
Thread 1 "ReconstructMesh" received signal SIGSEGV, Segmentation fault. 0x000000000091fb83 in _mm_load_pd (P=0xf0e608) at /usr/lib/gcc/x86_64-linux-gnu/5/include/emmintrin.h:119 119 return (__m128d )P; (gdb) ... (gdb) list 114 115 / Load two DPFP values from P. The address must be 16-byte aligned. / 116 extern inline m128d attribute((gnu_inline, always_inline, artificial__)) 117 _mm_load_pd (double const *P) 118 { 119 return (__m128d )P; 120 } 121 122 / Load two DPFP values from P. The address need not be 16-byte aligned. / 123 extern inline m128d attribute((gnu_inline, always_inline, artificial__)) (gdb) ... (gdb) backtrace
from=0xf0e608) at /usr/local/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h:307
at /usr/local/include/eigen3/Eigen/src/Core/CoreEvaluators.h:195
this=0x7fffffffca30, row=0, col=0) at /usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:652
this=0x7fffffffca30, outer=0, inner=0) at /usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:666
at /usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:468
func=...) at /usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:741
func=...) at /usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:836
src=..., func=...) at /usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:804
at /usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:782
at /usr/local/include/eigen3/Eigen/src/Core/Assign.h:66
at /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS/libs/MVS/../Common/Plane.inl:393
f=1) at /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS/libs/MVS/../Common/Plane.inl:277
hullFacets=std::vector of length 160, capacity 256 = {...}, cell=..., imageData=...,
facets=std::vector of length 0, capacity 0)
at /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS/libs/MVS/SceneReconstruct.cpp:402
nItersFixNonManifold=4, kSigma=2, kQual=1, kb=4, kf=3, kRel=0.100000001, kAbs=1000, kOutl=400, kInf=268435456)
at /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS/libs/MVS/SceneReconstruct.cpp:880
at /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS/apps/ReconstructMesh/ReconstructMesh.cpp:276
(gdb) ....
Details of my build - cmake's output:
somebody solved this by using Eigen 3.2
Thanks. For others to find that, it would be https://github.com/cdcseacave/openMVS/issues/211 This implies download and build Eigen3.2, then rebuild Ceres with Eigen3.2, then build openMVS with the newly build Eigen3.2 and Ceres. (Make sure you point Cmake to the correct versions.)
This led to SIGABRT after Delaunay tetrahedralization completed. This is similar to #180, but I am using the patch that fixed #180 .
Which is averted by using ' -d 8 scene_dense.mvs' to reduce density & RAM required.
The next problem encountered is:
21:22:22 [App ] Cleaned mesh: 59707 vertices, 119350 faces (1s157ms) OpenCV Error: Assertion failed (channels() == CV_MAT_CN(dtype)) in copyTo, file /tmp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/core/src/copy.cpp, line 259 terminate called after throwing an instance of 'cv::Exception' what(): /tmp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/core/src/copy.cpp:259: error: (-215) channels() == CV_MAT_CN(dtype) in function copyTo
Thread 1 "ReconstructMesh" received signal SIGABRT, Aborted. 0x00007ffff2a53428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb)
Which looks to be related to OpenCV-3.3 & ROS-Kinetic. Given the openMVS depends on libopencv-dev, this probably means OpenCV-2.4.x . Setting OPENCV_DIR to /usr/local/share/OpenCV ensures that it finds OpenCV-2.4.x installed by libopencv-dev,
The next hurdle is:
21:52:08 [App ] Removed 0 degenerate vertices 21:52:08 [App ] Removed 0 unreferenced vertices 21:52:08 [App ] Removed 0 duplicate vertices 21:52:09 [App ] Split 0 non-manifold vertices 21:52:09 [App ] Cleaned mesh: 59707 vertices, 119350 faces (1s253ms) 21:52:09 [App ] Scene saved (343ms): 11 images (11 calibrated) 0 points, 59707 vertices, 119350 faces 21:52:10 [App ] Mesh saved: 59707 vertices, 119350 faces (121ms)
Thread 1 "ReconstructMesh" received signal SIGSEGV, Segmentation fault. strlen () at ../sysdeps/x86_64/strlen.S:106 106 ../sysdeps/x86_64/strlen.S: No such file or directory. (gdb) backtrace
...
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x00007ffff0e53980 in printf_positional (s=s@entry=0x7fffffffc840, format=format@entry=0xafc8a0 <MVS::Scene::ExportCamerasMLP(SEACAVE::String const&, SEACAVE::String const&) const::mlp_raster> " <MLRaster label=\"%s\">\n <VCGCamera TranslationVector=\"%0.6g %0.6g %0.6g 1\" LensDistortion=\"%0.6g %0.6g\" ViewportPx=\"%u %u\" PixelSizeMm=\"1 %0.4f\" FocalMm=\"%0.4f\" CenterPx=\"%0.4f %0.4f\" RotationMatri"..., readonly_format=readonly_format@entry=0, ap=ap@entry=0x7fffffffc9d8, ap_savep=ap_savep@entry=0x7fffffffc3d8, done=377, nspecs_done=21, lead_str_end=0xafc8b3 <MVS::Scene::ExportCamerasMLP(SEACAVE::String const&, SEACAVE::String const&) const::mlp_raster+19> "%s\">\n <VCGCamera TranslationVector=\"%0.6g %0.6g %0.6g 1\" LensDistortion=\"%0.6g %0.6g\" ViewportPx=\"%u %u\" PixelSizeMm=\"1 %0.4f\" FocalMm=\"%0.4f\" CenterPx=\"%0.4f %0.4f\" RotationMatrix=\"%0.6g %0.6g %0.6"..., work_buffer=0x7fffffffc410 "@\243\221\362\377\177", save_errno=0, grouping=0x0, thousands_sep=0x7ffff0f92f45 "") at vfprintf.c:2023
#2 0x00007ffff0e544a6 in _IO_vfprintf_internal (s=s@entry=0x7fffffffc840, format=<optimised out>, format@entry=0xafc8a0 <MVS::Scene::ExportCamerasMLP(SEACAVE::String const&, SEACAVE::String const&) const::mlp_raster> " <MLRaster label=\"%s\">\n <VCGCamera TranslationVector=\"%0.6g %0.6g %0.6g 1\" LensDistortion=\"%0.6g %0.6g\" ViewportPx=\"%u %u\" PixelSizeMm=\"1 %0.4f\" FocalMm=\"%0.4f\" CenterPx=\"%0.4f %0.4f\" RotationMatri"..., ap=ap@entry=0x7fffffffc9d8) at vfprintf.c:1677
#3 0x00007ffff0e7da49 in _IO_vsnprintf ( string=0x7fffffffc9f0 " <MLRaster label=\"100_7100\">\n <VCGCamera TranslationVector=\"-0.00290509 -0.00791689 -0.0295064 1\" LensDistortion=\"1 2987.29\" ViewportPx=\"0 0\" PixelSizeMm=\"1 1476.6612\" FocalMm=\"1114.7460\" CenterPx="..., maxlen=<optimised out>, format=0xafc8a0 <MVS::Scene::ExportCamerasMLP(SEACAVE::String const&, SEACAVE::String const&) const::mlp_raster> " <MLRaster label=\"%s\">\n <VCGCamera TranslationVector=\"%0.6g %0.6g %0.6g 1\" LensDistortion=\"%0.6g %0.6g\" ViewportPx=\"%u %u\" PixelSizeMm=\"1 %0.4f\" FocalMm=\"%0.4f\" CenterPx=\"%0.4f %0.4f\" RotationMatri"..., args=0x7fffffffc9d8) at vsnprintf.c:114
#4 0x000000000095058a in SEACAVE::OutputStream::print (this=0x7fffffffd3d8, szFormat=0xafc8a0 <MVS::Scene::ExportCamerasMLP(SEACAVE::String const&, SEACAVE::String const&) const::mlp_raster> " <MLRaster label=\"%s\">\n <VCGCamera TranslationVector=\"%0.6g %0.6g %0.6g 1\" LensDistortion=\"%0.6g %0.6g\" ViewportPx=\"%u %u\" PixelSizeMm=\"1 %0.4f\" FocalMm=\"%0.4f\" CenterPx=\"%0.4f %0.4f\" RotationMatri"...) at /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS/libs/MVS/../Common/Streams.h:69
#5 0x0000000000956865 in MVS::Scene::ExportCamerasMLP (this=0x7fffffffd930, fileName=..., fileNameScene=...) at /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS/libs/MVS/Scene.cpp:586
#6 0x00000000008dfb57 in main (argc=4, argv=0x7fffffffdbe8) at /home/nick/Programming/GetTrik/openMVS_openMVG/openMVS/apps/ReconstructMesh/ReconstructMesh.cpp:301 (gdb)
This is SEACAVE::OutputStream::print(...) called by the last line of MVS::Scene::ExportCamerasMLP(...) where it is writing the data to file.
it is an assert that you can ignore, please compile in Release or RelWithDebugInfo
Thanks. With -DCMAKE_BUILD_TYPE=RelWithDebugInfo it still crashed at the same point with or without gdb, but with -DCMAKE_BUILD_TYPE=Release it ran to completion (and much faster).
I ran:
and I got this error.
I built it with:
OS: Ubuntu 16.04 LTS