New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in Regex-Engine (?) #12949
Comments
From kochnorman@rocketmail.comI am not sure, whether perlbug correctly sent this or not. Sorry, if The attached file is the bugreport, that I (hope) I just sent. If so, |
From kochnorman@rocketmail.comCreated by kochnorman@rocketmail.comI was just playing around trying to build a regex for the rather complex problem of matching a q-like-operator-string in Perl (like qq/hallo/, but also "hallo" and so on). So, I came to trying this: use strict; use re "debugcolor"; sub getDel { 'qq"hello"' =~ /(?<stringstart>(?:q(?:[xwrq])?\s*)?)(?<delim>(??{ (exists ( When executing this code, I get this output (including re "debugcolor"-Output): Compiling REx "(?<stringstart>(?:q(?:[xwrq])?\s*)?)(?<delim>(??{ (exists ($"... ... and I cannot really see why perl crashes here. I didn't except that regex to work perfectly or even to work at all (regarding to matching the correct things), because this task is maybe too complex to achieve it with a regex, but I certainly did not expect perl to crash with a segmentation fault. When disabling re "debugcolor", the output is "Use of uninitialized value $+{"delim"} in die at (re_eval 2) line 1. Perl Info
|
From @jkeenanOn Wed May 08 13:36:33 2013, kochnorman@rocketmail.com wrote:
The program as I have extracted it from your attachment: ##### use re "debugcolor"; sub getDel { 'qq"hello"' =~ /(?<stringstart>(?:q(?:[xwrq])?\s*)?)(?<delim>(??{ When I run this with 'use re "debugcolor";' commented out, I get this: ##### When I activate 'use re "debugcolor";', the program ends with a bus Now, I have never actually used named captures in regular expressions, But if this were my program I'd deal *first* with the warning and error I don't see any evidence yet that there is a problem with the Perl 5 My two cents. Thank you very much. |
From @jkeenan$ perl 117917_regex.pl |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Wed, May 08, 2013 at 06:14:45PM -0700, James E Keenan via RT wrote:
Given it's perl code using only core modules, the match is against a That said, blead doesn't crash (but still has an undefined $+{delim}). Tony |
From @nwc10On Thu, May 09, 2013 at 11:32:19AM +1000, Tony Cook wrote:
Tweaking the test case to this (warn, instead of die): $ cat ../117917.pl use re "debugcolor"; sub getDel { 'qq"hello"' =~ /(?<stringstart>(?:q(?:[xwrq])?\s*)?)(?<delim>(??{ bisecting it with $ bisect.pl --expect-fail --start v5.16.0 ../117917.pl says 8a45afe is the first bad commit unlink re_eval code blocks from op list In the list of ops generated by something like /abc(?{...})def/, const(abc) link the list, but skip the DO blocks. This means that for the runtime :100644 100644 1d7a7fde3ab4a110f7a6c1d540cddc6c02c3dc81 75667dff430ffb0ad56549aa1a0e4ffffac67e0f M op.c ie "bad" means that that commit fixed the bus error. Nicholas Clark |
From @iabynOn Thu, May 09, 2013 at 11:32:19AM +1000, Tony Cook wrote:
This can be reduced to; 'ab' =~ /^(a(?{ 'x' =~ m{x}})b)(?{ warn "inner undef!\n" unless defined $1 })/; which produces: inner undef! removing the match from inside the (?{}) makes the issue go away, so it looks I'm looking into why. -- |
From @cpansproutOn Thu May 09 08:54:30 2013, davem wrote:
I have beaten you to it. :-) Fixed in f5df269. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#117917 (status was 'resolved')
Searchable as RT117917$
The text was updated successfully, but these errors were encountered: