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:12 UTC

[1/4] git commit: Fix valgrind tests with Debian's debugperl

Repository: lucy-clownfish
Updated Branches:
  refs/heads/more_mingw_fixes_for_0.4 [created] 727bc7310


Fix valgrind tests with Debian's debugperl

With Debian's debugperl, the test for -DDEBUGGING fails, so make an
exception. See Debian bug #332629.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/6bde44ee
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/6bde44ee
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/6bde44ee

Branch: refs/heads/more_mingw_fixes_for_0.4
Commit: 6bde44eef7a254280a79c17a0268053a01db4045
Parents: 4295d30
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Jul 24 12:44:30 2014 +0200
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sun Jul 27 02:05:38 2014 +0100

----------------------------------------------------------------------
 runtime/perl/buildlib/Clownfish/Build.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6bde44ee/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm
index 7a2ed73..ede06fc 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -181,8 +181,11 @@ sub _valgrind_base_command {
 #   $ ./Build test_valgrind --suppressions=foo.supp,bar.supp
 sub ACTION_test_valgrind {
     my $self = shift;
+    # Debian's debugperl uses the Config.pm of the standard system perl
+    # so -DDEBUGGING won't be detected.
     die "Must be run under a perl that was compiled with -DDEBUGGING"
-        unless $self->config('ccflags') =~ /-D?DEBUGGING\b/;
+        unless $self->config('ccflags') =~ /-D?DEBUGGING\b/
+               || $^X =~ /\bdebugperl\b/;
     if ( !$ENV{LUCY_VALGRIND} ) {
         warn "\$ENV{LUCY_VALGRIND} not true -- possible false positives";
     }


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

Posted by ma...@apache.org.
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 ) ) {


[4/4] git commit: Add LIBRARY_PATH for MinGW's sake.

Posted by ma...@apache.org.
Add LIBRARY_PATH for MinGW's sake.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/727bc731
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/727bc731
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/727bc731

Branch: refs/heads/more_mingw_fixes_for_0.4
Commit: 727bc731040e927e09a6d23aa92d98490e959294
Parents: 6bde44e
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Sun Jul 27 06:01:53 2014 +0100
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sun Jul 27 06:02:23 2014 +0100

----------------------------------------------------------------------
 devel/bin/setup_env.bat | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/727bc731/devel/bin/setup_env.bat
----------------------------------------------------------------------
diff --git a/devel/bin/setup_env.bat b/devel/bin/setup_env.bat
index dd734c7..23f9911 100644
--- a/devel/bin/setup_env.bat
+++ b/devel/bin/setup_env.bat
@@ -33,6 +33,8 @@ call :add_to_path "%C_INCLUDE_PATH%" "%runtime_dir%\perl\xs"
 set C_INCLUDE_PATH=%retval%
 call :add_to_path "%LIB%" "%runtime_dir%\c"
 set LIB=%retval%
+call :add_to_path "%LIBRARY_PATH%" "%runtime_dir%\c"
+set LIBRARY_PATH=%retval%
 call :add_to_path "%CLOWNFISH_INCLUDE%" "%runtime_dir%\core"
 set CLOWNFISH_INCLUDE=%retval%
 call :add_to_path "%PERL5LIB%" "%compiler_dir%\perl\blib\arch"
@@ -49,6 +51,7 @@ endlocal & (
     set "INCLUDE=%INCLUDE%"
     set "C_INCLUDE_PATH=%C_INCLUDE_PATH%"
     set "LIB=%LIB%"
+    set "LIBRARY_PATH=%LIBRARY_PATH%"
     set "CLOWNFISH_INCLUDE=%CLOWNFISH_INCLUDE%"
     set "PERL5LIB=%PERL5LIB%"
 )


[3/4] git commit: Fix some test-only memory leaks.

Posted by ma...@apache.org.
Fix some test-only memory leaks.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/b8cfae56
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/b8cfae56
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/b8cfae56

Branch: refs/heads/more_mingw_fixes_for_0.4
Commit: b8cfae56415acd084f299b42c21988c96ef2be7d
Parents: 4e8f130
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Jul 23 15:39:48 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sun Jul 27 02:05:38 2014 +0100

----------------------------------------------------------------------
 runtime/core/Clownfish/Test/TestCharBuf.c |  2 +-
 runtime/core/Clownfish/Test/TestString.c  |  5 +----
 runtime/core/Clownfish/Test/TestVArray.c  |  6 +++---
 runtime/perl/t/binding/019-obj.t          | 12 ++++++++----
 4 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b8cfae56/runtime/core/Clownfish/Test/TestCharBuf.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestCharBuf.c b/runtime/core/Clownfish/Test/TestCharBuf.c
index d6d4d50..39cb09c 100644
--- a/runtime/core/Clownfish/Test/TestCharBuf.c
+++ b/runtime/core/Clownfish/Test/TestCharBuf.c
@@ -110,6 +110,7 @@ test_Mimic_and_Clone(TestBatchRunner *runner) {
     DECREF(got);
 
     DECREF(wanted);
+    DECREF(wanted_cb);
 }
 
 /*
@@ -296,4 +297,3 @@ TestCB_Run_IMP(TestCharBuf *self, TestBatchRunner *runner) {
     test_Mimic_and_Clone(runner);
 }
 
-

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b8cfae56/runtime/core/Clownfish/Test/TestString.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestString.c b/runtime/core/Clownfish/Test/TestString.c
index 4e506ff..7eff793 100644
--- a/runtime/core/Clownfish/Test/TestString.c
+++ b/runtime/core/Clownfish/Test/TestString.c
@@ -99,12 +99,9 @@ test_Cat(TestBatchRunner *runner) {
 static void
 test_Clone(TestBatchRunner *runner) {
     String *wanted = S_get_str("foo");
-    String *got    = S_get_str("bar");
-
-    got = Str_Clone(wanted);
+    String *got    = Str_Clone(wanted);
     TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Clone");
     DECREF(got);
-
     DECREF(wanted);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b8cfae56/runtime/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestVArray.c b/runtime/core/Clownfish/Test/TestVArray.c
index 3975090..f817944 100644
--- a/runtime/core/Clownfish/Test/TestVArray.c
+++ b/runtime/core/Clownfish/Test/TestVArray.c
@@ -64,9 +64,9 @@ test_Equals(TestBatchRunner *runner) {
     TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
                "Non-matching value spoils Equals");
 
-    VA_Excise(array, 1, 2); // removes empty elems
-    VA_Delete(other, 1);    // leaves NULL in place of deleted elem
-    VA_Delete(other, 2);
+    VA_Excise(array, 1, 2);       // removes empty elems
+    DECREF(VA_Delete(other, 1));  // leaves NULL in place of deleted elem
+    DECREF(VA_Delete(other, 2));
     TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
                "Empty trailing elements spoil Equals");
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b8cfae56/runtime/perl/t/binding/019-obj.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/binding/019-obj.t b/runtime/perl/t/binding/019-obj.t
index 0c2734f..347ea65 100644
--- a/runtime/perl/t/binding/019-obj.t
+++ b/runtime/perl/t/binding/019-obj.t
@@ -61,10 +61,14 @@ my $object = TestObj->new;
 isa_ok( $object, "Clownfish::Obj",
     "Clownfish objects can be subclassed" );
 
-my $thawed = TestObj->new;
-eval { freeze($thawed) };
-like( $@, qr/implement/i,
-    "freezing an Obj throws an exception rather than segfaults" );
+SKIP: {
+    skip( "Exception thrown within STORABLE hook leaks", 1 )
+        if $ENV{LUCY_VALGRIND};
+    my $thawed = TestObj->new;
+    eval { freeze($thawed) };
+    like( $@, qr/implement/i,
+        "freezing an Obj throws an exception rather than segfaults" );
+}
 
 my $fake = bless {}, 'ThawTestObj';
 my $frozen = freeze($fake);