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
blead and Glib's lazy-loader #9754
Comments
From @nwc10Torsten Schoenfeld mailed p5p in 48FB1B1B.40803@gmx.de it looks like current bleadperl breaks Glib's lazy-loading scheme. I believe that this issue is the same as At the time of writing Torsten Schoenfeld had not replied. |
From p5p@spam.wizbit.beThe first test script: on perl-5.10.0: Foo on blead: Foo |
p5p@spam.wizbit.be - Status changed from 'new' to 'open' |
From p5p@spam.wizbit.be----Program---- @Foo::ISA = qw(Glib::InitiallyUnowned); dump_hierarchy (Foo::); # force the lazy loader to setup the hierarchy sub dump_hierarchy { print ' ' x $indent, $package, "\n"; no strict 'refs'; ----Output of ...ppG3AmF/perl-5.10.0@34353/bin/perl---- ----EOF ($?='0')---- ----EOF ($?='0')---- http://perl5.git.perl.org/perl.git/commit/ p4raw-id: //depot/perl@34354 |
From kaffeetisch@gmx.deOn 28.05.2009 17:21, Nicholas Clark (via RT) wrote:
Yes, both issues are the same.
For the record, here's what I wrote to the mailing list: Nicholas Clark wrote:
PL_delaymagic is 0 and magic_setisa() is called. It gets an apparently {mro_linear_all = 0x0, mro_linear_current = 0xa4980bc, The isarev loop then first finds "Bar" with mro_meta struct {mro_linear_all = 0x0, mro_linear_current = 0x92c317c, and then "Foo" with {mro_linear_all = 0x0, mro_linear_current = 0x92c30bc, The mro_get_linear_isa() loop at the end is not executed since items is 0. |
From p5p@spam.wizbit.behttp://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2009-07/ From: Nicholas Clark <nick@ccl4.org> I believe I've fixed the problem in blead with 1375cf1 Inline Patchdiff --git a/mro.c b/mro.c
index fe77647..23f8c07 100644
--- a/mro.c
+++ b/mro.c
@@ -438,7 +438,7 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash)
if(meta->mro_nextmethod) hv_clear(meta->mro_nextmethod);
/* Iterate the isarev (classes that are our children),
- wiping out their linearization and method caches */
+ wiping out their linearization, method and isa caches */
if(isarev) {
hv_iterinit(isarev);
while((iter = hv_iternext(isarev))) {
@@ -463,6 +463,10 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash)
revmeta->cache_gen++;
if(revmeta->mro_nextmethod)
hv_clear(revmeta->mro_nextmethod);
+ if (revmeta->isa) {
+ SvREFCNT_dec(revmeta->isa);
+ revmeta->isa = NULL;
+ }
}
}
Does this work for you? Nicholas Clark |
From p5p@spam.wizbit.bePure perl test case: #!/usr/bin/perl -l package RT66112::A; package RT66112::B; sub isa { use strict; @Foo::ISA = qw(RT66112::B); Warning: something's wrong at test3.pl line 17. 1 at test3.pl line 19. |
From p5p@perl.wizbit.beCiteren Nicholas Clark <nick@ccl4.org>:
Patch attached. Without Nicholas change: ok 118 - modify @ISA in isa (RT66112::T1 isa RT66112::C) Test Summary Report op/universal.t (Wstat: 0 Tests: 123 Failed: 3) With Nicholas change: ok 118 - modify @ISA in isa (RT66112::T1 isa RT66112::C) Best regards, Bram |
From p5p@perl.wizbit.be0001-perl-66112-Tests-for-commit-1375cf1cf2085f851bb17604.patchFrom 32ec6541495f6e8508bbce224833c45a364644be Mon Sep 17 00:00:00 2001
From: Bram <p5p@perl.wizbit.be>
Date: Sat, 25 Jul 2009 22:11:55 +0200
Subject: [PATCH] [perl #66112]: Tests for commit 1375cf1cf2085f851bb176047d5e60248542f555
---
t/op/universal.t | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 55 insertions(+), 1 deletions(-)
diff --git a/t/op/universal.t b/t/op/universal.t
index a1ff975..a24d7aa 100644
--- a/t/op/universal.t
+++ b/t/op/universal.t
@@ -10,7 +10,7 @@ BEGIN {
require "./test.pl";
}
-plan tests => 117;
+plan tests => 123;
$a = {};
bless $a, "Bob";
@@ -253,3 +253,57 @@ use warnings "deprecated";
like($m, qr/^UNIVERSAL->import is deprecated/,
"deprecation warning for UNIVERSAL->import");
}
+
+# Test: [perl #66112]: change @ISA inside sub isa
+{
+ package RT66112::A;
+
+ package RT66112::B;
+
+ sub isa {
+ my $self = shift;
+ @ISA = qw/RT66112::A/;
+ return $self->SUPER::isa(@_);
+ }
+
+ package RT66112::C;
+
+ package RT66112::D;
+
+ sub isa {
+ my $self = shift;
+ @RT66112::E::ISA = qw/RT66112::A/;
+ return $self->SUPER::isa(@_);
+ }
+
+ package RT66112::E;
+
+ package main;
+
+ @RT66112::B::ISA = qw//;
+ @RT66112::C::ISA = qw/RT66112::B/;
+ @RT66112::T1::ISA = qw/RT66112::C/;
+ ok(RT66112::T1->isa('RT66112::C'), "modify \@ISA in isa (RT66112::T1 isa RT66112::C)");
+
+ @RT66112::B::ISA = qw//;
+ @RT66112::C::ISA = qw/RT66112::B/;
+ @RT66112::T2::ISA = qw/RT66112::C/;
+ ok(RT66112::T2->isa('RT66112::B'), "modify \@ISA in isa (RT66112::T2 isa RT66112::B)");
+
+ @RT66112::B::ISA = qw//;
+ @RT66112::C::ISA = qw/RT66112::B/;
+ @RT66112::T3::ISA = qw/RT66112::C/;
+ ok(RT66112::T3->isa('RT66112::A'), "modify \@ISA in isa (RT66112::T3 isa RT66112::A)");
+
+ @RT66112::E::ISA = qw/RT66112::D/;
+ @RT66112::T4::ISA = qw/RT66112::E/;
+ ok(RT66112::T4->isa('RT66112::E'), "modify \@ISA in isa (RT66112::T4 isa RT66112::E)");
+
+ @RT66112::E::ISA = qw/RT66112::D/;
+ @RT66112::T5::ISA = qw/RT66112::E/;
+ ok(! RT66112::T5->isa('RT66112::D'), "modify \@ISA in isa (RT66112::T5 not isa RT66112::D)");
+
+ @RT66112::E::ISA = qw/RT66112::D/;
+ @RT66112::T6::ISA = qw/RT66112::E/;
+ ok(RT66112::T6->isa('RT66112::A'), "modify \@ISA in isa (RT66112::T6 isa RT66112::A)");
+}
--
1.6.3.2
|
From @nwc10On Sat, Jul 25, 2009 at 10:27:44PM +0200, Bram wrote:
Thanks applied (2788925) Nicholas Clark |
p5p@spam.wizbit.be - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#66112 (status was 'resolved')
Searchable as RT66112$
The text was updated successfully, but these errors were encountered: