1 # Below is a temporary patch (slightly modified) from
2 # 345307 - Warning about "still reachable" memory when using libstdc++ from gcc 5
3 # This patch is not needed anymore if libstdc++ provides __gnu_cxx::__freeres
4 # but we still need to ignore these allocations during the leak_cpp_interior
5 # to have the test behaviour not depending on libstdc++ version.
9 # Some programs are using the C++ STL and string classes.
10 # Valgrind reports 'still reachable' memory leaks involving these classes
11 # at the exit of the program, but there should be none.
13 # Many implementations of the C++ standard libraries use their own memory
14 # pool allocators. Memory for quite a number of destructed objects is not
15 # immediately freed and given back to the OS, but kept in the pool(s) for
16 # later re-use. The fact that the pools are not freed at the exit of the
17 # program cause Valgrind to report this memory as still reachable.
19 # The behavior not to free pools at the exit could be called a bug of the
22 # Using GCC, you can force the STL to use malloc and to free memory as soon
23 # as possible by globally disabling memory caching. Beware! Doing so will
24 # probably slow down your program, sometimes drastically.
26 # There are other ways to disable memory pooling: using the malloc_alloc
27 # template with your objects (not portable, but should work for GCC) or
28 # even writing your own memory allocators. But beware: allocators belong
29 # to the more messy parts of the STL and people went to great lengths to
30 # make the STL portable across platforms. Chances are good that your
31 # solution will work on your platform, but not on others.
33 # 72,704 bytes in 1 blocks are still reachable in loss record 1 of 1
34 # at 0x4C28D06: malloc (vg_replace_malloc.c:299)
35 # by 0x50C317F: ??? (in /usr/lib64/libstdc++.so.6.0.21)
36 # by 0x400F759: call_init.part.0 (dl-init.c:72)
37 # by 0x400F86A: call_init (dl-init.c:30)
38 # by 0x400F86A: _dl_init (dl-init.c:120)
39 # by 0x4000CB9: ??? (in /usr/lib64/ld-2.22.so)
42 # in use at exit: 72,704 bytes in 1 blocks
43 # total heap usage: 4 allocs, 3 frees, 72,864 bytes allocated
46 # definitely lost: 0 bytes in 0 blocks
47 # indirectly lost: 0 bytes in 0 blocks
48 # possibly lost: 0 bytes in 0 blocks
49 # still reachable: 72,704 bytes in 1 blocks
50 # suppressed: 0 bytes in 0 blocks
53 malloc-leaks-cxx-stl-string-classes
55 match-leak-kinds: reachable
57 obj:*lib*/libstdc++.so*
64 malloc-leaks-cxx-stl-string-classes-debug
66 match-leak-kinds: reachable
69 fun:__static_initialization_and_destruction_0
70 fun:_GLOBAL__sub_I_eh_alloc.cc