Hey guys,
I compiled opencv with contrib module. It works well, however as soon as I try to use xphoto::Inpaint method the code crashes without an exception.
Further informations: OpenCV 3.3.1 Linux 64 Bit Contrib 3.3.1 Compiler: GCC
Additionally I ran valgrind and here is the output. I have no experience with it so far, so I don't know if it helps.
==1554== Warning: set address range perms: large range [0x1000000000, 0x1500000000) (noaccess)
==1554== Warning: set address range perms: large range [0xb00000000, 0xd00000000) (noaccess)
==1554== Warning: noted but unhandled ioctl 0x42 with no size/direction hints.
==1554== This could cause spurious value errors to appear.
==1554== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==1554== Warning: noted but unhandled ioctl 0x22 with no size/direction hints.
==1554== This could cause spurious value errors to appear.
==1554== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper. Stage [densification]: Successfully densified frame!
==1554== Thread 6:
==1554== Use of uninitialised value of size 8
==1554== at 0x114FD0B5: void std::__introselect<__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator> >(__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator>) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FE313: KDTree<float, 24="">::KDTree(cv::Mat const&, int, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FFF0C: dominantTransforms(cv::Mat const&, std::vector<cv::point_<int>, std::allocator<cv::point_<int> > >&, int, int) [clone .constprop.560] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x11502B56: void cv::xphoto::shiftMapInpaint<double, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int, int, cv::Point_<int>) [clone .constprop.553] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150492A: void cv::xphoto::inpaint<char, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int) [clone .part.457] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150D9F5: cv::xphoto::inpaint(cv::Mat const&, cv::Mat const&, cv::Mat&, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x7EE22E3: realm::stages::Densification::computeGuidanceDisparity(std::shared_ptr<realm::frame> const&) const (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x7EE8DA5: realm::stages::Densification::process() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x87C0D47: realm::WorkerThreadBase::run() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_core.so)
==1554== by 0x6735C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==1554== by 0x93406B9: start_thread (pthread_create.c:333)
==1554== by 0x6D1C41C: clone (clone.S:109)
==1554==
==1554== Invalid read of size 4
==1554== at 0x114FD0A8: void std::__introselect<__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator> >(__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator>) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FE313: KDTree<float, 24="">::KDTree(cv::Mat const&, int, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FFF0C: dominantTransforms(cv::Mat const&, std::vector<cv::point_<int>, std::allocator<cv::point_<int> > >&, int, int) [clone .constprop.560] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x11502B56: void cv::xphoto::shiftMapInpaint<double, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int, int, cv::Point_<int>) [clone .constprop.553] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150492A: void cv::xphoto::inpaint<char, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int) [clone .part.457] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150D9F5: cv::xphoto::inpaint(cv::Mat const&, cv::Mat const&, cv::Mat&, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x7EE22E3: realm::stages::Densification::computeGuidanceDisparity(std::shared_ptr<realm::frame> const&) const (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x7EE8DA5: realm::stages::Densification::process() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x87C0D47: realm::WorkerThreadBase::run() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_core.so)
==1554== by 0x6735C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==1554== by 0x93406B9: start_thread (pthread_create.c:333)
==1554== by 0x6D1C41C: clone (clone.S:109)
==1554== Address 0x582e8e40 is 0 bytes after a block of size 4,096 alloc'd
==1554== at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1554== by 0x5753BFC: std::vector<int, std::allocator<int=""> >::_M_insert_aux(__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, int const&) (in /usr/local/lib/libopencv_core.so.3.3.1)
==1554== by 0x114FDD9A: KDTree<float, 24="">::KDTree(cv::Mat const&, int, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FFF0C: dominantTransforms(cv::Mat const&, std::vector<cv::point_<int>, std::allocator<cv::point_<int> > >&, int, int) [clone .constprop.560] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x11502B56: void cv::xphoto::shiftMapInpaint<double, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int, int, cv::Point_<int>) [clone .constprop.553] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150492A: void cv::xphoto::inpaint<char, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int) [clone .part.457] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150D9F5: cv::xphoto::inpaint(cv::Mat const&, cv::Mat const&, cv::Mat&, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x7EE22E3: realm::stages::Densification::computeGuidanceDisparity(std::shared_ptr<realm::frame> const&) const (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x7EE8DA5: realm::stages::Densification::process() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x87C0D47: realm::WorkerThreadBase::run() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_core.so)
==1554== by 0x6735C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==1554== by 0x93406B9: start_thread (pthread_create.c:333)
==1554==
==1554== Invalid read of size 4
==1554== at 0x114FD0B5: void std::__introselect<__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator> >(__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator>) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FE313: KDTree<float, 24="">::KDTree(cv::Mat const&, int, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FFF0C: dominantTransforms(cv::Mat const&, std::vector<cv::point_<int>, std::allocator<cv::point_<int> > >&, int, int) [clone .constprop.560] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x11502B56: void cv::xphoto::shiftMapInpaint<double, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int, int, cv::Point_<int>) [clone .constprop.553] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150492A: void cv::xphoto::inpaint<char, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int) [clone .part.457] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150D9F5: cv::xphoto::inpaint(cv::Mat const&, cv::Mat const&, cv::Mat&, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x7EE22E3: realm::stages::Densification::computeGuidanceDisparity(std::shared_ptr<realm::frame> const&) const (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x7EE8DA5: realm::stages::Densification::process() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x87C0D47: realm::WorkerThreadBase::run() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_core.so)
==1554== by 0x6735C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==1554== by 0x93406B9: start_thread (pthread_create.c:333)
==1554== by 0x6D1C41C: clone (clone.S:109)
==1554== Address 0x582ebf40 is 16 bytes before a block of size 112 alloc'd
==1554== at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1554== by 0x1AAC64BC: TiXmlElement::Parse(char const, TiXmlParsingData, TiXmlEncoding) (in /usr/lib/x86_64-linux-gnu/libtinyxml.so.2.6.2)
==1554== by 0x1AAC627F: TiXmlElement::ReadValue(char const, TiXmlParsingData, TiXmlEncoding) (in /usr/lib/x86_64-linux-gnu/libtinyxml.so.2.6.2)
==1554== by 0x1AAC65F9: TiXmlElement::Parse(char const, TiXmlParsingData, TiXmlEncoding) (in /usr/lib/x86_64-linux-gnu/libtinyxml.so.2.6.2)
==1554== by 0x1AAC49EC: TiXmlDocument::Parse(char const, TiXmlParsingData, TiXmlEncoding) (in /usr/lib/x86_64-linux-gnu/libtinyxml.so.2.6.2)
==1554== by 0x1AAC04DB: TiXmlDocument::LoadFile(_IO_FILE*, TiXmlEncoding) (in /usr/lib/x86_64-linux-gnu/libtinyxml.so.2.6.2)
==1554== by 0x1AAC064A: TiXmlDocument::LoadFile(char const*, TiXmlEncoding) (in /usr/lib/x86_64-linux-gnu/libtinyxml.so.2.6.2)
==1554== by 0xF398434: rospack::Rosstackage::loadManifest(rospack::Stackage*) (in /opt/ros/kinetic/lib/librospack.so)
==1554== by 0xF39AEF0: rospack::Rosstackage::addStackage(std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&) (in /opt/ros/kinetic/lib/librospack.so)
==1554== by 0xF39B295: rospack::Rosstackage::readCache() (in /opt/ros/kinetic/lib/librospack.so)
==1554== by 0xF39D87B: rospack::Rosstackage::crawl(std::vector<std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > > >, bool) (in /opt/ros/kinetic/lib/librospack.so)
==1554== by 0xF3AED9A: rospack::rospack_run(int, char**, rospack::Rosstackage&, std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >&) (in /opt/ros/kinetic/lib/librospack.so)
==1554==
==1554==
==1554== Process terminating with default action of signal 11 (SIGSEGV)
==1554== Access not within mapped region at address 0xC3616140
==1554== at 0x114FD0B5: void std::__introselect<__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator> >(__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator>) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FE313: KDTree<float, 24="">::KDTree(cv::Mat const&, int, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x114FFF0C: dominantTransforms(cv::Mat const&, std::vector<cv::point_<int>, std::allocator<cv::point_<int> > >&, int, int) [clone .constprop.560] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x11502B56: void cv::xphoto::shiftMapInpaint<double, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int, int, cv::Point_<int>) [clone .constprop.553] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150492A: void cv::xphoto::inpaint<char, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int) [clone .part.457] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x1150D9F5: cv::xphoto::inpaint(cv::Mat const&, cv::Mat const&, cv::Mat&, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)
==1554== by 0x7EE22E3: realm::stages::Densification::computeGuidanceDisparity(std::shared_ptr<realm::frame> const&) const (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x7EE8DA5: realm::stages::Densification::process() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)
==1554== by 0x87C0D47: realm::WorkerThreadBase::run() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_core.so)
==1554== by 0x6735C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==1554== by 0x93406B9: start_thread (pthread_create.c:333)
==1554== by 0x6D1C41C: clone (clone.S:109)
==1554== If you believe this happened as a result of a stack
==1554== overflow in your program's main thread (unlikely but
==1554== possible), you can try to increase the size of the
==1554== main thread stack using the --main-stacksize= flag.
==1554== The main thread stack size used in this run was 8388608.
==1554==
==1554== HEAP SUMMARY:
==1554== in use at exit: 398,807,392 bytes in 77,872 blocks
==1554== total heap usage: 164,135 allocs, 86,263 frees, 11,732,105,309 bytes allocated
==1554==
==1554== LEAK SUMMARY:
==1554== definitely lost: 8 bytes in 1 blocks
==1554== indirectly lost: 0 bytes in 0 blocks
==1554== possibly lost: 529,595 bytes in 2,175 blocks
==1554== still reachable: 398,277,789 bytes in 75,696 blocks
==1554== of which reachable via heuristic:
==1554== newarray : 4,632 bytes in 19 blocks
==1554== suppressed: 0 bytes in 0 blocks
==1554== Rerun with --leak-check=full to see details of leaked memory
==1554==
==1554== For counts of detected and suppressed errors, rerun with: -v
==1554== Use --track-origins=yes to see where uninitialised values come from
==1554== ERROR SUMMARY: 124 errors from 3 contexts (suppressed: 0 from 0)