3 # Use valgrind to track down memory leaks associated with
4 # # pmDestroyContext().
5 # See http://oss.sgi.com/bugzilla/show_bug.cgi?id=1057
7 # Copyright (c) 2014 Ken McDonell. All Rights Reserved.
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
19 status
=1 # failure is the default!
20 $sudo rm -rf $tmp.
* $seq.full
21 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
25 # free pdubuf[size]: 0xe61000[28672] 0xe5c000[17408]
27 -e '/free pdubuf/s/0x[0-9a-f]*\[[0-9]*\]/addr[size]/g' \
29 /free pdubuf/ { if (NF <= 9) {
30 print " free pdubuf[size]: ... <= 7 buffers ..."
37 cat >$tmp.suppress
<<End-of-File
39 <pmid[], name[] realloc from qa main program>
45 <vm24 (SuSE 13.1, i586) version of above>
51 <alloc list[] in pmNewContext>
57 <realloc list[] in pmNewContext>
63 <alloc list[] in pmNewContext via pmDupContext>
70 <realloc list[] in pmNewContext via pmDupContext>
77 <strdup TZ in pmNewZone>
85 <zone[] alloc in pmNewZone>
92 <zone[] realloc in pmNewZone>
100 <case 1 - buf hdr in __pmFindPDUBuf from pmGetArchiveEnd>
106 fun:__pmGetArchiveEnd
110 <vm02 - openSUSE 12.1 version of above>
115 fun:__pmGetArchiveEnd
119 <case 1 - buf hdr in __pmFindPDUBuf from pmGetArchiveEnd - valloc variant>
126 fun:__pmGetArchiveEnd
130 <vm02 - openSUSE 12.1 version of above>
136 fun:__pmGetArchiveEnd
140 <case 2 - buf hdr in __pmFindPDUBuf from pmGetArchiveEnd>
147 fun:__pmGetArchiveEnd
151 <case 2 - buf hdr in __pmFindPDUBuf from pmGetArchiveEnd - valloc variant>
159 fun:__pmGetArchiveEnd
163 <case 1 - PDU buf alloc - cache_read>
170 fun:__pmLogFetchInterp
175 <vm02 - openSUSE 12.1 version of above>
186 <vm02 - openSUSE 12.1 version of above>
196 <case 2 - PDU buf alloc>
202 fun:__pmGetArchiveEnd
206 <case 3 - PDU buf alloc>
213 fun:__pmGetArchiveEnd
222 fun:__pmSetVersionIPC
227 <vm02 - openSUSE 12.1 valgrind snarfoo>
232 # and on vm07 this appears broken
233 # Conditional jump or move depends on uninitialised value(s)
234 # at 0x4016536: index (strchr.S:56)
235 # by 0x4007352: expand_dynamic_string_token (dl-load.c:431)
236 # by 0x4007791: _dl_map_object (dl-load.c:2261)
237 # by 0x400185D: map_doit (rtld.c:633)
238 # by 0x400D905: _dl_catch_error (dl-error.c:178)
239 # by 0x4001776: do_preload (rtld.c:817)
240 # by 0x400487C: dl_main (rtld.c:1683)
241 # by 0x4014A76: _dl_sysdep_start (dl-sysdep.c:243)
242 # by 0x4001422: _dl_start (rtld.c:338)
243 # by 0x4000AF7: ??? (in /lib/ld-2.11.3.so)
245 # by 0x7FF000046: ???
247 <vm07 ld/_dl_start botch>
250 fun:expand_dynamic_string_token
263 gcc_ver
=`gcc --version | sed -n -e '/^gcc/{
269 valgrind_ver
=`valgrind --version | sed -e 's/^valgrind-//'`
271 echo "gcc_ver=$gcc_ver" >>$seq.full
272 echo "valgrind_ver=$valgrind_ver" >>$seq.full
273 echo "machine=$machine" >>$seq.full
275 if [ "$machine" = i586
-o "$machine" = i686
]
277 # oddness on vm24 SuSE 13.1, i586 gcc 4.8.1, valgrind 3.8.1
278 # vm21 Debian 7.4, i686, gcc 4.7.2, valgrind 3.7.0
280 cat >>$tmp.suppress
<<End-of-File
282 Bad valgrind - bogus Conditional jump or move depends on uninitialised value(s)
284 fun:__pmLogFetchInterp
289 <malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)>
298 cat $tmp.suppress
>>$seq.full
301 # real QA test starts here
308 echo "=== pmNewContext ==="
312 echo "=== pmDupContext ==="
316 # don't want reachable reported ... caused QA failures on
317 # valgrind 3.10.1 (vm12 after upgrade to Fedora 22)
318 # reachable_opt='--show-reachable=yes'
321 --leak-check=full
--read-var-info=yes $reachable_opt \
322 --suppressions=$tmp.suppress
--log-file=$tmp.valgrind \
323 --gen-suppressions=all \
324 2>$tmp.valgrind.err
>$tmp.valgrind.out \
325 src
/churnctx
$arg -z -s 10 -a archives
/bug1057 kernel.all.load hinv.ncpu disk.dev.total
327 echo "=== std out ==="
328 cat $tmp.valgrind.out
329 echo "=== std err ===" |
tee -a $seq.full
330 cat $tmp.valgrind.err
>>$seq.full
331 _filter
< $tmp.valgrind.err
332 echo "=== valgrind report ===" >>$seq.full
333 cat $tmp.valgrind
>>$seq.full
334 echo "=== filtered valgrind report ==="
335 _filter_valgrind
<$tmp.valgrind