develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl.git] branch blead, updated. v5.19.3-422-gccbcc28

Thread Previous | Thread Next
From:
Brian Fraser
Date:
September 10, 2013 20:32
Subject:
Re: [perl.git] branch blead, updated. v5.19.3-422-gccbcc28
Message ID:
CA+nL+nad64D8hegnphMLnkLLR6dvcAj1X4eqV3CofMg=xdyu_Q@mail.gmail.com
On Tue, Sep 10, 2013 at 4:43 PM, Nicholas Clark <nick@ccl4.org> wrote:

> On Tue, Sep 10, 2013 at 05:37:23PM +0200, Father Chrysostomos wrote:
>
> > commit 4cabb89a737018190d4e09360a6615e19160709f
> > Author: Brian Fraser <fraserbn@gmail.com>
> > Date:   Fri Aug 30 13:10:16 2013 -0300
> >
> >     t/re/reg_mesg.t: Tests for latin1 error messages/warnings
> >
> > M     t/re/reg_mesg.t
>
> This commit is causing this test to trigger a SEGV (or assertion failure)
> when run like this:
>
> LC_ALL=en_US.UTF-8 PERL_UNICODE="" ./perl t/re/reg_mesg.t
>
>
> Output from STDERR is
>
> # Failed test 399 - /(?[ \p{ï} ])/ at ./test.pl line 1404
> #      got 'Property '
> # ' is unknown in regex; marked by <-- HERE in m/(?[ \p{ï} <-- HERE  ])/
> at (eval 210) line 1.
> # '
> # expected /(?^:Property\ \'\ï\'\ is\ unknown\ in\ regex\;\ marked\ by\
> \<\-\-\ HERE\ in\ m\/\(\?\[\ \\p\{\ï\}\ \<\-\-\ HERE\ \ \]\)\/\ at\ )/
> # Failed test 400 - ... and died without any other warnings at
> t/re/reg_mesg.t line 419
> #      got "0"
> # expected "4"
> # Saw these warnings:
> # Use of uninitialized value $table in concatenation (.) or string at
> ../lib/utf8_heavy.pl line 391.
> # Use of uninitialized value $_[0] in substitution (s///) at ../lib/
> utf8_heavy.pl line 23.
> # Use of uninitialized value $loose in pattern match (m//) at ../lib/
> utf8_heavy.pl line 25.
> # Use of uninitialized value $table in concatenation (.) or string at
> ../lib/utf8_heavy.pl line 402.
> perl: utf8.c:2978: Perl__core_swash_init: Assertion `listsv !=
> &PL_sv_undef || (strcmp(name,"")) || invlist' failed.
>
>
> The abort() from the assertion failure is messing up the buffering on
> STDOUT.
>
> If I run with -Dt I see this:
>
> (t/re/reg_mesg.t:416)   const(PV("x"\0))
> (t/re/reg_mesg.t:416)   gvsv(main::_)
> (t/re/reg_mesg.t:416)   sassign
> (t/re/reg_mesg.t:416)   nextstate
> (t/re/reg_mesg.t:417)   padsv($regex)
> (t/re/reg_mesg.t:417)   hintseval(HV())
> (t/re/reg_mesg.t:417)   entereval
> perl: utf8.c:2978: Perl__core_swash_init: Assertion `listsv !=
> &PL_sv_undef || (strcmp(name,"")) || invlist' failed.
> Aborted
>
> which is the eval in this:
>
>     warning_is(sub {
>                    $_ = "x";
>                    eval $regex;
>                    like($@, qr/\Q$expect/, $regex);
>                }, undef, "... and died without any other warnings");
>
>
> I've not had time to prune it down to a smaller test, sorry.
> I assume that the bug has been there for a while, and the new test is
> simply exposing it.


> Nicholas Clark
>

Oh, this sounds like fun. I'm currently not quite on the computer, but I'll
take a look at this in an hour and hopefully have a fix for it soon.
The windows issue sounds like macro expansion works differently there; I
think this should fix it, but I cannot test it right now:

diff --git a/regcomp.c b/regcomp.c
index 9da2849..3e6ec29 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -565,9 +565,11 @@ static const scan_data_t zero_scan_data =

 /* A specialized version of vFAIL2 that works with UTF8f */
 #define vFAIL2utf8f(m, a1) STMT_START { \
-    if (!SIZE_ONLY)                     \
-        SAVEFREESV(RExC_rx_sv);         \
-    Simple_vFAIL4(m, a1);               \
+    const IV offset = RExC_parse - RExC_precomp;   \
+    if (!SIZE_ONLY)                                \
+        SAVEFREESV(RExC_rx_sv);                    \
+    S_re_croak2(aTHX_ UTF, m, REPORT_LOCATION, a1, \
+            REPORT_LOCATION_ARGS(offset));         \
 } STMT_END

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