develooper Front page | perl.perl5.porters | Postings from January 2017

[perl #130561] Coredump in Perl_re_op_compile

Thread Next
From:
Hugo van der Sanden via RT
Date:
January 25, 2017 15:47
Subject:
[perl #130561] Coredump in Perl_re_op_compile
Message ID:
rt-4.0.24-2599-1485359255-269.130561-15-0@perl.org
On Sun, 22 Jan 2017 04:48:49 -0800, randir wrote:
> Before v5.18.0, this'd just die() during a regex compilation. It was
> either exposed or caused by the following commit:
> 
> 31c15ce5372b770c3ca899df6cf102f1ed6866ba is the first bad commit
> commit 31c15ce5372b770c3ca899df6cf102f1ed6866ba
> Author: Karl Williamson <public@khwilliamson.com>
> Date:   Sat Sep 15 12:27:22 2012 -0600
> 
> PATCH: [perl #82954] Make "Can't do {n,m} with n > m into warning
> 
> This commit now causes this situation to warn instead of dying.  The
> portion of the regular expression that can't match is optimized into
> an
> OPFAIL.

Yes, this change falls foul of:
    /* Do setup, note this code has side effects beyond
     * the rest of this block. Specifically setting
     * RExC_recurse[] must happen at least once during
     * study_chunk(). */
.. since it optimizes away the node we must still study.

Karl, do you see any problem with just removing the optimizing aspect, per the attached patch? If not, I'll wrap in a test and commit.

Hugo

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=130561

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