Enable valgrind leak-check=full for definite leaks only.
Only for definite leaks, avoid deluge of "possibly lost" noise from python.
@@ -116,7 +116,12 @@ VALGRIND_ERROR = 42 # magic number indicating valgrind found errors
def with_valgrind(args, outfile=None):
if use_valgrind() and is_binary_exe(find_exe(args[0])):
opts = ['--trace-children=yes',
- # '--leak-check=full', way too noisy due to Python leaks
+ '--leak-check=full',
+ # Python generates a ton of "possibly lost" and "still in use"
+ # false alarms, restrict to "definite" leaks.
+ # Ideally we should have more specific python exclusions.
+ '--show-leak-kinds=definite',
+ '--errors-for-leak-kinds=definite',
'--demangle=yes',
'--num-callers=12',
'--error-exitcode=%d' % VALGRIND_ERROR,
