-
Notifications
You must be signed in to change notification settings - Fork 32
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
Crashing when attributes number exceeds 23 #64
Comments
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 (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;
} |
Using mouse metaclass attribute cache inside add_attribute may cause strange problems such as missing attributes or memory corruption.
we have submitted #67 to fix this issue. |
update: patch was tested for more than a week on production and everything works smooth now. |
Fix attribute override problem with recent perl (issue #64)
Changelog diff is: diff --git a/Changes b/Changes index c50ca85..6565eeb 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,11 @@ Revision history for Mouse {{$NEXT}} +v2.4.7 2017-01-14T13:46:04Z + - Workaround for issue #64(#67) + In some case stack is corrupted at more than 23 attributes. + This change may makes a bit slow in that case. + v2.4.6 2017-01-06T06:51:15Z - Fix test for older Perls (#68) - Define macros for older Visual Studio compiler(#66)
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:
Also here's a fragment of valgrind output that I believe is relevant to the issue:
The text was updated successfully, but these errors were encountered: