Skip Menu |
Report information
Id: 131824
Status: resolved
Priority: 0/
Queue: perl5

Owner: jkeenan <jkeenan [at] cpan.org>
Requestors: jkeenan [at] pobox.com
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: BBC
Perl Version: 5.27.3
Fixed In: (no value)



Subject: Bleadperl breaks Data-Printer-0.39
From: James E Keenan <jkeenan [...] pobox.com>
CC: Carlos Guevara <carlos [...] carlosguevara.com>, garu [...] cpan.org
Date: Mon, 31 Jul 2017 20:09:19 -0400
To: perlbug [...] perl.org
Download (untitled) / with headers
text/plain 1.5k
Data-Printer-0.39 is failing on blead perl. Carlos Guevara called my attention to these failures: http://fast-matrix.cpantesters.org/?dist=Data-Printer;os=freebsd;perl=5.27.3;reports=1. They persist as of commit 1fb2d101eac30e2ec4b826a4c493bb6f1232dc16, whereat I attempted to install via cpanm. ##### $ ~/testing/blead/bin/prove -I~/testing/blead/lib -vb t/19-tied.t t/19-tied.t .. ok 1 - untied scalar shows only the scalar ok 2 - tied scalar contains tied message ok 3 - cleared (untied) scalar again shows no tie information ok 4 - untied array shows only the array ok 5 - tied array contains tied message ok 6 - cleared (untied) array again shows no tie information ok 7 - untied hash shows only the hash not ok 8 - tied hash contains tied message # Failed test 'tied hash contains tied message' # at t/19-tied.t line 139. # got: '{} (tied to Tie::Fighter::Hash)' # expected: '{ # test 42 # } (tied to Tie::Fighter::Hash)' ok 9 - cleared (untied) hash again shows no tie information ok 10 - untied handle properly referenced ok 11 - untied handle shows only the handle itself ok 12 - tied handle contains tied message ok 13 - cleared (untied) handle again shows no tie information 1..13 # Looks like you failed 1 test of 13. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/13 subtests Test Summary Report ------------------- t/19-tied.t (Wstat: 256 Tests: 13 Failed: 1) Failed test: 8 Non-zero exit status: 1 Files=1, Tests=13, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.06 cusr 0.01 csys = 0.09 CPU) Result: FAIL ##### Not bisected, but damage occurred since July 21.
Download perl-V.txt
text/plain 3.1k

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.8k
On Tue, 01 Aug 2017 00:09:32 GMT, jkeenan@pobox.com wrote: Show quoted text
> Data-Printer-0.39 is failing on blead perl. Carlos Guevara called my > attention to these failures: > > http://fast-matrix.cpantesters.org/?dist=Data- > Printer;os=freebsd;perl=5.27.3;reports=1. > > They persist as of commit 1fb2d101eac30e2ec4b826a4c493bb6f1232dc16, > whereat I attempted to install via cpanm. > > ##### > $ ~/testing/blead/bin/prove -I~/testing/blead/lib -vb t/19-tied.t > t/19-tied.t .. > ok 1 - untied scalar shows only the scalar > ok 2 - tied scalar contains tied message > ok 3 - cleared (untied) scalar again shows no tie information > ok 4 - untied array shows only the array > ok 5 - tied array contains tied message > ok 6 - cleared (untied) array again shows no tie information > ok 7 - untied hash shows only the hash > not ok 8 - tied hash contains tied message > > # Failed test 'tied hash contains tied message' > # at t/19-tied.t line 139. > # got: '{} (tied to Tie::Fighter::Hash)' > # expected: '{ > # test 42 > # } (tied to Tie::Fighter::Hash)' > ok 9 - cleared (untied) hash again shows no tie information > ok 10 - untied handle properly referenced > ok 11 - untied handle shows only the handle itself > ok 12 - tied handle contains tied message > ok 13 - cleared (untied) handle again shows no tie information > 1..13 > # Looks like you failed 1 test of 13. > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/13 subtests > > Test Summary Report > ------------------- > t/19-tied.t (Wstat: 256 Tests: 13 Failed: 1) > Failed test: 8 > Non-zero exit status: 1 > Files=1, Tests=13, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.06 > cusr > 0.01 csys = 0.09 CPU) > Result: FAIL > ##### > > Not bisected, but damage occurred since July 21.
Data-Printer was doing fine as of 0283ad960acb, so the breakage probably occurred during the large merge on July 27. -- James E Keenan (jkeenan@cpan.org)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 2.4k
On Tue, 01 Aug 2017 00:19:35 GMT, jkeenan wrote: Show quoted text
> On Tue, 01 Aug 2017 00:09:32 GMT, jkeenan@pobox.com wrote:
> > Data-Printer-0.39 is failing on blead perl. Carlos Guevara called my > > attention to these failures: > > > > http://fast-matrix.cpantesters.org/?dist=Data- > > Printer;os=freebsd;perl=5.27.3;reports=1. > > > > They persist as of commit 1fb2d101eac30e2ec4b826a4c493bb6f1232dc16, > > whereat I attempted to install via cpanm. > > > > ##### > > $ ~/testing/blead/bin/prove -I~/testing/blead/lib -vb t/19-tied.t > > t/19-tied.t .. > > ok 1 - untied scalar shows only the scalar > > ok 2 - tied scalar contains tied message > > ok 3 - cleared (untied) scalar again shows no tie information > > ok 4 - untied array shows only the array > > ok 5 - tied array contains tied message > > ok 6 - cleared (untied) array again shows no tie information > > ok 7 - untied hash shows only the hash > > not ok 8 - tied hash contains tied message > > > > # Failed test 'tied hash contains tied message' > > # at t/19-tied.t line 139. > > # got: '{} (tied to Tie::Fighter::Hash)' > > # expected: '{ > > # test 42 > > # } (tied to Tie::Fighter::Hash)' > > ok 9 - cleared (untied) hash again shows no tie information > > ok 10 - untied handle properly referenced > > ok 11 - untied handle shows only the handle itself > > ok 12 - tied handle contains tied message > > ok 13 - cleared (untied) handle again shows no tie information > > 1..13 > > # Looks like you failed 1 test of 13. > > Dubious, test returned 1 (wstat 256, 0x100) > > Failed 1/13 subtests > > > > Test Summary Report > > ------------------- > > t/19-tied.t (Wstat: 256 Tests: 13 Failed: 1) > > Failed test: 8 > > Non-zero exit status: 1 > > Files=1, Tests=13, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.06 > > cusr > > 0.01 csys = 0.09 CPU) > > Result: FAIL > > ##### > > > > Not bisected, but damage occurred since July 21.
> > Data-Printer was doing fine as of 0283ad960acb, so the breakage > probably occurred during the large merge on July 27.
This can be reduced to the program attached. Run with perl-5.26.0 or at commit 0283ad960acb (before the MERGE), it produces: ##### BEFORE TIE: foo AFTER TIE: test string is empty, as expected ##### Run at, say, commit 1fb2d101eac30e2ec4b826a4c493bb6f1232dc16 (after the MERGE), it produces: ##### BEFORE TIE: foo AFTER TIE: test string is NOT empty: <{}> ##### Thank you very much. -- James E Keenan (jkeenan@cpan.org)
Subject: 131824-keys-tied-hash.pl
use strict; use warnings; package Tie::Fighter::Hash; sub TIEHASH { my $class = shift; my %foo = ( test => 42 ); return bless \%foo, $class; } sub FETCH { my ($self, $key) = @_; return $self->{$key}; } sub STORE { } sub EXISTS { my ($self, $key) = @_; return exists $self->{$key}; } sub DELETE { } sub CLEAR { } sub FIRSTKEY { my $self = shift; my $a = keys %$self; # reset each() iterator return each %$self; } sub NEXTKEY { my $self = shift; return each %$self; } sub SCALAR { } package main; my %var = ( foo => 'bar' ); for my $k (sort keys %var) { print "BEFORE TIE: $k\n"; } tie %var, 'Tie::Fighter::Hash'; for my $k (sort keys %var) { print "AFTER TIE: $k\n"; } my $string = ''; if (not keys %var) { $string .= '{}'; } if ($string eq '') { print "string is empty, as expected\n"; } else { print "string is NOT empty: <$string>\n"; } untie %var;
CC: perl5-porters [...] perl.org
Date: Tue, 1 Aug 2017 08:48:03 +0100
Subject: Re: [perl #131824] Bleadperl breaks Data-Printer-0.39
From: Dave Mitchell <davem [...] iabyn.com>
To: James E Keenan via RT <perlbug-followup [...] perl.org>
Download (untitled) / with headers
text/plain 1.6k
On Mon, Jul 31, 2017 at 06:40:19PM -0700, James E Keenan via RT wrote: Show quoted text
> This can be reduced to the program attached. Run with perl-5.26.0 or at commit 0283ad960acb (before the MERGE), it produces: > > ##### > BEFORE TIE: foo > AFTER TIE: test > string is empty, as expected > ##### > > Run at, say, commit 1fb2d101eac30e2ec4b826a4c493bb6f1232dc16 (after the MERGE), it produces: > > ##### > BEFORE TIE: foo > AFTER TIE: test > string is NOT empty: <{}> > #####
Thanks for the reduction. It fails because the test file t/19-tied.t has an invalid SCALAR() method. Reducing it further to sub TIEHASH { bless { test => 1} } sub FIRSTKEY { my $self = shift; my $a = keys %$self; # reset each() iterator return each %$self; } sub NEXTKEY { my $self = shift; return each %$self; } sub SCALAR { } my %var; tie %var, 'main'; print "NOT EMPTY (via hash test)\n" if %var; print "NOT EMPTY (via keys test)\n" if keys %var; produces this output with 5.27.2: NOT EMPTY (via keys test) and produces no output on blead, because 'scalar(keys %tied)' in boolean context now calls SCALAR() to determine whether the hash is empty, like is already does with 'scalar(%h)' in boolean context. A look on grep.cpan.me shows 3 distributions that have an empty SCALAR method: Data-Printer-0.39/t/19-tied.t Tie-TinyURL-0.02/lib/Tie/TinyURL.pm HTML-Template-Pro-0.9510/lib/HTML/Template/Pro/WrapAssociate.pm -- Spock (or Data) is fired from his high-ranking position for not being able to understand the most basic nuances of about one in three sentences that anyone says to him. -- Things That Never Happen in "Star Trek" #19
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.7k
On Tue, 01 Aug 2017 07:48:24 GMT, davem wrote: Show quoted text
> On Mon, Jul 31, 2017 at 06:40:19PM -0700, James E Keenan via RT wrote:
> > This can be reduced to the program attached. Run with perl-5.26.0 or > > at commit 0283ad960acb (before the MERGE), it produces: > > > > ##### > > BEFORE TIE: foo > > AFTER TIE: test > > string is empty, as expected > > ##### > > > > Run at, say, commit 1fb2d101eac30e2ec4b826a4c493bb6f1232dc16 (after > > the MERGE), it produces: > > > > ##### > > BEFORE TIE: foo > > AFTER TIE: test > > string is NOT empty: <{}> > > #####
> > Thanks for the reduction. It fails because the test file t/19-tied.t > has > an invalid SCALAR() method. > > Reducing it further to > > sub TIEHASH { bless { test => 1} } > > sub FIRSTKEY { > my $self = shift; > my $a = keys %$self; # reset each() iterator > return each %$self; > } > > sub NEXTKEY { > my $self = shift; > return each %$self; > } > > sub SCALAR { } > > my %var; > tie %var, 'main'; > print "NOT EMPTY (via hash test)\n" if %var; > print "NOT EMPTY (via keys test)\n" if keys %var; > > produces this output with 5.27.2: > > NOT EMPTY (via keys test) > > and produces no output on blead, because 'scalar(keys %tied)' in > boolean > context now calls SCALAR() to determine whether the hash is empty, > like > is already does with 'scalar(%h)' in boolean context. > > A look on grep.cpan.me shows 3 distributions that have an empty SCALAR > method: > > Data-Printer-0.39/t/19-tied.t > Tie-TinyURL-0.02/lib/Tie/TinyURL.pm > HTML-Template-Pro-0.9510/lib/HTML/Template/Pro/WrapAssociate.pm
So this is a case where "CPAN had suboptimal code and blead came along and understandably broke it." What is the fix which we should recommend to the CPAN maintainers? -- James E Keenan (jkeenan@cpan.org)
To: perl5-porters [...] perl.org
Date: Tue, 1 Aug 2017 15:05:11 +0100
Subject: Re: [perl #131824] Bleadperl breaks Data-Printer-0.39
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 723b
James E Keenan via RT wrote: Show quoted text
>So this is a case where "CPAN had suboptimal code and blead came along >and understandably broke it."
CPAN was doing something that might have permitted and blead made it tacitly not permitted. The documentation on it remains as ambiguous as it was before, though Dave is due to change that imminently. This was precisely one of the subjects of the dialogue between me and Dave of about a week ago. Show quoted text
>What is the fix which we should recommend to the CPAN maintainers?
Delete the empty SCALAR method. This (or any other fix acceptable to blead) entails a change of behaviour for scalar(%tied), so check that you haven't documented that scalar(%tied) for your class returns undef. -zefram
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.9k
On Tue, 01 Aug 2017 07:48:24 GMT, davem wrote: Show quoted text
> On Mon, Jul 31, 2017 at 06:40:19PM -0700, James E Keenan via RT wrote:
> > This can be reduced to the program attached. Run with perl-5.26.0 or > > at commit 0283ad960acb (before the MERGE), it produces: > > > > ##### > > BEFORE TIE: foo > > AFTER TIE: test > > string is empty, as expected > > ##### > > > > Run at, say, commit 1fb2d101eac30e2ec4b826a4c493bb6f1232dc16 (after > > the MERGE), it produces: > > > > ##### > > BEFORE TIE: foo > > AFTER TIE: test > > string is NOT empty: <{}> > > #####
> > Thanks for the reduction. It fails because the test file t/19-tied.t > has > an invalid SCALAR() method. > > Reducing it further to > > sub TIEHASH { bless { test => 1} } > > sub FIRSTKEY { > my $self = shift; > my $a = keys %$self; # reset each() iterator > return each %$self; > } > > sub NEXTKEY { > my $self = shift; > return each %$self; > } > > sub SCALAR { } > > my %var; > tie %var, 'main'; > print "NOT EMPTY (via hash test)\n" if %var; > print "NOT EMPTY (via keys test)\n" if keys %var; > > produces this output with 5.27.2: > > NOT EMPTY (via keys test) > > and produces no output on blead, because 'scalar(keys %tied)' in > boolean > context now calls SCALAR() to determine whether the hash is empty, > like > is already does with 'scalar(%h)' in boolean context. > > A look on grep.cpan.me shows 3 distributions that have an empty SCALAR > method: > > Data-Printer-0.39/t/19-tied.t > Tie-TinyURL-0.02/lib/Tie/TinyURL.pm
Tie-TinyURL fails tests against Perl 5 blead (v5.27.2-87-gdf84d7b) -- but the failures occur whether or not I comment out 'sub SCALAR {}'. Show quoted text
> HTML-Template-Pro-0.9510/lib/HTML/Template/Pro/WrapAssociate.pm
HTML-Template-Pro tests and installs successfully against Perl 5 blead. (Of course, it may be the case that its test suite doesn't touch 'sub SCALAR {}'.) Thank you very much. Jim Keenan -- James E Keenan (jkeenan@cpan.org)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 984b
Data-Printer 0.40 was just pushed to CPAN with the fix. Works on my blead now :) Many thanks to Jim, Dave and Zefram for finding and debugging this. Cheers! garu On Tue, 01 Aug 2017 07:05:53 -0700, zefram@fysh.org wrote: Show quoted text
> James E Keenan via RT wrote:
> >So this is a case where "CPAN had suboptimal code and blead came along > >and understandably broke it."
> > CPAN was doing something that might have permitted and blead made it > tacitly not permitted. The documentation on it remains as ambiguous as > it was before, though Dave is due to change that imminently. This was > precisely one of the subjects of the dialogue between me and Dave of > about a week ago. >
> >What is the fix which we should recommend to the CPAN maintainers?
> > Delete the empty SCALAR method. This (or any other fix acceptable to > blead) entails a change of behaviour for scalar(%tied), so check that > you haven't documented that scalar(%tied) for your class returns undef. > > -zefram
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 603b
On Wed, 02 Aug 2017 01:16:54 GMT, garu wrote: Show quoted text
> Data-Printer 0.40 was just pushed to CPAN with the fix. Works on my > blead now :) > > Many thanks to Jim, Dave and Zefram for finding and debugging this. >
Confirmed. ##### ./bin/cpanm Data::Printer --> Working on Data::Printer Fetching http://www.cpan.org/authors/id/G/GA/GARU/Data-Printer-0.40.tar.gz ... OK Configuring Data-Printer-0.40 ... OK Building and testing Data-Printer-0.40 ... OK Successfully installed Data-Printer-0.40 1 distribution installed ##### Marking ticket Resolved. Thank you very much. -- James E Keenan (jkeenan@cpan.org)
To: James E Keenan via RT <perlbug-followup [...] perl.org>
From: Dave Mitchell <davem [...] iabyn.com>
Subject: Re: [perl #131824] Bleadperl breaks Data-Printer-0.39
CC: perl5-porters [...] perl.org
Date: Fri, 4 Aug 2017 12:30:04 +0100
Download (untitled) / with headers
text/plain 313b
On Tue, Aug 01, 2017 at 03:07:49PM -0700, James E Keenan via RT wrote: Show quoted text
> Tie-TinyURL fails tests against Perl 5 blead (v5.27.2-87-gdf84d7b) -- but the failures occur whether or not I comment out 'sub SCALAR {}'.
It also fails against 5.27.2, so it isn't a regression. -- My get-up-and-go just got up and went.
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 513b
On Fri, 04 Aug 2017 11:30:43 GMT, davem wrote: Show quoted text
> On Tue, Aug 01, 2017 at 03:07:49PM -0700, James E Keenan via RT wrote:
> > Tie-TinyURL fails tests against Perl 5 blead (v5.27.2-87-gdf84d7b) -- > > but the failures occur whether or not I comment out 'sub SCALAR {}'.
> > It also fails against 5.27.2, so it isn't a regression.
Agreed. The APIs used in the test file have probably changed since the tests were originally written. So not relevant to the subject of this RT. -- James E Keenan (jkeenan@cpan.org)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org