Skip Menu |
 

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 89249
Status: open
Worked: 3 hours (180 min)
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: gavin [...] openfusion.com.au
Cc: gortan [...] cpan.org
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 2.1005
  • 2.1100-TRIAL
  • 2.1200
Fixed in: (no value)



Subject: Test failure in t/cmop/methods.t on CentOS5 / perl 5.8.8
Download (untitled) / with headers
text/plain 3.2k
I'm getting a single test failure on CentOS5 / perl 5.8.8 on Moose 2.1005 and 2.1100-TRIAL, as follows: Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/cmop/methods.t 255 65280 ?? ?? % ?? 8 tests and 2 subtests skipped. Failed 1/398 test scripts, 99.75% okay. -13/18344 subtests failed, 100.07% okay. hammer:~/Moose-2.1100$ perl -Iblib t/cmop/methods.t ok 1 ok 2 - ... got the method stub pie ok 3 - ... got the constant method stub cake ok 4 - ... our method is not yet blessed ok 5 - ... we added the method successfully ok 6 - The object isa Class::MOP::Method ok 7 - ... got the right name for the method ok 8 - ... got the right package name for the method ok 9 - ... Foo->has_method(foo) (defined with Sub::Name) ok 10 - ... Foo->get_method(foo) == \&foo ok 11 - ... _method_foo->execute returns "Foo::foo" ok 12 - ... Foo->foo() returns "Foo::foo" not ok 13 - can add blessed sub as method # Failed test 'can add blessed sub as method' # at t/cmop/methods.t line 102. # got: 'Can't locate object method "body" via package "Non::Meta::Class" at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Class/MOP/Mixin/HasMethods.pm line 63. # ' # expected: undef ok 14 - ... not Foo->has_method(FOO_CONSTANT) (defined w/ use constant) ok 15 - ... not Foo->has_method(bling) (defined in main:: using symbol tables (no Sub::Name)) ok 16 - ... Foo->has_method(bar) (defined in Foo) ok 17 - ... Foo->has_method(baz) (typeglob aliased within Foo) ok 18 - ... Foo->has_method(baaz) (typeglob aliased within Foo) ok 19 - ... Foo->has_method(floob) (defined in Foo:: using symbol tables and Sub::Name w/out package name) ok 20 - ... Foo->has_method(blah) (defined in main:: using fully qualified package name) ok 21 - ... Foo->has_method(bang) (defined in main:: using symbol tables and Sub::Name) ok 22 - ... Foo->has_method(evaled_foo) (evaled in main::) ok 23 - the method 'elk' is defined in OinkyBoinky ok 24 - the method 'bar' is not defined in OinkyBoinky ok 25 - but if you look in the inheritence chain then 'bar' does exist ok 26 - the returned value is a code ref ok 27 - The object isa Class::MOP::Method ok 28 - ... body matches CODE ref in package for baaz ok 29 - The object isa Class::MOP::Method ok 30 - ... body matches CODE ref in package for bar ok 31 - The object isa Class::MOP::Method ok 32 - ... body matches CODE ref in package for baz ok 33 - The object isa Class::MOP::Method ok 34 - ... body matches CODE ref in package for floob ok 35 - The object isa Class::MOP::Method ok 36 - ... body matches CODE ref in package for blah ok 37 - The object isa Class::MOP::Method ok 38 - ... body matches CODE ref in package for bang not ok 39 - The thing isa Class::MOP::Method # Failed test 'The thing isa Class::MOP::Method' # at t/cmop/methods.t line 154. # The thing isn't defined Can't call method "body" on an undefined value at t/cmop/methods.t line 158. # Tests were run but no plan was declared and done_testing() was not seen. My MOP-skills are lacking, so I haven't tried to debug any further as yet. All runtime dependencies are installed, and I've replicated on two different servers. This test works fine on CentOS6, fwiw. Cheers, Gavin
Download (untitled) / with headers
text/plain 518b
On Fri Oct 04 06:02:41 2013, GAVINC wrote: Show quoted text
> I'm getting a single test failure on CentOS5 / perl 5.8.8 on Moose > 2.1005 and 2.1100-TRIAL, as follows:
... Show quoted text
> hammer:~/Moose-2.1100$ perl -Iblib t/cmop/methods.t
... Show quoted text
> not ok 13 - can add blessed sub as method
Gavin, I think that your invocation is incorrect - instead of -Iblib you have so say -Iblib/lib -Iblib/arch I just tried 2.1200 on RHEL 5.6 with perl 5.8.8 and have no issues running the unittests (if I call them correctly). Can you please give 2.1200 a shot?
Download (untitled) / with headers
text/plain 7.7k
On Tue Jan 07 04:01:06 2014, GORTAN wrote: Show quoted text
> On Fri Oct 04 06:02:41 2013, GAVINC wrote:
> > I'm getting a single test failure on CentOS5 / perl 5.8.8 on Moose > > 2.1005 and 2.1100-TRIAL, as follows:
> ...
> > hammer:~/Moose-2.1100$ perl -Iblib t/cmop/methods.t
> ...
> > not ok 13 - can add blessed sub as method
> > Gavin, I think that your invocation is incorrect - instead of > -Iblib > you have so say > -Iblib/lib -Iblib/arch > > I just tried 2.1200 on RHEL 5.6 with perl 5.8.8 and have no issues > running the unittests (if I call them correctly). Can you please give > 2.1200 a shot?
Just tried again on a fresh box, CentOS 5.10 with perl 5.8.8. I get the same error with 2.1200: [gavin@tools Moose-2.1200]$ prove -Iblib/lib -Iblib/arch t/cmop/*.t t/cmop/add_attribute_alternate.............ok t/cmop/add_method_debugmode................ok t/cmop/add_method_modifier.................ok t/cmop/advanced_methods....................ok t/cmop/anon_class_create_init..............ok t/cmop/anon_class_keep_alive...............ok t/cmop/anon_class_leak.....................skipped all skipped: Test requires module 'Test::LeakTrace' but it's not found t/cmop/anon_class_removal..................ok t/cmop/anon_class..........................ok t/cmop/anon_packages.......................ok t/cmop/ArrayBasedStorage_test..............ok t/cmop/attribute_duplication...............ok t/cmop/attribute_errors_and_edge_cases.....ok t/cmop/attribute_get_read_write............ok t/cmop/attribute_initializer...............ok t/cmop/attribute_introspection.............ok t/cmop/attribute_non_alpha_name............ok t/cmop/attributes..........................ok t/cmop/AttributesWithHistory_test..........ok t/cmop/attribute...........................ok t/cmop/basic...............................ok t/cmop/before_after_dollar_under...........ok t/cmop/BinaryTree_test.....................ok t/cmop/C3MethodDispatchOrder_test..........ok t/cmop/Class_C3_compatibility..............ok t/cmop/ClassEncapsulatedAttributes_test....ok t/cmop/class_errors_and_edge_cases.........ok t/cmop/class_is_pristine...................ok t/cmop/class_precedence_list...............ok t/cmop/constant_codeinfo...................ok t/cmop/create_class........................ok t/cmop/custom_instance.....................ok t/cmop/deprecated..........................ok t/cmop/get_code_info.......................ok t/cmop/immutable_custom_trait..............ok t/cmop/immutable_metaclass.................ok t/cmop/immutable_w_constructors............ok t/cmop/immutable_w_custom_metaclass........ok t/cmop/inline_and_dollar_at................ok t/cmop/inline_structor.....................skipped all skipped: Test requires module 'Test::Output' but it's not found t/cmop/insertion_order.....................ok t/cmop/InsideOutClass_test.................ok t/cmop/InstanceCountingClass_test..........ok t/cmop/instance_inline.....................ok t/cmop/instance_metaclass_incompat_dyn.....ok t/cmop/instance_metaclass_incompat.........ok t/cmop/instance............................ok t/cmop/LazyClass_test......................ok t/cmop/load................................ok t/cmop/magic...............................ok t/cmop/make_mutable........................ok t/cmop/metaclass_incompatibility_dyn.......ok t/cmop/metaclass_incompatibility...........ok t/cmop/metaclass_inheritance...............ok t/cmop/metaclass_loads_classes.............ok t/cmop/metaclass_reinitialize..............ok t/cmop/metaclass...........................ok t/cmop/meta_method.........................ok t/cmop/meta_package_extension..............ok t/cmop/meta_package........................ok t/cmop/method_modifiers....................ok t/cmop/methods.............................ok 1/0Can't locate object method "body" via package "Non::Meta::Class" at blib/lib/Class/MOP/Mixin/HasMethods.pm line 135. # Tests were run but no plan was declared and done_testing() was not seen. t/cmop/methods.............................dubious Test returned status 255 (wstat 65280, 0xff00) t/cmop/method..............................ok t/cmop/modify_parent_method................ok t/cmop/new_and_clone_metaclasses...........ok t/cmop/null_stash..........................ok t/cmop/numeric_defaults....................ok t/cmop/package_variables...................ok t/cmop/Perl6Attribute_test.................ok t/cmop/random_eval_bug.....................ok t/cmop/rebless_instance_away...............ok t/cmop/rebless_instance....................ok t/cmop/rebless_overload....................ok t/cmop/rebless_with_extra_params...........ok t/cmop/RT_27329_fix........................ok t/cmop/RT_39001_fix........................ok t/cmop/RT_41255............................ok t/cmop/scala_style_mixin_composition.......skipped all skipped: Test requires module 'SUPER' but it's not found t/cmop/self_introspection..................ok t/cmop/subclasses..........................ok t/cmop/subname.............................ok t/cmop/universal_methods...................ok Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/cmop/methods.t 255 65280 ?? ?? % ?? 3 tests skipped. Failed 1/82 test scripts, 98.78% okay. -13/2568 subtests failed, 100.51% okay. Everything fine except that one methods.t unit test. -G
Download (untitled) / with headers
text/plain 661b
On Tue Jan 07 06:06:24 2014, GAVINC wrote: Show quoted text
> Just tried again on a fresh box, CentOS 5.10 with perl 5.8.8. I get > the same error with 2.1200:
Show quoted text
> t/cmop/methods.............................ok 1/0Can't locate object > method "body" via package "Non::Meta::Class" at > blib/lib/Class/MOP/Mixin/HasMethods.pm line 135.
Hmm, can you please also post the output of $ perl -Iblib/lib -Iblib/arch t/00-report-prereqs.t and $ perl bin/moose-outdated It doesn't seem to be a general issue, as the test reports look fine: http://www.cpantesters.org/distro/M/Moose.html#Moose-2.1200?grade=1&perlmat=2&patches=2&oncpan=1&distmat=1&perlver=ALL&osname=ALL&version=2.1200
Download (untitled) / with headers
text/plain 2.2k
On Wed Jan 08 04:30:28 2014, GORTAN wrote: Show quoted text
> On Tue Jan 07 06:06:24 2014, GAVINC wrote: >
> > Just tried again on a fresh box, CentOS 5.10 with perl 5.8.8. I get > > the same error with 2.1200:
>
> > t/cmop/methods.............................ok 1/0Can't locate object > > method "body" via package "Non::Meta::Class" at > > blib/lib/Class/MOP/Mixin/HasMethods.pm line 135.
> > Hmm, can you please also post the output of > $ perl -Iblib/lib -Iblib/arch t/00-report-prereqs.t > and > $ perl bin/moose-outdated > > It doesn't seem to be a general issue, as the test reports look fine: > http://www.cpantesters.org/distro/M/Moose.html#Moose- > 2.1200?grade=1&perlmat=2&patches=2&oncpan=1&distmat=1&perlver=ALL&osname=ALL&version=2.1200
[gavin@tools Moose-2.1200]$ perl -Iblib/lib -Iblib/arch t/00-report-prereqs.t 1..1 # # Versions for all modules listed in META.json (including optional ones): # Version Module # -------- --------------------------- # 2.120921 CPAN::Meta # 2.123 CPAN::Meta::Requirements # 1.32 Carp # 0.20 Class::Load # 0.04 Class::Load::XS # 0.107 Data::OptList # 0.11 Devel::GlobalDestruction # missing Devel::PartialDump # 1.30 Devel::StackTrace # 0.02 Dist::CheckConflicts # 0.08 Eval::Closure # 0.2703 ExtUtils::CBuilder # 6.30 ExtUtils::MakeMaker # 3.31 File::Spec # 0.33 List::MoreUtils # 0.12 MRO::Compat # 0.013 Module::Runtime # 0.13 Package::DeprecationManager # 0.33 Package::Stash # 0.25 Package::Stash::XS # 1.07 Params::Util # 1.27 Scalar::Util # 0.982 Sub::Exporter # 0.05 Sub::Name # 1.04 Task::Weaken # 0.010 Test::Fatal # 0.98 Test::More # 0.06 Test::Requires # 0.11 Try::Tiny # 0.225 parent ok 1 perl -Iblib/lib -Iblib/arch bin/moose-outdated <no output>
Download (untitled) / with headers
text/plain 297b
I tried to reproduce your setup with the centos 5.8 image from http://tag1consulting.com/files/centos-5.8-x86-64-minimal.box. I upgraded Bundle::CPAN, installed Carton and used this cpanfile to reproduce the versions you mentioned: https://gist.github.com/mephinet/8446647 Still, all tests pass...
Subject: Re: [rt.cpan.org #89249] Test failure in t/cmop/methods.t on CentOS5 / perl 5.8.8
Date: Thu, 16 Jan 2014 10:07:34 -0800
To: Philipp Gortan via RT <bug-Moose [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
Download (untitled) / with headers
text/plain 516b
On Wed, Jan 15, 2014 at 06:19:56PM -0500, Philipp Gortan via RT wrote: Show quoted text
> I tried to reproduce your setup with the centos 5.8 image from http://tag1consulting.com/files/centos-5.8-x86-64-minimal.box. > I upgraded Bundle::CPAN, installed Carton and used this cpanfile to reproduce the versions you mentioned: https://gist.github.com/mephinet/8446647 > Still, all tests pass...
Gavin, this suggests that perhaps you should try a re-install of your modules? Also, is the problem reproducable on more than one machine?
Download (untitled) / with headers
text/plain 311b
On Thu Jan 16 13:07:44 2014, ETHER wrote: Show quoted text
> Gavin, this suggests that perhaps you should try a re-install of your > modules?
If you re-install, you might want to update your toolchain first - your EUMM is over 8 years old, and building that version did not work out for me. I'd run $ cpan Bundle::CPAN first...
RT-Send-CC: ether [...] cpan.org
Download (untitled) / with headers
text/plain 1.2k
We run ancient perl too and hit a similar problem installing Moose 2.1403. Just some context - the test that is failing adds a method that is a blessed sub to a class (offtopic, curious if there is a use case for this?). In the OPs example, that is the test that is failing. In my example, it is the test after that that fails but I think they share the same cause. When the package cache is built, `mop_update_method_map` in xs/HasMethods.xs walks the methods hash and calls `body` on any object it sees. In this case the object is our blessed sub, it doesn't have a `body` method and goes boom. I think you can trigger this exception by invalidating the package cache so it is rebuilt. In perl 5.9.5 and older, the package cache rebuilds a lot because it MRO::Compat::get_pkg_gen returns a new version every time you call it which is why this test fails. Newer perl versions ship with mro so track the package cache correctly so the test passes because the package cache is not rebuilt. I think an ISA check should fix it but this is my first time poking around the Moose internals and XS so handle with care ;) Installing Class::C3::XS also works around the problem (it's implementation of get_pkg_gen does not trigger rebuilding the package cache)
Subject: RT_89249.patch
Download RT_89249.patch
text/x-diff 1k
diff --git a/t/cmop/RT_89249.t b/t/cmop/RT_89249.t new file mode 100644 index 0000000..0a5f0b8 --- /dev/null +++ b/t/cmop/RT_89249.t @@ -0,0 +1,18 @@ +use strict; +use Test::More; +use Test::Fatal; + +use Class::MOP; + +my $meta = Class::MOP::Class->initialize('Foo'); + +my $blessed_sub = bless sub {}, 'No::Meta::Class'; +$meta->add_method('blessed_sub' => $blessed_sub); + +# force the package cache to rebuild +$meta->reset_package_cache_flag; + +# And call something that requires the package cache +is( exception { $meta->has_method('blessed_sub') }, undef ); + +done_testing; diff --git a/xs/HasMethods.xs b/xs/HasMethods.xs index e136abe..ed56529 100644 --- a/xs/HasMethods.xs +++ b/xs/HasMethods.xs @@ -24,7 +24,7 @@ mop_update_method_map(pTHX_ HV *const stash, HV *const map) continue; } - if (sv_isobject(method)) { + if (sv_isobject(method) && sv_derived_from(method, "Class::MOP::Method")) { /* $method_object->body() */ body = mop_call0(aTHX_ method, KEY_FOR(body)); }


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.