qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 828
blob0e02d0b25ef3bc00cb5c84fcb9e496e65719dd9e
1 #!/bin/sh
2 # PCP QA Test No. 828
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.
10 seq=`basename $0`
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
14 . ./common.product
15 . ./common.filter
16 . ./common.check
17 _check_valgrind
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
23 _filter()
25 # free pdubuf[size]: 0xe61000[28672] 0xe5c000[17408]
26 sed \
27 -e '/free pdubuf/s/0x[0-9a-f]*\[[0-9]*\]/addr[size]/g' \
28 | $PCP_AWK_PROG '
29 /free pdubuf/ { if (NF <= 9) {
30 print " free pdubuf[size]: ... <= 7 buffers ..."
31 next
34 { print }'
37 cat >$tmp.suppress <<End-of-File
39 <pmid[], name[] realloc from qa main program>
40 Memcheck:Leak
41 fun:realloc
42 fun:main
45 <vm24 (SuSE 13.1, i586) version of above>
46 Memcheck:Leak
47 fun:realloc
48 fun:(below main)
51 <alloc list[] in pmNewContext>
52 Memcheck:Leak
53 fun:malloc
54 fun:pmNewContext
57 <realloc list[] in pmNewContext>
58 Memcheck:Leak
59 fun:realloc
60 fun:pmNewContext
63 <alloc list[] in pmNewContext via pmDupContext>
64 Memcheck:Leak
65 fun:malloc
66 fun:pmNewContext
67 fun:pmDupContext
70 <realloc list[] in pmNewContext via pmDupContext>
71 Memcheck:Leak
72 fun:realloc
73 fun:pmNewContext
74 fun:pmDupContext
77 <strdup TZ in pmNewZone>
78 Memcheck:Leak
79 fun:malloc
80 fun:strdup
81 fun:pmNewZone
82 fun:pmNewContextZone
85 <zone[] alloc in pmNewZone>
86 Memcheck:Leak
87 fun:malloc
88 fun:pmNewZone
89 fun:pmNewContextZone
92 <zone[] realloc in pmNewZone>
93 Memcheck:Leak
94 fun:malloc
95 fun:realloc
96 fun:pmNewZone
97 fun:pmNewContextZone
100 <case 1 - buf hdr in __pmFindPDUBuf from pmGetArchiveEnd>
101 Memcheck:Leak
102 fun:malloc
103 fun:__pmFindPDUBuf
104 fun:__pmLogRead
106 fun:__pmGetArchiveEnd
107 fun:pmGetArchiveEnd
110 <vm02 - openSUSE 12.1 version of above>
111 Memcheck:Leak
112 fun:malloc
113 fun:__pmFindPDUBuf
114 fun:__pmLogRead
115 fun:__pmGetArchiveEnd
116 obj:*
119 <case 1 - buf hdr in __pmFindPDUBuf from pmGetArchiveEnd - valloc variant>
120 Memcheck:Leak
121 fun:memalign
122 fun:valloc
123 fun:__pmFindPDUBuf
124 fun:__pmLogRead
126 fun:__pmGetArchiveEnd
127 fun:pmGetArchiveEnd
130 <vm02 - openSUSE 12.1 version of above>
131 Memcheck:Leak
132 fun:memalign
133 fun:valloc
134 fun:__pmFindPDUBuf
135 fun:__pmLogRead
136 fun:__pmGetArchiveEnd
137 obj:*
140 <case 2 - buf hdr in __pmFindPDUBuf from pmGetArchiveEnd>
141 Memcheck:Leak
142 fun:malloc
143 fun:__pmFindPDUBuf
144 fun:__pmDecodeResult
145 fun:__pmLogRead
147 fun:__pmGetArchiveEnd
148 fun:pmGetArchiveEnd
151 <case 2 - buf hdr in __pmFindPDUBuf from pmGetArchiveEnd - valloc variant>
152 Memcheck:Leak
153 fun:memalign
154 fun:valloc
155 fun:__pmFindPDUBuf
156 fun:__pmDecodeResult
157 fun:__pmLogRead
159 fun:__pmGetArchiveEnd
160 fun:pmGetArchiveEnd
163 <case 1 - PDU buf alloc - cache_read>
164 Memcheck:Leak
166 fun:__pmFindPDUBuf
168 fun:__pmLogRead
170 fun:__pmLogFetchInterp
171 fun:__pmLogFetch
172 fun:pmFetch
175 <vm02 - openSUSE 12.1 version of above>
176 Memcheck:Leak
177 fun:memalign
178 fun:valloc
179 fun:__pmFindPDUBuf
180 fun:__pmLogRead
181 fun:cache_read
182 fun:do_roll
183 obj:*
186 <vm02 - openSUSE 12.1 version of above>
187 Memcheck:Leak
188 fun:malloc
189 fun:__pmFindPDUBuf
190 fun:__pmLogRead
191 fun:cache_read
192 fun:do_roll
193 obj:*
196 <case 2 - PDU buf alloc>
197 Memcheck:Leak
199 fun:__pmFindPDUBuf
200 fun:__pmLogRead
202 fun:__pmGetArchiveEnd
203 fun:pmGetArchiveEnd
206 <case 3 - PDU buf alloc>
207 Memcheck:Leak
208 fun:memalign
209 fun:__pmFindPDUBuf
210 fun:__pmDecodeResult
211 fun:__pmLogRead
213 fun:__pmGetArchiveEnd
214 fun:pmGetArchiveEnd
217 <ipc[] table resize>
218 Memcheck:Leak
219 fun:malloc
220 fun:realloc
222 fun:__pmSetVersionIPC
223 fun:__pmLogChkLabel
224 fun:__pmLogChangeVol
227 <vm02 - openSUSE 12.1 valgrind snarfoo>
228 Memcheck:Cond
229 fun:strlen
230 obj:*
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)
244 # by 0x8: ???
245 # by 0x7FF000046: ???
247 <vm07 ld/_dl_start botch>
248 Memcheck:Cond
249 fun:index
250 fun:expand_dynamic_string_token
251 fun:_dl_map_object
252 fun:map_doit
253 fun:_dl_catch_error
254 fun:do_preload
255 fun:dl_main
256 fun:_dl_sysdep_start
257 fun:_dl_start
259 obj:*
261 End-of-File
263 gcc_ver=`gcc --version | sed -n -e '/^gcc/{
264 s/^gcc //
265 s/^([^)]*) //
266 s/ .*//
269 valgrind_ver=`valgrind --version | sed -e 's/^valgrind-//'`
270 machine=`uname -m`
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 ]
276 then
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)
283 Memcheck:Cond
284 fun:__pmLogFetchInterp
285 fun:__pmLogFetch
286 fun:pmFetch
289 <malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)>
290 Memcheck:Leak
291 fun:malloc
292 fun:(below main)
294 End-of-File
297 echo >>$seq.full
298 cat $tmp.suppress >>$seq.full
299 echo >>$seq.full
301 # real QA test starts here
303 for arg in "" -d
305 case "$arg"
308 echo "=== pmNewContext ==="
311 echo
312 echo "=== pmDupContext ==="
314 esac
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'
320 valgrind \
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
336 done
338 # success, all done
339 status=0
341 exit