Skip Menu |

This queue is for tickets about the Params-Validate CPAN distribution.

Report information
The Basics
Id: 80572
Status: resolved
Priority: 0/
Queue: Params-Validate

People
Owner: Nobody in particular
Requestors: carnil [...] debian.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.09



From: CARNIL [...] cpan.org
Subject: libparams-validate-perl: Segfault when using a Readonly spec
Hi This bug has been forwarded from http://bugs.debian.org/644949 Package: libparams-validate-perl Version: 0.97-1+b1 Severity: important Tags: upstream As the attached file shows, using the Readonly module to define a validation spec causes Params::Validate's XS code to segfault. -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (100, 'experimental') Architecture: i386 (i686) Kernel: Linux 3.0.0-2-686-pae (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages libparams-validate-perl depends on: ii libc6 2.13-21 ii perl 5.12.4-6 ii perl-base [perlapi-5.12.3] 5.12.4-6 libparams-validate-perl recommends no packages. libparams-validate-perl suggests no packages. -- no debconf information -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@debian.org> The mentioned script looks like: ----cut---------cut---------cut---------cut---------cut---------cut----- use strict; use Readonly; use Params::Validate qw(validate :types); Readonly::Hash my %spec => ( foo => { type => SCALAR } ); my @args = (foo => 'bar'); validate(@args, \%spec); ----cut---------cut---------cut---------cut---------cut---------cut----- Thanks in advance, Salvatore Bonaccorso, Debian Perl Group
On Fri Nov 02 13:31:38 2012, CARNIL wrote: Show quoted text
> Hi > > This bug has been forwarded from http://bugs.debian.org/644949 > > Package: libparams-validate-perl > Version: 0.97-1+b1 > Severity: important > Tags: upstream > > As the attached file shows, using the Readonly module to define a > validation spec causes Params::Validate's XS code to segfault. > > -- System Information: > Debian Release: wheezy/sid > APT prefers unstable > APT policy: (500, 'unstable'), (100, 'experimental') > Architecture: i386 (i686) > > Kernel: Linux 3.0.0-2-686-pae (SMP w/2 CPU cores) > Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) > Shell: /bin/sh linked to /bin/dash > > Versions of packages libparams-validate-perl depends on: > ii libc6 2.13-21 > ii perl 5.12.4-6 > ii perl-base [perlapi-5.12.3] 5.12.4-6 > > libparams-validate-perl recommends no packages. > > libparams-validate-perl suggests no packages. > > -- no debconf information >
I can replicate this, but I'm not really sure how to fix it yet.
From: paul [...] city-fan.org
On Fri Nov 16 12:05:40 2012, DROLSKY wrote: Show quoted text
> On Fri Nov 02 13:31:38 2012, CARNIL wrote:
> > Hi > > > > This bug has been forwarded from http://bugs.debian.org/644949 > > > > Package: libparams-validate-perl > > Version: 0.97-1+b1 > > Severity: important > > Tags: upstream > > > > As the attached file shows, using the Readonly module to define a > > validation spec causes Params::Validate's XS code to segfault. > > > > -- System Information: > > Debian Release: wheezy/sid > > APT prefers unstable > > APT policy: (500, 'unstable'), (100, 'experimental') > > Architecture: i386 (i686) > > > > Kernel: Linux 3.0.0-2-686-pae (SMP w/2 CPU cores) > > Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) > > Shell: /bin/sh linked to /bin/dash > > > > Versions of packages libparams-validate-perl depends on: > > ii libc6 2.13-21 > > ii perl 5.12.4-6 > > ii perl-base [perlapi-5.12.3] 5.12.4-6 > > > > libparams-validate-perl recommends no packages. > > > > libparams-validate-perl suggests no packages. > > > > -- no debconf information > >
> > I can replicate this, but I'm not really sure how to fix it yet.
The new test in t/release-pp-23-readonly.t is failing for me on perl 5.8.x: $ LC_ALL=en_US RELEASE_TESTING=1 ./Build test t/01-validate.t ......................... ok t/02-noop.t ............................. ok t/03-attribute.t ........................ ok t/04-defaults.t ......................... ok t/05-noop_default.t ..................... ok t/06-options.t .......................... ok t/07-with.t ............................. ok t/08-noop_with.t ........................ ok t/09-regex.t ............................ ok t/10-noop_regex.t ....................... ok t/11-cb.t ............................... ok t/12-noop_cb.t .......................... ok t/13-taint.t ............................ ok t/14-no_validate.t ...................... ok t/15-case.t ............................. ok t/16-normalize.t ........................ ok t/17-callbacks.t ........................ ok t/18-depends.t .......................... ok t/19-untaint.t .......................... ok t/21-can.t .............................. ok t/22-overload-can-bug.t ................. ok t/23-readonly.t ......................... ok t/24-tied.t ............................. ok t/25-undef-regex.t ...................... ok t/26-isa.t .............................. ok t/27-string-as-type.t ................... ok t/28-readonly-return.t .................. ok t/29-taint-mode.t ....................... ok t/30-hashref-alteration.t ............... ok t/31-incorrect-spelling.t ............... skipped: Spec validation is disabled for now t/32-regex-as-value.t ................... ok t/33-keep-errsv.t ....................... ok t/34-recursive-validation.t ............. ok t/35-default-xs-bug.t ................... ok t/35-large-arrays.t ..................... ok t/release-cpan-changes.t ................ ok t/release-eol.t ......................... ok t/release-no-tabs.t ..................... ok t/release-pod-coverage.t ................ ok t/release-pod-linkcheck.t ............... skipped: Test::Pod::LinkCheck required for testing POD t/release-pod-no404s.t .................. skipped: Test::Pod::No404s required for testing POD t/release-pod-spell.t ................... ok t/release-pod-syntax.t .................. ok t/release-pp-01-validate.t .............. ok t/release-pp-02-noop.t .................. ok t/release-pp-03-attribute.t ............. ok t/release-pp-04-defaults.t .............. ok t/release-pp-05-noop_default.t .......... ok t/release-pp-06-options.t ............... ok t/release-pp-07-with.t .................. ok t/release-pp-08-noop_with.t ............. ok t/release-pp-09-regex.t ................. ok t/release-pp-10-noop_regex.t ............ ok t/release-pp-11-cb.t .................... ok t/release-pp-12-noop_cb.t ............... ok t/release-pp-13-taint.t ................. ok t/release-pp-14-no_validate.t ........... ok t/release-pp-15-case.t .................. ok t/release-pp-16-normalize.t ............. ok t/release-pp-17-callbacks.t ............. ok t/release-pp-18-depends.t ............... ok t/release-pp-19-untaint.t ............... ok t/release-pp-21-can.t ................... ok t/release-pp-22-overload-can-bug.t ...... ok # Failed test 'validate() call succeeded with Readonly spec hash' # at t/release-pp-23-readonly.t line 44. # got: 'The 'foo' parameter ("hello") has a type specification which is not a number. It is a string - 1. # Use the constants exported by Params::Validate to declare types. at /builddir/build/BUILD/Params-Validate-1.09/blib/lib/Params/Validate/PP.pm line 638 # Params::Validate::PP::__ANON__('The \'foo\' parameter ("hello") has a type specification whic...') called at /builddir/build/BUILD/Params-Validate-1.09/blib/lib/Params/Validate/PP.pm line 470 # Params::Validate::PP::_validate_one_param('hello', 'HASH(0x1af3cb0)', 'HASH(0x1cccc60)', 'The \'foo\' parameter ("hello")') called at /builddir/build/BUILD/Params-Validate-1.09/blib/lib/Params/Validate/PP.pm line 339 # Params::Validate::PP::validate('ARRAY(0x1c86728)', 'HASH(0x1d39868)') called at t/release-pp-23-readonly.t line 43 # eval {...} called at t/release-pp-23-readonly.t line 43 # ' # expected: '' # Looks like you failed 1 test of 3. t/release-pp-23-readonly.t .............. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/3 subtests t/release-pp-24-tied.t .................. ok t/release-pp-25-undef-regex.t ........... ok t/release-pp-26-isa.t ................... ok t/release-pp-27-string-as-type.t ........ ok t/release-pp-28-readonly-return.t ....... ok t/release-pp-29-taint-mode.t ............ ok t/release-pp-30-hashref-alteration.t .... ok t/release-pp-31-incorrect-spelling.t .... skipped: Spec validation is disabled for now t/release-pp-32-regex-as-value.t ........ ok t/release-pp-33-keep-errsv.t ............ ok t/release-pp-34-recursive-validation.t .. ok t/release-pp-35-default-xs-bug.t ........ ok t/release-pp-35-large-arrays.t .......... ok t/release-pp-is-loaded.t ................ ok t/release-xs-is-loaded.t ................ ok t/release-xs-segfault.t ................. ok Test Summary Report ------------------- t/34-recursive-validation.t (Wstat: 0 Tests: 1 Failed: 0) TODO passed: 1 t/release-pp-23-readonly.t (Wstat: 256 Tests: 3 Failed: 1) Failed test: 3 Non-zero exit status: 1 Files=81, Tests=1264, 4 wallclock secs ( 0.36 usr 0.09 sys + 3.31 cusr 0.35 csys = 4.11 CPU) Result: FAIL Failed 1/81 test programs. 1/1264 subtests failed. The regular XS version of the test works fine as you can see. Any ideas?
What version of Readonly do you have installed?
From: paul [...] city-fan.org
On Sun May 04 21:32:55 2014, DROLSKY wrote: Show quoted text
> What version of Readonly do you have installed?
Readonly 1.04 Readonly::XS 1.05
On Mon May 05 07:08:58 2014, paul@city-fan.org wrote: Show quoted text
> On Sun May 04 21:32:55 2014, DROLSKY wrote:
> > What version of Readonly do you have installed?
> > Readonly 1.04 > Readonly::XS 1.05
The new Readonly doesn't use the XS version any more. I installed Readonly 1.04 with Perl 5.8.8 but I can't reproduce this. Regardless, it'd be helpful for me if you could create a new ticket for this problem. I'm going to close this one since the original problem (the segfault) has been fixed.