Skip Menu |

This queue is for tickets about the PerlIO-Util CPAN distribution.

Report information
The Basics
Id: 74539
Status: open
Priority: 0/
Queue: PerlIO-Util

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc: sprout [...] cpan.org
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.72
Fixed in: (no value)



CC: sprout [...] cpan.org
Subject: Fails with bleadperl since v5.15.6-434-g55b5114
As per subject. Sample fail report http://www.cpantesters.org/cpan/report/19411844 The commit fixed a refcounting bug, the test that now is failing also deals with refcounting. If the bugfix is valid, then the test has to change and vice verse. Please check! Thanks,
RT-Send-CC: slaven [...] rezic.de
On Mon Jan 30 17:23:25 2012, ANDK wrote: Show quoted text
> As per subject. > > Sample fail report > > http://www.cpantesters.org/cpan/report/19411844 > > The commit fixed a refcounting bug, the test that now is failing also > deals with refcounting. If the bugfix is valid, then the test has to > change and vice verse.
The test needs to be adjusted. Within the map{} block, the refcount of $_ is temporarily increased. The tests are getting the refcount from inside map blocks. Attached is a patch that tweaks things a bit to get tests passing under 5.16. But if you want a really robust test, you ought to test that the variables are freed when going out of scope, by taking weak references to them and watching the weak references go stale (become undef).
Subject: 74539.text
diff -Nurp PerlIO-Util-0.72-JFmyPH-orig/t/06_tee.t PerlIO-Util-0.72-JFmyPH/t/06_tee.t --- PerlIO-Util-0.72-JFmyPH-orig/t/06_tee.t 2012-04-11 10:45:27.000000000 -0700 +++ PerlIO-Util-0.72-JFmyPH/t/06_tee.t 2012-04-11 10:55:22.000000000 -0700 @@ -28,7 +28,8 @@ is tell($tee), length($x), 'tell == leng ok close($tee), "close"; -is_deeply [ map{ Internals::SvREFCNT($_) } $x, $y, $z ], [1, 1, 1], "(refcnt aftere closed)"; +BEGIN{*rc = *Internals::SvREFCNT;} +is_deeply [ rc($x), rc($y), rc($z) ], [1, 1, 1], "(refcnt aftere closed)"; open $tee, ">:scalar", \$x; @@ -46,7 +47,7 @@ is $z, "bar", "to z"; ok close($tee), "close"; -is_deeply [ map{ Internals::SvREFCNT($_) } $x, $y, $z ], [1, 1, 1], "(refcnt aftere closed)"; +is_deeply [ rc($x), rc($y), rc($z) ], [1, 1, 1], "(refcnt aftere closed)"; # push filehandle
This problem still exists with perl 5.16.0 RC0. Regards, Slaven