Mark Wielaard 9a7063
commit 578a0ec2872203dd4a741f7a445056c80320e2c8
Mark Wielaard 9a7063
Author: Mark Wielaard <mjw@redhat.com>
Mark Wielaard 9a7063
Date:   Thu Mar 10 21:36:00 2016 +0100
Mark Wielaard 9a7063
Mark Wielaard 9a7063
    Add libstdc++.supp for still reachable leaks from global memory cache.
Mark Wielaard 9a7063
    
Mark Wielaard 9a7063
    Contributed by Björn "besser82" Esser <fedora@besser82.io>.
Mark Wielaard 9a7063
Mark Wielaard 9a7063
diff --git a/configure.ac b/configure.ac
Mark Wielaard 9a7063
index 888a308..01012e1 100644
Mark Wielaard 9a7063
--- a/configure.ac
Mark Wielaard 9a7063
+++ b/configure.ac
Mark Wielaard 9a7063
@@ -1060,6 +1060,9 @@ if test "$VGCONF_OS" != "solaris"; then
Mark Wielaard 9a7063
     DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
Mark Wielaard 9a7063
 fi
Mark Wielaard 9a7063
 
Mark Wielaard 9a7063
+# Suppression file for libstdc++ until we solve KDE#345307
Mark Wielaard 9a7063
+DEFAULT_SUPP="libstdc++.supp ${DEFAULT_SUPP}"
Mark Wielaard 9a7063
+
Mark Wielaard 9a7063
 
Mark Wielaard 9a7063
 #----------------------------------------------------------------------------
Mark Wielaard 9a7063
 # Platform variants?
