develooper Front page | perl.perl5.porters | Postings from April 2016

Re: [perl #127981] [PATCH] Deep recursion warning with%Module::CoreList::version

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
April 25, 2016 07:29
Subject:
Re: [perl #127981] [PATCH] Deep recursion warning with%Module::CoreList::version
Message ID:
20160425072821.GA23426@iabyn.com
On Sun, Apr 24, 2016 at 02:48:46PM -0700, Father Chrysostomos via RT wrote:
> On Sun Apr 24 12:35:03 2016, ntyni@debian.org wrote:
> > This is a bug report for perl from Niko Tyni <ntyni@debian.org>,
> > generated with the help of perlbug 1.40 running under perl 5.22.1.
> > 
> > 
> > -----------------------------------------------------------------
> > [Please describe your issue here]
> > 
> > Iterating over %Module::CoreList::version elements for Perl >= 5.23.2
> > causes a deep recursion warning. Apparently the elements are chained
> > together, and the length of the chain now exceeds the heuristic
> > warning
> > limit (100).
> > 
> > % perl -MModule::CoreList -wE 'say scalar keys
> > %{$Module::CoreList::version{5.023002}}'
> > Deep recursion on subroutine
> > "Module::CoreList::TieHashDelta::FIRSTKEY" at
> > /usr/share/perl/5.22/Module/CoreList/TieHashDelta.pm line 54.
> > 622
> > 
> > Proposed patch attached, assuming "no warnings 'recursion'" is fine
> > on older perls?
> 
> I have used it in 5.8, so it should be fine.
> 
> I think this should be fixed before we release 5.24.

+1

Its due to a tied lookup recursively looking up parent perl versions
(i.e. working its way back through the chain of deltas between perl
versions), then caching the result.

In the tests the warning only appears occasionally during smoking due to
hash key randomisation affecting the order perl versions are scanned.

Post-5.24 we really ought to fix it properly (iterate rather than
recursive tie lookups) otherwise at some point we're going to blow the C
stack.



-- 
A power surge on the Bridge is rapidly and correctly diagnosed as a faulty
capacitor by the highly-trained and competent engineering staff.
    -- Things That Never Happen in "Star Trek" #9

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About