[opencv] 163/251: ts: update valgrind suppressions

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 3.3.0
in repository opencv.

commit bf0173bf38a4bafee9a00cb99d4ce6696ed8ac67
Author: Alexander Alekhin <alexander.alekhin at intel.com>
Date:   Fri Jul 21 16:42:28 2017 +0300

    ts: update valgrind suppressions
---
 cmake/OpenCVUtils.cmake                  |   6 +
 modules/calib3d/src/stereobm.cpp         |   2 +-
 modules/core/src/stat.cpp                |   2 +-
 modules/ts/misc/run.py                   |   2 +-
 modules/ts/misc/run_suite.py             |  11 +-
 platforms/scripts/valgrind.supp          | 198 ++++++++++++++++++++++++++++++-
 platforms/scripts/valgrind_3rdparty.supp | 113 ++++++++++++++++++
 7 files changed, 324 insertions(+), 10 deletions(-)

diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
index d91d1a6..8ef7205 100644
--- a/cmake/OpenCVUtils.cmake
+++ b/cmake/OpenCVUtils.cmake
@@ -533,6 +533,12 @@ macro(ocv_finalize_status)
       execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCV_BUILD_INFO_FILE}" "${OPENCV_MODULE_opencv_core_BINARY_DIR}/version_string.inc" OUTPUT_QUIET)
     endif()
   endif()
+
+  if(UNIX)
+    install(FILES "${OpenCV_SOURCE_DIR}/platforms/scripts/valgrind.supp"
+                  "${OpenCV_SOURCE_DIR}/platforms/scripts/valgrind_3rdparty.supp"
+            DESTINATION "${OPENCV_OTHER_INSTALL_PATH}" COMPONENT "dev")
+  endif()
 endmacro()
 
 
