Interpreting Valgrind results about a 3D reconstruction program
Hi,
I was running Valgrind to check memory leaks in my 3D reconstruction program, coded in C++/C and using Opencv 2.4.13. So here are some results I have trouble to interpret.
==1826== LEAK SUMMARY:
==1826== definitely lost: 0 bytes in 0 blocks
==1826== indirectly lost: 0 bytes in 0 blocks
==1826== possibly lost: 7,292 bytes in 89 blocks
==1826== still reachable: 127,593 bytes in 812 blocks
==1826== suppressed: 0 bytes in 0 blocks
First, all issues concern "possibly lost" memory, but I still want to treat them as critical issues, to ensure the quality and fiability of the programm.
The two main issues I am trying to solve are the following ones :
==1826== 1,560 bytes in 3 blocks are possibly lost in loss record 259 of 264
==1826== at 0x4C298A0: operator new[](unsigned long) (vg_replace_malloc.c:389)
==1826== by 0x82872A8: ??? (in /usr/lib/libtbb.so.2)
==1826== by 0x828755D: ??? (in /usr/lib/libtbb.so.2)
==1826== by 0x82850B4: ??? (in /usr/lib/libtbb.so.2)
==1826== by 0x8284A32: ??? (in /usr/lib/libtbb.so.2)
==1826== by 0x8282DE0: tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const (in /usr/lib/libtbb.so.2)
==1826== by 0x5497009: cv::parallel_for_(cv::Range const&, cv::ParallelLoopBody const&, double) (in /usr/local/lib/libopencv_core.so.2.4.13)
==1826== by 0x654A511: cv::remap(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::_InputArray const&, int, int, cv::Scalar_<double> const&) (in /usr/local/lib/libopencv_imgproc.so.2.4.13)
==1826== by 0x6440B3A: cv::undistort(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&) (in /usr/local/lib/libopencv_imgproc.so.2.4.13)
==1826== by 0x411CF9: cFeaturesMatcher::distorsion() (in /home/qmenard/StructureFromMotion/bin/Sfm)
==1826== by 0x403A8A: main (in /home/qmenard/StructureFromMotion/bin/Sfm)
==1826== 704 bytes in 2 blocks are possibly lost in loss record 255 of 264
==1826== at 0x4C2AD10: calloc (vg_replace_malloc.c:623)
==1826== by 0x4010F91: allocate_dtv (dl-tls.c:296)
==1826== by 0x401169D: _dl_allocate_tls (dl-tls.c:460)
==1826== by 0x9531C27: allocate_stack (allocatestack.c:589)
==1826== by 0x9531C27: pthread_create@@GLIBC_2.2.5 (pthread_create.c:495)
==1826== by 0x8281460: ??? (in /usr/lib/libtbb.so.2)
==1826== by 0x82893C9: ??? (in /usr/lib/libtbb.so.2)
==1826== by 0x5496A8C: tbb::interface6::internal::start_for<tbb::blocked_range<int>, (anonymous namespace)::ProxyLoopBody, tbb::auto_partitioner const>::execute() (in /usr/local/lib/libopencv_core.so.2.4.13)
==1826== by 0x828B24B: ??? (in /usr/lib/libtbb.so.2)
==1826== by 0x82895CF: ??? (in /usr/lib/libtbb.so.2)
==1826== by 0x5497061: cv::parallel_for_(cv::Range const&, cv::ParallelLoopBody const&, double) (in /usr/local/lib/libopencv_core.so.2.4.13)
==1826== by 0x657BAF6: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (in /usr/local/lib/libopencv_imgproc.so.2.4.13)
==1826== by 0x6E481B5: cv::SURF::operator()(cv::_InputArray const&, cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::_OutputArray const&, bool) const (in /usr/local/lib/libopencv_nonfree.so.2.4.13)
That's why I was wondering : do I have to ...