Mark Wielaard 9a7063
diff --git a/libstdc++.supp b/libstdc++.supp
Mark Wielaard 9a7063
new file mode 100644
Mark Wielaard 9a7063
index 0000000..f04f90d
Mark Wielaard 9a7063
--- /dev/null
Mark Wielaard 9a7063
+++ b/libstdc++.supp
Mark Wielaard 9a7063
@@ -0,0 +1,68 @@
Mark Wielaard 9a7063
+
Mark Wielaard 9a7063
+# Some programs are using the C++ STL and string classes.
Mark Wielaard 9a7063
+# Valgrind reports 'still reachable' memory leaks involving these classes
Mark Wielaard 9a7063
+# at the exit of the program, but there should be none.
Mark Wielaard 9a7063
+#
Mark Wielaard 9a7063
+# Many implementations of the C++ standard libraries use their own memory
Mark Wielaard 9a7063
+# pool allocators.  Memory for quite a number of destructed objects is not
Mark Wielaard 9a7063
+# immediately freed and given back to the OS, but kept in the pool(s) for
Mark Wielaard 9a7063
+# later re-use.  The fact that the pools are not freed at the exit of the
Mark Wielaard 9a7063
+# program cause Valgrind to report this memory as still reachable.
Mark Wielaard 9a7063
+#
Mark Wielaard 9a7063
+# The behavior not to free pools at the exit could be called a bug of the
Mark Wielaard 9a7063
+# library though.
Mark Wielaard 9a7063
+#
Mark Wielaard 9a7063
+# Using GCC, you can force the STL to use malloc and to free memory as soon
Mark Wielaard 9a7063
+# as possible by globally disabling memory caching.  Beware! Doing so will
Mark Wielaard 9a7063
+# probably slow down your program, sometimes drastically.
Mark Wielaard 9a7063
+#
Mark Wielaard 9a7063
+# There are other ways to disable memory pooling: using the malloc_alloc
Mark Wielaard 9a7063
+# template with your objects (not portable, but should work for GCC) or
Mark Wielaard 9a7063
+# even writing your own memory allocators.   But beware: allocators belong
Mark Wielaard 9a7063
+# to the more messy parts of the STL and people went to great lengths to
Mark Wielaard 9a7063
+# make the STL portable across platforms.  Chances are good that your
Mark Wielaard 9a7063
+# solution will work on your platform, but not on others.
Mark Wielaard 9a7063
+#
Mark Wielaard 9a7063
+# 72,704 bytes in 1 blocks are still reachable in loss record 1 of 1
Mark Wielaard 9a7063
+#       at 0x4C28D06: malloc (vg_replace_malloc.c:299)
Mark Wielaard 9a7063
+#       by 0x50C317F: ??? (in /usr/lib64/libstdc++.so.6.0.21)
Mark Wielaard 9a7063
+#       by 0x400F759: call_init.part.0 (dl-init.c:72)
Mark Wielaard 9a7063
+#       by 0x400F86A: call_init (dl-init.c:30)
Mark Wielaard 9a7063
+#       by 0x400F86A: _dl_init (dl-init.c:120)
Mark Wielaard 9a7063
+#       by 0x4000CB9: ??? (in /usr/lib64/ld-2.22.so)
Mark Wielaard 9a7063
+#
Mark Wielaard 9a7063
+# HEAP SUMMARY:
Mark Wielaard 9a7063
+#     in use at exit: 72,704 bytes in 1 blocks
Mark Wielaard 9a7063
+#   total heap usage: 4 allocs, 3 frees, 72,864 bytes allocated
Mark Wielaard 9a7063
+#
Mark Wielaard 9a7063
+# LEAK SUMMARY:
Mark Wielaard 9a7063
+#    definitely lost: 0 bytes in 0 blocks
Mark Wielaard 9a7063
+#    indirectly lost: 0 bytes in 0 blocks
Mark Wielaard 9a7063
+#      possibly lost: 0 bytes in 0 blocks
Mark Wielaard 9a7063
+#    still reachable: 72,704 bytes in 1 blocks
Mark Wielaard 9a7063
+#         suppressed: 0 bytes in 0 blocks
Mark Wielaard 9a7063
+
Mark Wielaard 9a7063
+{
Mark Wielaard 9a7063
+   malloc-leaks-cxx-stl-string-classes
Mark Wielaard 9a7063
+   Memcheck:Leak
Mark Wielaard 9a7063
+   match-leak-kinds: reachable
Mark Wielaard 9a7063
+   fun:malloc
Mark Wielaard b49a2b
+   obj:*/*lib*/libstdc++.so*
Mark Wielaard 9a7063
+   fun:call_init.part.0
Mark Wielaard 9a7063
+   fun:call_init
Mark Wielaard 9a7063
+   fun:_dl_init
Mark Wielaard 9a7063
+   obj:/usr/*lib*/ld-2.*.so
Mark Wielaard 9a7063
+}
Mark Wielaard 9a7063
+{
Mark Wielaard 9a7063
+  malloc-leaks-cxx-stl-string-classes-debug
Mark Wielaard 9a7063
+  Memcheck:Leak
Mark Wielaard 9a7063
+  match-leak-kinds: reachable
Mark Wielaard 9a7063
+  fun:malloc
Mark Wielaard 9a7063
+  fun:pool
Mark Wielaard 9a7063
+  fun:__static_initialization_and_destruction_0
Mark Wielaard 9a7063
+  fun:_GLOBAL__sub_I_eh_alloc.cc
Mark Wielaard 9a7063
+  fun:call_init.part.0
Mark Wielaard 9a7063
+  fun:call_init
Mark Wielaard 9a7063
+  fun:_dl_init
Mark Wielaard 9a7063
+  obj:/usr/*lib*/ld-2.*.so
Mark Wielaard 9a7063
+}
Mark Wielaard 9a7063
diff -ru valgrind-3.11.0.orig/configure valgrind-3.11.0/configure
Mark Wielaard 9a7063
--- valgrind-3.11.0.orig/configure	2016-03-10 22:08:46.236519482 +0100
Mark Wielaard 9a7063
+++ valgrind-3.11.0/configure	2016-03-10 22:09:01.550443864 +0100
Mark Wielaard 9a7063
@@ -7073,6 +7073,9 @@
Mark Wielaard 9a7063
     DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
Mark Wielaard 9a7063
 fi
Mark Wielaard 9a7063
 
Mark Wielaard 9a7063
+# Suppression file for libstdc++ until we solve KDE#345307
Mark Wielaard 9a7063
+DEFAULT_SUPP="libstdc++.supp ${DEFAULT_SUPP}"
Mark Wielaard 9a7063
+
Mark Wielaard 9a7063
 
Mark Wielaard 9a7063
 #----------------------------------------------------------------------------
Mark Wielaard 9a7063
 # Platform variants?