Bug 676547

Summary: Large number of string evals makes interpreter emit syntax error [perl #83364]
Product: Red Hat Enterprise Linux 5 Reporter: andreas
Component: perlAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED ERRATA QA Contact: Petr Šplíchal <psplicha>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.8CC: ohudlick, ppisar, psabata, psplicha, rbiba
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: perl-5.8.8-33.el5 Doc Type: Bug Fix
Doc Text:
Cause Large number of string evaluation. Consequence Large number of string evaluation makes interpreter emit syntax error. Fix The variable used within string evaluation had too small value. The upstream patch, which enlarge this value, was backported. Result Large number of string evaluation does not make interpreter emit syntax error.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 05:40:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
modified patch from maint-5.12 none

Description andreas 2011-02-10 07:55:03 UTC
Description of problem:

Upstream [perl #83364] affects perl 5.8 and perl 5.10 but will only be fixed in 5.12 by perl5-porters.  Reporter requests backport of upstream fix into Redhat perl 5.8 and perl 5.10.

Version-Release number of selected component (if applicable):

Reproduced on perl 5.8.8, 32 and 64 bit (see [1]).

Steps to Reproduce:

Proof of concept code in [1].  Typically takes 2-8 wall clock hours to reproduce.
  
Additional info:

[1] http://rt.perl.org/rt3//Public/Bug/Display.html?id=83364

Comment 1 Marcela Mašláňová 2011-04-13 11:53:18 UTC
Most probably for 5.8.8 will be needed more patches than these. Patches are part of perl-5.13.11.

Comment 2 Marcela Mašláňová 2011-09-13 08:00:10 UTC
It seems to be fixable by patch d1bfb649a8c4cc0b39b0fd6371c009b71c0b497f (maint-5.12). Other patches cleaned the code, but they are not easily applicable on 5.8.x.

As test could be used code:
$ cat eval.pl
use strict;
use warnings;
my $c;

print 'start: ' . scalar localtime();

for ($c = 0; !$@; $c++) {
eval 'my $abc = 1; $abc++; ';
}

print $c . ' ' . $@;
print 'end : ' . scalar localtime();

__END__

Other tests could be found in original report, but sadly it takes few hours to reproduce.

Comment 3 Marcela Mašláňová 2011-09-13 08:04:13 UTC
Created attachment 522868 [details]
modified patch from maint-5.12

Comment 10 Marcela Mašláňová 2011-09-26 07:50:35 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    Large number of string evaluation.
Consequence
    Large number of string evaluation makes interpreter emit syntax error.
Fix
    The variable used within string evaluation had too small value. The upstream patch, which enlarge this value, was backported.
Result
     Large number of string evaluation does not make interpreter emit syntax error.

Comment 12 errata-xmlrpc 2012-02-21 05:40:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0199.html