Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 104541
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: Nobody in particular
Requestors: Support [...] RoxSoft.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 5.90091
  • 5.90089_001
  • 5.90089_002
  • 5.90089_003
  • 5.90089_004
  • 5.90090
  • 5.90092
Fixed in: (no value)



Subject: Deep recursion on subroutine MyApp::setup_component
Catalyst 5.90091 breaks Catalyst-Plugin-Configcomponents Deep recursion on subroutine "MyApp::setup_component" at /home/pjf/Perl/lib/perl5/Catalyst.pm line 3059. Deep recursion on anonymous subroutine at /home/pjf/Perl/lib/perl5/x86_64-linux/Class/MOP/Method/Wrapped.pm line 86. Deep recursion on subroutine "Class::MOP::Class:::around" at /home/pjf/Perl/lib/perl5/x86_64-linux/Class/MOP/Method/Wrapped.pm line 157. Deep recursion on subroutine "Catalyst::setup_component" at /home/pjf/Projects/Catalyst-Plugin-ConfigComponents/master/t/../lib/Catalyst/Plugin/ConfigComponents.pm line 35. Broken for me on Perl 5.10.1 for Travis on Perl 5.14.4
The recursive call to setup_component is on line 5059 of Catalyst.pm Anyone doing an around setup_component is shafted
CC: undisclosed-recipients:;
Subject: Re: [rt.cpan.org #104541] Deep recursion on subroutine MyApp::setup_component
Date: Tue, 19 May 2015 15:51:52 +0200
To: bug-Catalyst-Runtime [...] rt.cpan.org
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
"Peter Flanigan via RT" <bug-Catalyst-Runtime@rt.cpan.org> writes: Show quoted text
> Queue: Catalyst-Runtime > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104541 > > > The recursive call to setup_component is on line 5059 > of Catalyst.pm
Catalyst.pm doesn't have that many lines, and setup_component doesn't call itself. Are you confusing setup_component and setup_components (which calls ->setup_component for each loaded component)? -- "A disappointingly low fraction of the human race is, at any given time, on fire." - Stig Sandbeck Mathisen
On Tue May 19 09:42:45 2015, PJFL wrote: Show quoted text
> The recursive call to setup_component is on line 5059
Type should be 3059
CC: undisclosed-recipients:;
Subject: Re: [rt.cpan.org #104541] Deep recursion on subroutine MyApp::setup_component
Date: Tue, 19 May 2015 16:04:03 +0200
To: bug-Catalyst-Runtime [...] rt.cpan.org
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
""(Dagfinn Ilmari Mannsåker)" via RT" <bug-Catalyst-Runtime@rt.cpan.org> writes: Show quoted text
> Queue: Catalyst-Runtime > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104541 > > > "Peter Flanigan via RT" <bug-Catalyst-Runtime@rt.cpan.org> writes: >
>> Queue: Catalyst-Runtime >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104541 > >> >> The recursive call to setup_component is on line 5059 >> of Catalyst.pm
> > Catalyst.pm doesn't have that many lines,
Ah, I see your original message had the correct line number: 3059. Show quoted text
> and setup_component doesn't call itself. Are you confusing > setup_component and setup_components (which calls ->setup_component > for each loaded component)?
Sorry, I was looking at an old checkout. The only way I can see that recursing is if your component has an expand_modules method that always returns a new component name, or if your setup_component wrapper is doing something weird. Show quoted text
> Anyone doing an around setup_component is shafted
Can you please show us your setup_component wrapper, and any expand_modules method in your components? -- "A disappointingly low fraction of the human race is, at any given time, on fire." - Stig Sandbeck Mathisen
On Tue May 19 10:04:22 2015, ilmari@ilmari.org wrote: Show quoted text
> Can you please show us your setup_component wrapper, and any > expand_modules method in your components?
Sure the code is here https://metacpan.org/source/PJFL/Catalyst-Plugin-ConfigComponents-0.9.1/lib/Catalyst/Plugin/ConfigComponents.pm
Subject: Re: [rt.cpan.org #104541] Deep recursion on subroutine MyApp::setup_component
Date: Wed, 20 May 2015 01:11:24 +0000 (UTC)
To: "bug-Catalyst-Runtime [...] rt.cpan.org" <bug-Catalyst-Runtime [...] rt.cpan.org>
From: John Napiorkowski <jjn1056 [...] yahoo.com>
I can verify that you get deep recursion when trying to install a previously working CPAN module.  I'll look into it. I do want to point out some of these features are now cored, although the overall approach is different.  I wonder if the efforts could be combined in some manner?  If you could look at the new component injection stuff and two plugins I did around it that I am hoping to see in core someday as well: Catalyst-Plugin-InjectionHelpers-0.007  and Catalyst-Plugin-Ma…Dependencies-0.005 this takes a more moose role based approach rather than subclasses but I bet that could be combined.  In any case 5.9009x was labeled a 'shouldn't break stuff' release and although your code here is definitely flogging catalyst it is hitting public APIs.  Let me think about this a bit. On Tuesday, May 19, 2015 11:10 AM, Peter Flanigan via RT <bug-Catalyst-Runtime@rt.cpan.org> wrote:       Queue: Catalyst-Runtime Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104541 > On Tue May 19 10:04:22 2015, ilmari@ilmari.org wrote: Show quoted text
> Can you please show us your setup_component wrapper, and any > expand_modules method in your components?
Sure the code is here https://metacpan.org/source/PJFL/Catalyst-Plugin-ConfigComponents-0.9.1/lib/Catalyst/Plugin/ConfigComponents.pm
Subject: Re: [rt.cpan.org #104541] Deep recursion on subroutine MyApp::setup_component
Date: Wed, 20 May 2015 02:03:44 +0000 (UTC)
To: "bug-Catalyst-Runtime [...] rt.cpan.org" <bug-Catalyst-Runtime [...] rt.cpan.org>
From: John Napiorkowski <jjn1056 [...] yahoo.com>
I can verify that moving the bit where we expand inner packages on a component from setup_components to setup_compont is the cause if this recursion.  However the case:  { no strict 'refs'; @{"$class\::Sub::ISA"} = @{"$class\::ISA"} } seems pathological. give me a day or two to work this out On Tuesday, May 19, 2015 9:11 PM, John Napiorkowski <jjn1056@yahoo.com> wrote: I can verify that you get deep recursion when trying to install a previously working CPAN module.  I'll look into it. I do want to point out some of these features are now cored, although the overall approach is different.  I wonder if the efforts could be combined in some manner?  If you could look at the new component injection stuff and two plugins I did around it that I am hoping to see in core someday as well: Catalyst-Plugin-InjectionHelpers-0.007  and Catalyst-Plugin-Ma…Dependencies-0.005 this takes a more moose role based approach rather than subclasses but I bet that could be combined.  In any case 5.9009x was labeled a 'shouldn't break stuff' release and although your code here is definitely flogging catalyst it is hitting public APIs.  Let me think about this a bit. On Tuesday, May 19, 2015 11:10 AM, Peter Flanigan via RT <bug-Catalyst-Runtime@rt.cpan.org> wrote:       Queue: Catalyst-Runtime Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104541 > On Tue May 19 10:04:22 2015, ilmari@ilmari.org wrote: Show quoted text
> Can you please show us your setup_component wrapper, and any > expand_modules method in your components?
Sure the code is here https://metacpan.org/source/PJFL/Catalyst-Plugin-ConfigComponents-0.9.1/lib/Catalyst/Plugin/ConfigComponents.pm

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #104541] Deep recursion on subroutine MyApp::setup_component
Date: Wed, 20 May 2015 02:05:03 +0000 (UTC)
To: "bug-Catalyst-Runtime [...] rt.cpan.org" <bug-Catalyst-Runtime [...] rt.cpan.org>
From: John Napiorkowski <jjn1056 [...] yahoo.com>
basically   { no strict 'refs'; @{"$class\::Sub::ISA"} = @{"$class\::ISA"} } it keeps calling setup_component and we get comp::Sub, comp::Sub::Sub, ... and so on. On Tuesday, May 19, 2015 9:11 PM, John Napiorkowski <jjn1056@yahoo.com> wrote: I can verify that you get deep recursion when trying to install a previously working CPAN module.  I'll look into it. I do want to point out some of these features are now cored, although the overall approach is different.  I wonder if the efforts could be combined in some manner?  If you could look at the new component injection stuff and two plugins I did around it that I am hoping to see in core someday as well: Catalyst-Plugin-InjectionHelpers-0.007  and Catalyst-Plugin-Ma…Dependencies-0.005 this takes a more moose role based approach rather than subclasses but I bet that could be combined.  In any case 5.9009x was labeled a 'shouldn't break stuff' release and although your code here is definitely flogging catalyst it is hitting public APIs.  Let me think about this a bit. On Tuesday, May 19, 2015 11:10 AM, Peter Flanigan via RT <bug-Catalyst-Runtime@rt.cpan.org> wrote:       Queue: Catalyst-Runtime Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104541 > On Tue May 19 10:04:22 2015, ilmari@ilmari.org wrote: Show quoted text
> Can you please show us your setup_component wrapper, and any > expand_modules method in your components?
Sure the code is here https://metacpan.org/source/PJFL/Catalyst-Plugin-ConfigComponents-0.9.1/lib/Catalyst/Plugin/ConfigComponents.pm

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #104541] Deep recursion on subroutine MyApp::setup_component
Date: Wed, 20 May 2015 02:27:50 +0000 (UTC)
To: "bug-Catalyst-Runtime [...] rt.cpan.org" <bug-Catalyst-Runtime [...] rt.cpan.org>
From: John Napiorkowski <jjn1056 [...] yahoo.com>
Ok so I thought about it and reviewed the code.  Please following and try to help me see if I got it right. I think Catayst is now correct but was broken previous, and that your test case that is now recursive is not a good test case for a problem catalyst previously had. So you have a model that inherited from this component: https://metacpan.org/source/PJFL/Catalyst-Plugin-ConfigComponents-0.9.1/t/lib/Catalyst/Component/Implicit.pm right so when that component is setup in injects a new componet "$Comp::Sub" AND it sets the base case for this new injected component to the component we just setup. That means we have a second component with the same COMPONENT method that does the same thing... So in older catalyst we only expanded inner components ONCE.   inner components could not expand.  Now we expand recursively.  Your test case recurses indefinitely now, which I think it should always have done except for this bug in Catalyst. I think the new behavior is correct and it moves us in the direction of making Catalyst component setup more flexible and closer to the 'inversion of control container' long term goal we have. I think its totally safe to wrap setup_components, that is not causing this issue. Although I think (but please correct me if you see a flaw in my thinking) that Catalyst is now correct and that your test case is now properly recursive I can see this could cause people trouble.  So I could add a configuration flag to Catalyst like 'dont_expand_inner_components' that if true fails to recurse.  That would solve your test case and if you think people hit this issue in real life non pathological code I can add that. What do you think? jnap On Tuesday, May 19, 2015 9:11 PM, John Napiorkowski <jjn1056@yahoo.com> wrote: I can verify that you get deep recursion when trying to install a previously working CPAN module.  I'll look into it. I do want to point out some of these features are now cored, although the overall approach is different.  I wonder if the efforts could be combined in some manner?  If you could look at the new component injection stuff and two plugins I did around it that I am hoping to see in core someday as well: Catalyst-Plugin-InjectionHelpers-0.007  and Catalyst-Plugin-Ma…Dependencies-0.005 this takes a more moose role based approach rather than subclasses but I bet that could be combined.  In any case 5.9009x was labeled a 'shouldn't break stuff' release and although your code here is definitely flogging catalyst it is hitting public APIs.  Let me think about this a bit. On Tuesday, May 19, 2015 11:10 AM, Peter Flanigan via RT <bug-Catalyst-Runtime@rt.cpan.org> wrote:       Queue: Catalyst-Runtime Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104541 > On Tue May 19 10:04:22 2015, ilmari@ilmari.org wrote: Show quoted text
> Can you please show us your setup_component wrapper, and any > expand_modules method in your components?
Sure the code is here https://metacpan.org/source/PJFL/Catalyst-Plugin-ConfigComponents-0.9.1/lib/Catalyst/Plugin/ConfigComponents.pm
I've deleted the Catalyst plugin form CPAN since it's purpose has now been cored