@@ -254,12 +254,13 @@ valgrind_setup() {
254
254
fi
255
255
256
256
# Set up valgrind command.
257
- _valgrind_setup_cmd=" valgrind \
258
- --log-file=${_valgrind_setup_logfilename} \
259
- --track-fds=yes \
260
- --trace-children=yes \
261
- --leak-check=full --show-leak-kinds=all \
262
- --errors-for-leak-kinds=all \
257
+ _valgrind_setup_cmd=" valgrind \
258
+ --log-file=${_valgrind_setup_logfilename} \
259
+ --track-fds=yes \
260
+ --trace-children=yes \
261
+ --leak-check=full \
262
+ --show-leak-kinds=all \
263
+ --errors-for-leak-kinds=all \
263
264
--suppressions=${valgrind_suppressions} "
264
265
echo " ${_valgrind_setup_cmd} "
265
266
}
@@ -333,9 +334,13 @@ _val_checkl() {
333
334
return
334
335
fi
335
336
336
- # Check the error summary.
337
+ # Check the error summary. Get the number of expected errors from the
338
+ # ${valgrind_fds_log} file. (Ideally this would be 0, but due to
339
+ # porting issues, some versions of valgrind on some platforms always
340
+ # report a non-zero number of errors.)
337
341
_val_checkl_num_errors=$( grep " ERROR SUMMARY: " " ${_val_checkl_logfile} " | awk ' {print $4}' )
338
- if [ " ${_val_checkl_num_errors} " -gt 0 ]; then
342
+ _val_checkl_num_errors_basic=$( grep " ERROR SUMMARY: " " ${valgrind_fds_log} " | awk ' { print $4}' )
343
+ if [ " ${_val_checkl_num_errors} " != " ${_val_checkl_num_errors_basic} " ]; then
339
344
# There was some other error(s) -- invalid read or write,
340
345
# conditional jump based on uninitialized value(s), invalid
341
346
# free, etc.
0 commit comments