Subject: | segv on perl 5.6.0 in Params::Validate test suite |
Date: | Mon, 3 Sep 2007 21:52:18 +0100 |
To: | bug-params-validate [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
On my system, Params::Validate 0.88 incurs a segfault during its test
suite if compiled for perl 5.6.0. This happens in 06-options.t, after
generating an "Attempt to free unreferenced scalar" warning message.
14-no_validate generates three such warnings, but doesn't actually
segfault.
Since some of the test scripts just omit all testing on 5.6.0, with
the justification that the tests generate core dumps, I presume the
appropriate resolution is to skip these scripts too. Actually they
already skip a subset of the tests on 5.6.0; it appears that this needs
to be widened to the whole script. The patch below does this.
For the record, I don't actually use 5.6.0 myself. I'm just trying to
get my modules, and necessarily all of their dependencies, to work on
all versions 5.6.0 onwards.
START_PATCH
--- Params-Validate-0.88.orig/t/06-options.t 2006-01-21 17:57:25.000000000 +0000
+++ Params-Validate-0.88/t/06-options.t 2007-09-03 21:35:21.000452979 +0100
@@ -10,7 +10,14 @@
}
use Test;
-plan test => $] == 5.006 ? 3 : 7;
+
+if ( $] == 5.006 )
+{
+ print "1..0 # Skip buggy perl 5.6.0\n";
+ exit 0;
+}
+
+plan test => 7;
Params::Validate::validation_options( stack_skip => 2 );
@@ -34,17 +41,13 @@
ok( $@ );
-unless ( $] == 5.006 )
-{
- ok( $@ =~ /mandatory.*missing.*call to main::baz/i );
+ok( $@ =~ /mandatory.*missing.*call to main::baz/i );
- Params::Validate::validation_options
- ( on_fail => sub { die bless { hash => 'ref' }, 'Dead' } );
+Params::Validate::validation_options
+ ( on_fail => sub { die bless { hash => 'ref' }, 'Dead' } );
- eval { baz() };
-
- ok( $@ );
- ok( $@->{hash} eq 'ref' );
- ok( UNIVERSAL::isa( $@, 'Dead' ) );
-}
+eval { baz() };
+ok( $@ );
+ok( $@->{hash} eq 'ref' );
+ok( UNIVERSAL::isa( $@, 'Dead' ) );
--- Params-Validate-0.88.orig/t/14-no_validate.t 2006-01-21 17:57:25.000000000 +0000
+++ Params-Validate-0.88/t/14-no_validate.t 2007-09-03 21:35:57.101431999 +0100
@@ -7,7 +7,14 @@
use Params::Validate qw(validate);
use Test;
-plan test => $] == 5.006 ? 2 : 3;
+
+if ( $] == 5.006 )
+{
+ print "1..0 # Skip buggy perl 5.6.0\n";
+ exit 0;
+}
+
+plan test => 3;
eval { foo() };
ok( $@ =~ /parameter 'foo'/ );
@@ -19,11 +26,8 @@
ok( ! $@ );
}
-unless ( $] == 5.006 )
-{
- eval { foo() };
- ok( $@ =~ /parameter 'foo'/ );
-}
+eval { foo() };
+ok( $@ =~ /parameter 'foo'/ );
sub foo
{
END_PATCH
-zefram