diff --git a/modules/calib3d/src/stereobm.cpp b/modules/calib3d/src/stereobm.cpp
index 5ed45a4..f6d8213 100644
--- a/modules/calib3d/src/stereobm.cpp
+++ b/modules/calib3d/src/stereobm.cpp
@@ -197,7 +197,7 @@ prefilterXSobel( const Mat& src, Mat& dst, int ftzero )
 {
     int x, y;
     const int OFS = 256*4, TABSZ = OFS*2 + 256;
-    uchar tab[TABSZ];
+    uchar tab[TABSZ] = { 0 };
     Size size = src.size();
 
     for( x = 0; x < TABSZ; x++ )
diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp
index e324f85..13d8c21 100644
--- a/modules/core/src/stat.cpp
+++ b/modules/core/src/stat.cpp
@@ -1547,7 +1547,7 @@ static bool ocl_meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv
 
     bool haveMask = _mask.kind() != _InputArray::NONE;
     int nz = haveMask ? -1 : (int)_src.total();
-    Scalar mean, stddev;
+    Scalar mean(0), stddev(0);
     const int cn = _src.channels();
     if (cn > 4)
         return false;
diff --git a/modules/ts/misc/run.py b/modules/ts/misc/run.py
index 0f2116e..0befa79 100755
--- a/modules/ts/misc/run.py
+++ b/modules/ts/misc/run.py
@@ -37,7 +37,7 @@ if __name__ == "__main__":
 
     # Valgrind
     parser.add_argument("--valgrind", action="store_true", default=False, help="Run C++ tests in valgrind")
-    parser.add_argument("--valgrind_supp", metavar="FILE", help="Path to valgrind suppression file (example: --valgrind_supp opencv/platforms/scripts/valgrind.supp)")
+    parser.add_argument("--valgrind_supp", metavar="FILE", action='append', help="Path to valgrind suppression file (example: --valgrind_supp opencv/platforms/scripts/valgrind.supp)")
     parser.add_argument("--valgrind_opt", metavar="OPT", action="append", default=[], help="Add command line option to valgrind (example: --valgrind_opt=--leak-check=full)")
 
     # Android
diff --git a/modules/ts/misc/run_suite.py b/modules/ts/misc/run_suite.py
index 311f415..8242c3a 100644
--- a/modules/ts/misc/run_suite.py
+++ b/modules/ts/misc/run_suite.py
@@ -103,10 +103,15 @@ class TestSuite(object):
     def wrapInValgrind(self, cmd = []):
         if self.options.valgrind:
             res = ['valgrind']
-            if self.options.valgrind_supp:
-                res.append("--suppressions=%s" % self.options.valgrind_supp)
+            supp = self.options.valgrind_supp or []
+            for f in supp:
+                if os.path.isfile(f):
+                    res.append("--suppressions=%s" % f)
+                else:
+                    print("WARNING: Valgrind suppression file is missing, SKIP: %s" % f)
             res.extend(self.options.valgrind_opt)
-            return res + cmd + [longTestFilter(LONG_TESTS_DEBUG_VALGRIND)]
+            has_gtest_filter = next((True for x in cmd if x.startswith('--gtest_filter=')), False)
+            return res + cmd + ([longTestFilter(LONG_TESTS_DEBUG_VALGRIND)] if not has_gtest_filter else [])
         return cmd
 
     def tryCommand(self, cmd):
diff --git a/platforms/scripts/valgrind.supp b/platforms/scripts/valgrind.supp
index 54833e0..e78d047 100644
--- a/platforms/scripts/valgrind.supp
+++ b/platforms/scripts/valgrind.supp
@@ -1,13 +1,203 @@
 {
-   IPP static init
+   OpenCV-IPP static init
    Memcheck:Cond
    fun:ippicvGetCpuFeatures
    fun:ippicvStaticInit
 }
 
 {
-   TBB - allocate_via_handler_v3 issue
+   OpenCV-getInitializationMutex
    Memcheck:Leak
-   fun:malloc
-   fun:_ZN3tbb8internal23allocate_via_handler_v3Em
+   ...
+   fun:_ZN2cv22getInitializationMutexEv
+}
+
+{
+   OpenCV-getStdAllocator
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3Mat15getStdAllocatorEv
+}
+
+{
+   OpenCV-getOpenCLAllocator
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3ocl18getOpenCLAllocatorEv
+}
+
+{
+   OpenCV-getCoreTlsData
+   Memcheck:Leak
+   fun:_Znwm
+   fun:_ZN2cv14getCoreTlsDataEv
+}
+
+{
+   OpenCV-TLS-getTlsStorage
+   Memcheck:Leak
+   ...
+   fun:_ZN2cvL13getTlsStorageEv
+}
+
+{
+   OpenCV-TLS-getData()
+   Memcheck:Leak
+   ...
+   fun:*setData*
+   fun:_ZNK2cv16TLSDataContainer7getDataEv
+}
+
+{
+   OpenCV-parallel_for
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv13ThreadManager8initPoolEv*
+}
+
+{
+   OpenCV-parallel_for
+   Memcheck:Leak
+   fun:_Znwm
+   fun:*instance*
+   fun:_ZN2cv21parallel_for_pthreadsERKNS_5RangeERKNS_16ParallelLoopBodyEd
+   fun:_ZN2cv13parallel_for_ERKNS_5RangeERKNS_16ParallelLoopBodyEd
+}
+
+{
+   OpenCV-parallel_for-ThreadManager::TLS
+   Memcheck:Leak
+   fun:_Znwm
+   fun:_ZNK2cv7TLSDataINS_13ThreadManager13work_thread_tEE18createDataInstanceEv
+}
+
+{
+   OpenCV-parallel_for-setNumThreads()
+   Memcheck:Leak
+   fun:_Znwm
+   fun:_ZN2cv13ThreadManager8instanceEv
+   fun:_ZN2cv33parallel_pthreads_set_threads_numEi
+   fun:_ZN2cv13setNumThreadsEi
+}
+
+{
+   OpenCV-parallel_for-getNumThreads()
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv13getNumThreadsEv
+}
+
+{
+   OpenCV-getIPPSingelton
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3ippL15getIPPSingeltonEv
+}
+
+{
+   OpenCV-getGlobalMatOpInitializer
+   Memcheck:Leak
+   fun:_Znwm
+   fun:_ZN2cvL25getGlobalMatOpInitializerEv
+}
+
+{
+   OpenCV-CoreTLSData
+   Memcheck:Leak
+   ...
+   fun:_ZNK2cv7TLSDataINS_11CoreTLSDataEE3getEv
+}
+
+{
+   OpenCV-ThreadID
+   Memcheck:Leak
+   fun:_Znwm
+   fun:_ZNK2cv7TLSDataINS_12_GLOBAL__N_18ThreadIDEE18createDataInstanceEv
+}
+
+{
+   OpenCV-ThreadID-TLS
+   Memcheck:Leak
+   fun:_Znwm
+   fun:getThreadIDTLS
+}
+
+{
+   OpenCV-CoreTLS
+   Memcheck:Leak
+   fun:_Znwm
+   fun:_ZNK2cv7TLSDataINS_11CoreTLSDataEE18createDataInstanceEv
+}
+
+{
+   OpenCV-haveOpenCL
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3ocl10haveOpenCLEv
+}
+
+{
+   OpenCV-DNN-getLayerFactoryMutex
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3dnn*L20getLayerFactoryMutexEv
+}
+
+{
+   OpenCV-ocl::Context
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3ocl7Context10getDefaultEb
+}
+
+{
+   OpenCV-ocl::Device
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3ocl6Device10getDefaultEv
+}
+
+{
+   OpenCV-ocl::Queue
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3ocl5Queue6createERKNS0_7ContextERKNS0_6DeviceE
+}
+
+{
+   OpenCV-ocl::Program
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3ocl6Kernel6createEPKcRKNS0_7ProgramE
+}
+
+{
+   OpenCV-ocl::ProgramEntry
+   Memcheck:Leak
+   ...
+   fun:_ZNK2cv3ocl8internal12ProgramEntrycvRNS0_13ProgramSourceEEv
+}
+
+{
+   OpenCV-ocl::Context::getProg
+   Memcheck:Leak
+   ...
+   fun:_ZN2cv3ocl7Context7getProgERKNS0_13ProgramSourceERKNS_6StringERS5_
+}
+
+
+{
+   OpenCV-ITT
+   Memcheck:Leak
+   ...
+   fun:__itt_*create*
+}
+
+{
+   OpenCV-FFmpeg-swsscale
+   Memcheck:Addr16
+   ...
+   fun:sws_scale
+   fun:_ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii
+   fun:cvWriteFrame_FFMPEG
 }
diff --git a/platforms/scripts/valgrind_3rdparty.supp b/platforms/scripts/valgrind_3rdparty.supp
new file mode 100644
index 0000000..7b6472d
--- /dev/null
+++ b/platforms/scripts/valgrind_3rdparty.supp
@@ -0,0 +1,113 @@
+{
+   IPP static init
+   Memcheck:Cond
+   fun:ippicvGetCpuFeatures
+   fun:ippicvStaticInit
+}
+
+{
+   TBB - allocate_via_handler_v3 issue
+   Memcheck:Leak
+   fun:malloc
+   fun:_ZN3tbb8internal23allocate_via_handler_v3Em
+}
+
+{
+   GTest
+   Memcheck:Cond
+   fun:_ZN7testing8internal11CmpHelperLEIddEENS_15AssertionResultEPKcS4_RKT_RKT0_
+}
+
+{
+   OpenCL
+   Memcheck:Cond
+   ...
+   obj:**/libOpenCL.so*
+}
+
+{
+   OpenCL-Intel
+   Memcheck:Cond
+   ...
+   obj:**/libigdrcl.so
+}
+
+{
+   OpenCL-Intel
+   Memcheck:Leak
+   ...
+   obj:*/libigdrcl.so*
+}
+
+{
+   OpenCL
+   Memcheck:Param
+   ioctl(generic)
+   ...
+   fun:clGetPlatformIDs
+}
+
+{
+   OpenCL-Init
+   Memcheck:Leak
+   ...
+   fun:clGetPlatformIDs
+}
+
+{
+   glib
+   Memcheck:Leak
+   fun:*alloc
+   obj:*/libglib*
+}
+
+{
+   gcrypt
+   Memcheck:Leak
+   ...
+   obj:*/libgcrypt*
+}
+
+{
+   p11-kit
+   Memcheck:Leak
+   fun:*alloc
+   obj:*/libp11-kit*
+}
+
+{
+   gobject
+   Memcheck:Leak
+   fun:*alloc
+   ...
+   obj:*/libgobject*
+}
+
+{
+   tasn
+   Memcheck:Leak
+   fun:*alloc
+   obj:*/libtasn*.so*
+}
+
+{
+   dl_init
+   Memcheck:Leak
+   ...
+   fun:_dl_init
+}
+
+{
+   dl_open
+   Memcheck:Leak
+   ...
+   fun:_dl_open
+}
+
+{
+   GDAL
+   Memcheck:Leak
+   fun:*alloc
+   ...
+   obj:/usr/lib/libgdal.so.1.17.1
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list