Closed serhiybutz closed 7 years ago
Is there any update on this issue? Because of this issue we have to keep our production servers running on ubuntu trusty :(
Sorry belated response. I can reproduce this issue.
I suppose stack pointer is strange if there are more than 22 attributes and then Mouse::Meta::Class::get_all_attributes
method returns nothing(It should returns 23 attribute instances). However I cannot understand how to fix this issue.
(Why does it work if its method is called two times ?)
diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm
index 4c1c5f3..4b94db9 100644
--- a/lib/Mouse/Meta/Class.pm
+++ b/lib/Mouse/Meta/Class.pm
@@ -193,6 +193,7 @@ sub find_attribute_by_name {
my($self, $name) = @_;
defined($name)
or $self->throw_error('You must define an attribute name to find');
+ $self->get_all_attributes;
foreach my $attr($self->get_all_attributes) {
return $attr if $attr->name eq $name;
}
we have submitted #67 to fix this issue.
update: patch was tested for more than a week on production and everything works smooth now.
Release Mouse v2.4.7 which applies #67 workaround.
Under Ubuntu 16.04, Perl 5.22.1 (5.24.0 too) following scripts combination crashes:
File: Bar.pm
File: Foo.pm
File: Holder.pm
File: run.pl
When script run.pl is run it crashes with following error message (sometimes it goes with backtrace):
Crashing stops if: 1) 'use warnings' in run.pl is removed 2) number of attributes in Bar.pm is less than 24 3) run in debug-mode (like perl -d run.pl)
Also here's a fragment of valgrind output that I believe is relevant to the issue: