Repository: lucy-clownfish Updated Branches: refs/heads/valgrind_fixes_0.4 63759a460 -> 04e099c90
Rework valgrind suppressions. Add a new suppressions files with multi-level wildcards. Eliminate the local.supp autogenerated suppressions file. Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/04e099c9 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/04e099c9 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/04e099c9 Branch: refs/heads/valgrind_fixes_0.4 Commit: 04e099c907fa15bb95050237c7a5214e3cc445e4 Parents: 63759a4 Author: Marvin Humphrey <[email protected]> Authored: Wed Jul 23 19:11:19 2014 -0700 Committer: Marvin Humphrey <[email protected]> Committed: Wed Jul 23 19:15:59 2014 -0700 ---------------------------------------------------------------------- devel/conf/cfruntime-perl.supp | 39 +++++++++++++++++++++++++ runtime/perl/buildlib/Clownfish/Build.pm | 41 ++------------------------- 2 files changed, 41 insertions(+), 39 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/04e099c9/devel/conf/cfruntime-perl.supp ---------------------------------------------------------------------- diff --git a/devel/conf/cfruntime-perl.supp b/devel/conf/cfruntime-perl.supp new file mode 100644 index 0000000..55dab07 --- /dev/null +++ b/devel/conf/cfruntime-perl.supp @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +{ + <boot_Clownfish> + Memcheck:Leak + ... + fun:boot_Clownfish + ... +} + +{ + <XS_DynaLoader_dl_load_file> + Memcheck:Leak + ... + fun:XS_DynaLoader_dl_load_file + ... +} + +{ + <cfish_Class_singleton> + Memcheck:Leak + ... + fun:cfish_Class_singleton + ... +} + http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/04e099c9/runtime/perl/buildlib/Clownfish/Build.pm ---------------------------------------------------------------------- diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm index 481ab25..7a2ed73 100644 --- a/runtime/perl/buildlib/Clownfish/Build.pm +++ b/runtime/perl/buildlib/Clownfish/Build.pm @@ -160,49 +160,13 @@ sub ACTION_compile_custom_xs { $self->SUPER::ACTION_compile_custom_xs; } -sub ACTION_suppressions { - my $self = shift; - my $LOCAL_SUPP = 'local.supp'; - return - if $self->up_to_date( '../devel/bin/valgrind_triggers.pl', - $LOCAL_SUPP ); - - # Generate suppressions. - print "Writing $LOCAL_SUPP...\n"; - $self->add_to_cleanup($LOCAL_SUPP); - my $command - = "yes | " - . $self->_valgrind_base_command - . "--gen-suppressions=yes " - . $self->perl - . " ../devel/bin/valgrind_triggers.pl 2>&1"; - my $suppressions = `$command`; - $suppressions =~ s/^==.*?\n//mg; - $suppressions =~ s/^--.*?\n//mg; - my $rule_number = 1; - - while ( $suppressions =~ /<insert.a.*?>/ ) { - $suppressions =~ s/^\s*<insert.a.*?>/{\n <core_perl_$rule_number>/m; - $rule_number++; - } - - # Change e.g. fun:_vgrZU_libcZdsoZa_calloc to fun:calloc - $suppressions =~ s/fun:\w+_((m|c|re)alloc)/fun:$1/g; - - # Write local suppressions file. - open( my $supp_fh, '>', $LOCAL_SUPP ) - or confess("Can't open '$LOCAL_SUPP': $!"); - print $supp_fh $suppressions; -} - sub _valgrind_base_command { return "PERL_DESTRUCT_LEVEL=2 LUCY_VALGRIND=1 valgrind " . "--leak-check=yes " . "--show-reachable=yes " - . "--num-callers=10 " . "--dsymutil=yes " - . "--suppressions=../devel/conf/lucyperl.supp "; + . "--suppressions=../../devel/conf/cfruntime-perl.supp "; } # Run the entire test suite under Valgrind. @@ -222,13 +186,12 @@ sub ACTION_test_valgrind { if ( !$ENV{LUCY_VALGRIND} ) { warn "\$ENV{LUCY_VALGRIND} not true -- possible false positives"; } - $self->depends_on(qw( code suppressions )); + $self->depends_on('code'); # Unbuffer STDOUT, grab test file names and suppressions files. $|++; my $t_files = $self->find_test_files; # not public M::B API, may fail my $valgrind_command = $self->_valgrind_base_command; - $valgrind_command .= "--suppressions=local.supp "; if ( my $local_supp = $self->args('suppressions') ) { for my $supp ( split( ',', $local_supp ) ) {
