Fixing Perl5 Core Bugs: Report for Month 28

No Comments

Dave Mitchell writes:

As per my grant conditions, here is a report for the June period.

This month saw the final merging of my re_eval branch back into blead, and incorporated in the 5.17.1 release. This consisted of about 125 commits, spread out over a year. The remainder of the month was spent fixing some of the issues thrown up by the new implementation.

Some highlights of the new /(?{})/ implementation are:

Code blocks within patterns are now parsed in the same pass as the surrounding code; in particular it is no longer necessary to have balanced braces: this now works:

/(?{ $x='{' })/

This means that this error message is longer generated:

Sequence (?{...}) not terminated or not {}-balanced in regex

but a new error may be seen:

Sequence (?{...}) not terminated with ')'

In addition, literal code blocks within run-time patterns are only compiled once, at perl compile-time:

for my $p (...) {
    # this 'FOO' block of code is compiled once, at the same time as
    # the surrounding 'for' loop
    /$p{(?{FOO;})/;
}

Lexical variables are now sane as regards scope, recursion and closure behaviour. In particular, /A(?{B})C/ behaves (from a closure viewpoint) exactly like /A/ && do { B } && /C/, while qr/A(?{B})C/ is like sub {/A/ && do { B } && /C/}. So this code now works how you might expect, creating three regexes that match 1,2, and 3:

for my $i (0..2) {
    push @r, qr/^(??{$i})$/;
}
"1" =~ $r[1]; # matches

The use re 'eval' pragma is now strictly only required for code blocks defined at runtime; in particular in the following, the text of the $r@ pattern is still interpolated into the new pattern and recompiled, but the individual compiled code-blocks within @$r are reused rather than being recompiled, and use re 'eval' isn't needed any more:

my $r = qr/abc(?{....})def/;
/xyz$r/;

Flow control operators no longer crash. Each code block runs in a new dynamic scope, so next etc. will not see any enclosing loops and caller will not see any calling subroutines. return returns a value from the code block, not from any enclosing subroutine.

Over the last month I have averaged 15 hours per week.

As of 2012/06/31: since the beginning of the grant:

120.9 weeks
1300.0 total hours
10.8 average hours per week

There are now 0 hours left on the grant (but the grant has just been extended :-)

Report for period 2012/06/01 to 2012/06/30 inclusive

Summary

Effort (HH::MM):

23:50 diagnosing bugs
39:03 fixing bugs
0:00 reviewing other people's bug fixes
0:00 reviewing ticket histories
0:00 review the ticket queue (triage)
-----
62:53 Total

Numbers of tickets closed:

4 tickets closed that have been worked on
0 tickets closed related to bugs that have been fixed
0 tickets closed that were reviewed but not worked on (triage)
-----
4 Total

[actually, an additional 25 tickets were closed, but I forgot to update my automatic log]

Short Detail

8:42 [perl #3634] Capture corruption through self-modying regexp (?{...})
36:41 [perl #34161] METABUG - (?{...}) and (??{...}) regexp issues
4:25 [perl #113670] Bleadperl v5.17.0-451-gf6033a9 breaks SBECK/Date-Manip-6.32.tar.gz
2:00 [perl #113676] Bleadperl v5.17.0-383-g9f14173 breaks PARDUS/File-MimeInfo/File-MimeInfo-0.16.tar.gz
10:05 [perl #113682] Bleadperl v5.17.0-424-gd24ca0c breaks ABIGAIL/Regexp-Common-2011121001.tar.gz
1:00 [perl #113720] perl dumping core in regex et al(mem corruption?)

Leave a comment

About TPF

The Perl Foundation - supporting the Perl community since 2000. Find out more at www.perlfoundation.org.

About this Entry

This page contains a single entry by Karen published on July 13, 2012 8:36 AM.

2012Q3 Call for Grant Proposals was the previous entry in this blog.

Devel::Cover Grant Report for June is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.38