Subject: | objrule does not work with Moose nor AUTOLOAD |
Date: | Wed, 01 Jun 2011 13:35:26 -0400 |
To: | bug-regexp-grammars [...] rt.cpan.org |
From: | Nathan Gray <kolibrie [...] cpan.org> |
I am not able to use Moose objects for objrule results. I get
strange results when I use classes that use AUTOLOAD.
The module works correctly when I use the new method taken from
data_structure.t in the Regexp::Grammars distribution, or if I
use Class::Accessor objects.
I am attaching several test scripts:
new.t - based on data_structure.t in the distribution
1..2
ok 1 - Matched
ok 2 - Returned correct data structure
moose.t - use a Moose object
1..2
Segmentation fault
class_accessor.t - use a Class::Accessor object
1..2
ok 1 - Matched
ok 2 - Returned correct data structure
new_init.t - use a hand-coded object that populates each
attribute via an init routine
1..2
ok 1 - Matched
ok 2 - Returned correct data structure
new_init_autoload.t - uses AUTOLOAD for all accessor methods
1..2
Segmentation fault
new_init_limited_autoload.t - uses AUTOLOAD only for accessors
that have been listed as allowed
1..2
ok 1 - Matched
not ok 2 - Returned correct data structure
# Failed test 'Returned correct data structure'
# at t/new_init_limited_autoload.t line 75.
# Structures begin differing at:
# $got->{} = '� �� �� � '
# $expected->{} = '<a href="/yn2011/user/1613">Nathan Gray
# (‎kolibrie‎)'
# Looks like you failed 1 test of 2.
new_init_limited_autoload_warn.t - identical, but has a warn
statement
1..2
running AUTOLOAD as 'name' with param 'Nathan Gray'
running AUTOLOAD as 'id' with param '1613'
running AUTOLOAD as 'alias' with param 'kolibrie'
Segmentation fault
I am mostly interested in getting Moose to work with
Regexp::Grammars. I wrote the other test scripts to try to debug
what is going on.
When I run moose.t through the Perl debugger, I'm not able to see
where the error is, mostly it is just a bunch of reeval messages:
DB<2> s
main::((reeval 148)[t/moose.t:34]:3):
3:
DB<2> s
main::((reeval 149)[t/moose.t:34]:2):
2:
DB<2> s
Signal SEGV at (reeval 149)[t/moose.t:34] line 2
Aborted
Tested with:
Perl v5.10.1
Regexp::Grammars 1.012
Moose 2.0007
Class::Accessor 0.34
-kolibrie
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.