You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/07/27 07:18:13 UTC

[2/4] git commit: Rework valgrind suppressions.

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/4295d303
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/4295d303
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/4295d303

Branch: refs/heads/more_mingw_fixes_for_0.4
Commit: 4295d303ba28289d20e4192c5f75c97aa03c482a
Parents: b8cfae5
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Jul 23 19:11:19 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sun Jul 27 02:05:38 2014 +0100

----------------------------------------------------------------------
 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/4295d303/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/4295d303/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 ) ) {