Skip Menu |
Report information
Id: 122460
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: sprout <sprout [at] cpan.org>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type:
Perl Version:
  • 5.20.0
  • 5.21.0
  • 5.21.1
  • 5.21.2
  • 5.21.3
Fixed In: 5.22.0



Subject: Regression with (?{})(?=...) and pos
Download (untitled) / with headers
text/plain 688b
The presence of the code block in the second program should make no difference. The first result (0) is correct. $ perl5.21.3 -le '$_ =3D "rdvark"; /(?=3D[A-Za-z0-9_])a*?/g; warn pos' 0 at -e line 1. $ perl5.21.3 -le '$_ =3D "rdvark"; /(?{})(?=3D[A-Za-z0-9_])a*?/g; warn pos' 3 at -e line 1. That 3 should be 0, too. A bisect points to this: commit 77ebeeba5f5d47be96b3cef485cb98b1c4980510 Author: Karl Williamson <public@khwilliamson.com> Date: Mon Sep 30 14:06:23 2013 -0600 PATCH: [perl #120041] regcomp.c missing parens and broken STCLASS (Sorry, I should have noticed this before the release of 5.20.) Most importantly, I need a workaround. :-) -- Father Chrysostomos
From: Karl Williamson <public [...] khwilliamson.com>
To: perl5-porters [...] perl.org
Date: Sat, 02 Aug 2014 21:07:22 -0600
Subject: Re: [perl #122460] Regression with (?{})(?=...) and pos
Download (untitled) / with headers
text/plain 1.1k
On 08/02/2014 12:01 PM, Father Chrysostomos (via RT) wrote: Show quoted text
> # New Ticket Created by Father Chrysostomos > # Please include the string: [perl #122460] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=122460 > > > > The presence of the code block in the second program should make no > difference. The first result (0) is correct. > > $ perl5.21.3 -le '$_ =3D "rdvark"; /(?=3D[A-Za-z0-9_])a*?/g; warn pos' > 0 at -e line 1. > $ perl5.21.3 -le '$_ =3D "rdvark"; /(?{})(?=3D[A-Za-z0-9_])a*?/g; warn pos' > 3 at -e line 1. > > That 3 should be 0, too. > > A bisect points to this: > > commit 77ebeeba5f5d47be96b3cef485cb98b1c4980510 > Author: Karl Williamson <public@khwilliamson.com> > Date: Mon Sep 30 14:06:23 2013 -0600 > > PATCH: [perl #120041] regcomp.c missing parens and broken STCLASS > > (Sorry, I should have noticed this before the release of 5.20.) > > Most importantly, I need a workaround. :-) >
Not having looked into this at all, but knowing that 5.20.1 is due this month, if this were to get into that release, would that be a good enough workaround?
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 110b
Now fixed by 842a9d211f60b9643f4a6707f378be70fa2fbb9e which I vote to backport into 5.20.1 -- Karl Williamson
RT-Send-CC: perl5-porters [...] perl.org
Reopening so I can instead mark it as pending release -- Karl Williamson
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.2k
On Fri Aug 08 11:52:10 2014, khw wrote: Show quoted text
> Now fixed by 842a9d211f60b9643f4a6707f378be70fa2fbb9e > which I vote to backport into 5.20.1
Thank you. It gets my vote, too. On Sat Aug 02 20:07:50 2014, public@khwilliamson.com wrote: Show quoted text
> Not having looked into this at all, but knowing that 5.20.1 is due > this > month, if this were to get into that release, would that be a good > enough workaround?
Yes, that would be okay. However, I would still like to get my module working with 5.20.0 if possible, so I have some questions: $ perl5.21.3 -Mre=debug -e 'my $a = "rdvark"; $a =~ /(?=[A-Za-z0-9_])a*?/g;' ... stclass ANYOF[0-9A-Z_a-z] minlen 0 ... $ perl5.21.3 -Mre=debug -e 'my $a = "rdvark"; $a =~ /(?{})(?=[A-Za-z0-9_])a*?/g;' ... stclass ANYOF[a] minlen 0 with eval ... (These one-liners are from before the fix.) It seems that the stclass optimisation is behaving differently depending on the presence or absence of an eval. (I find that surprising. I thought the optimisation would just be turned on or off.) What can I add to the pattern to turn off the optimisation altogether? Under what circumstances does this bug occur? (I.e., where does (?=) have to be in the pattern, etc.) Is it only with (?=...) or does it apply to other assertions, too? -- Father Chrysostomos
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 480b
On Sat Aug 09 09:49:38 2014, sprout wrote: Show quoted text
> What can I add to the pattern to turn off the optimisation altogether? > Under what circumstances does this bug occur? (I.e., where does (?=) > have to be in the pattern, etc.) Is it only with (?=...) or does it > apply to other assertions, too?
My meagre experimentation suggests that it only occurs with (?=...) and that adding (??{}) to the pattern will disable the bug. So I will use that for now.... -- Father Chrysostomos
Date: Mon, 11 Aug 2014 09:20:57 +0100
To: perlbug-comment [...] perl.org
From: Steve Hay <steve.m.hay [...] googlemail.com>
Subject: Re: [perl #122460] Regression with (?{})(?=...) and pos
CC: "perl5-porters [...] perl.org" <perl5-porters [...] perl.org>
Download (untitled) / with headers
text/plain 320b
On 9 August 2014 17:49, Father Chrysostomos via RT <perlbug-comment@perl.org> wrote: Show quoted text
> On Fri Aug 08 11:52:10 2014, khw wrote:
>> Now fixed by 842a9d211f60b9643f4a6707f378be70fa2fbb9e >> which I vote to backport into 5.20.1
> > Thank you. It gets my vote, too. >
+1 from me too, and now cherry-picked into maint-5.20.
Subject: Your ticket against Perl 5 has been resolved
Download (untitled) / with headers
text/plain 222b
Thanks for submitting this ticket The issue should be resolved with the release today of Perl v5.22. If you find that the problem persists, feel free to reopen this ticket -- Karl Williamson for the Perl 5 porters team


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org