New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sv_rvweaken (Scalar::Util::weaken) is inneffective on tied variables #7848
Comments
From philippe.cote@usherbrooke.caCreated by philippe.cote@usherbrooke.caI think there is a bug in sv_rvweaken on tied variables ------------------------------------------------------------------------------------------------------------ use Scalar::Util qw(weaken isweak); package Monitor::TestArray; sub DESTROY { "Monitor::TestArray::DESTROY : $_[0]\n"; } 1; ------------------------------------------------------------------------------------------------------------ SV = PVLV(0x818cd80) at 0x814e86c SV = PVLV(0x818cd80) at 0x814e86c $a[0] is not weak ------------------------------------------------------------------------------- Internal code from Scalar::Util::weaken and Scalar::Util::isweak is : Conclusion : sv_rvweaken doesn't seem to handle tied values very well Perl Info
|
From philippe.cote@usherbrooke.caTo: perlbug@perl.org This is a bug report for perl from philippe.cote@usherbrooke.ca, Hi, sv_rvweaken doesn't handle tied variables Proof : +-------------------------------------------------------------------------+ use Scalar::Util qw(weaken); package TestArray; sub DESTROY { print "Monitor::TestArray::DESTROY : $_[0]\n"; } 1; +-------------------------------------------------------------------------+ +-------------------------------------------------------------------------+ +-------------------------------------------------------------------------+ Scalar::Util::weaken -> sv_rvweaken -> Perl_sv_rvweaken +-------------------------------------------------------------------------+ We see clearly that it only calls sv_rvweaken from the perl source code. +-------------------------------------------------------------------------+ Weaken a reference: set the C<SvWEAKREF> flag on this RV; give the =cut SV * +-------------------------------------------------------------------------+ Thank you Philippe Cote Flags: Site configuration information for perl v5.8.6: Configured by Gentoo at Mon Feb 28 13:17:43 EST 2005. Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Locally applied patches: @INC for perl v5.8.6: Environment for perl v5.8.6: PATH=/usr/kde/3.2/bin:/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3:/opt/Acrobat5:/usr/X11R6/bin:/opt/blackdown-jdk-1.4.1/bin:/opt/blackdown-jdk-1.4.1/jre/bin:/usr/qt/3/bin:/usr/kde/3.1/bin PERL5LIB=/usr/local/inHousePerlLib:/var/www/localhost/webapps:/usr/local/inHousePerlLib/monadb/modules:/var/www/localhost/webapps:/usr/local/inHousePerlLib/OOSGD/modules/:/usr/local/inHousePerlLib/monadb/modules/:/usr/local/inHousePerlLib/ensembl/modules:/usr/local/inHousePerlLib Complete configuration data for perl v5.8.6: Author='' |
From @iabynOn Mon, Mar 21, 2005 at 08:42:11PM -0000, philippe. cote @ usherbrooke. ca wrote:
I'm not really sure what you expect the effect of weakening a tied array
-- |
The RT System itself - Status changed from 'new' to 'open' |
From @ysthOn Wed, Jul 20, 2005 at 01:27:51AM +0100, Dave Mitchell wrote:
To put it another way, the tied element $a[0] acts like a black box around Unless someone implements support for a WEAKEN method... |
From philippe.cote@usherbrooke.caI developped a tool for detecting memory leaks from variables with So, what I expect is that "weaken" works on tied variables just like every Forgive my bad english. Philippe Côté
|
From @iabynOn Tue, Jul 19, 2005 at 09:15:28PM -0400, Philippe Côté wrote:
You can weaken tied variables; what you can't do is weaken *elements* of -- |
@iabyn - Status changed from 'open' to 'rejected' |
From @cpansproutOn Sun Jan 08 11:57:14 2006, davem@iabyn.com wrote:
I’ve just been thinking though, that weaken() ought to be calling I’ve just noticed a memory leak in my own code, since I made the mistake -- Father Chrysostomos |
Migrated from rt.perl.org#34524 (status was 'rejected')
Searchable as RT34524$
The text was updated successfully, but these errors were encountered: