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 regcomp code leading to panic #9201
Comments
From mls@suse.deCreated by mls@suse.deOn ppc/s390x the following perl code panics: $ perl -e '("0"x51)=~/0{50}/' The compiled re looks like this: This is caused by a bug in the "kip introductions and multiplicators >= 1" if (OP(first) == PLUS) As OP(first) == CURLY in our case, first is incremented by I don't know the correct fix for this, because I do not understand if (OP(first) == PLUS) { Probably not, as the EXTRA_STEP_2ARGS is strange. (IFMATCH is of type Perl Info
|
From Michael.Schroeder@informatik.uni-erlangen.deOn Tue, Jan 22, 2008 at 10:27:50AM -0800, mls @ suse. de wrote:
No patch for this one? Yves? Tels? Cheers, -- |
The RT System itself - Status changed from 'new' to 'open' |
From nospam-abuse@bloodgate.comMoin, On Friday 15 February 2008 16:39:04 Michael Schroeder wrote:
Not sure why you ask me, regexp is not my area :) On my 64bit Ubuntu with 5.8.8, it "works": # perl -e '("0"x51)=~/0{50}/' All the best, Tels -- "Obviously, Perl 5 has been aging, but there is no reason to bury it -- Larry Wall in 'The State of the Onion' 2002 |
From @demerphqOn 15/02/2008, Michael Schroeder
Sorry ive been very busy with other things. What happens if you just remove if (OP(first) == IFMATCH) { so it looks like: if (OP(first) == PLUS) (TBH looking at the code Im wondering what i was thinking when i added With this extra block removed does it fix the problem (i guess so), /(?=foo)bar/ look like? To explain a bit, regnode_1 and regnode_2 are actually the same size, I think i was probably intending something like this: if (OP(first) == PLUS) { but digging a bit it turns out that regarglen[OP(first)] would be the if (OP(first) == PLUS) { which is the same as if (OP(first) == PLUS) { The point of this code is step over/into the quantifier opecodes so /0{50}/ we have to step over the CURLY to find the EXACT. In the case of Please let me know how this goes. I dont have time to dig further right now. cheers, -- |
From @demerphqOn 22/01/2008, via RT mls @ suse. de <perlbug-followup@perl.org> wrote:
Hopefully change #33324 resolves this problem. Please confirm and we http://public.activestate.com/cgi-bin/perlbrowse/p/33324 Thanks for the report. yves -- |
From Michael.Schroeder@informatik.uni-erlangen.deOn Sat, Feb 16, 2008 at 05:52:52PM +0100, demerphq wrote:
With your patch applied, the output is: Compiling REx "(?=foo)bar" Looks good, I guess. And the panic is also gone. Thanks for your patch, -- |
From Michael.Schroeder@informatik.uni-erlangen.deOn Tue, Feb 19, 2008 at 02:23:15PM +0100, Michael Schroeder wrote:
While I've got your attention, the following code works in 5.8 my $r = qr{^bar}; This is because the qr{} compiles the regexp to: As it's already compiled, the //m modifier can't turn it into if (locinput == PL_bostr || (PL_multiline && whereas perl-5.10 just has if (locinput == PL_bostr) Is this intentional? Or a bug inserted when $* got removed? Thanks, -- |
From rick@bort.caOn Feb 19 2008, Michael Schroeder wrote:
This is a bug fix. qr{^bar} gives the pattern /(?-xism:^bar)/ so it -- |
From Michael.Schroeder@informatik.uni-erlangen.deOn Tue, Feb 19, 2008 at 10:18:40AM -0500, Rick Delaney wrote:
Hmm, this fix is not mentioned in perldelta and breaks a couple of modules Cheers, -- |
From @demerphqOn 20/02/2008, Michael Schroeder
I dont think it was a deliberate fix, I think it was something that Yves -- |
From rick@bort.caOn Feb 20 2008, demerphq wrote:
The fix was deliberate enough in that it was meant to decouple /m from The particular case I was fixing was for $re = qr/^bar/m; not matching when it should, but the opposite case: $re = qr/^bar/; matching when it should not would clearly be fixed by the same patch. I -- |
From @demerphqOn 20/02/2008, Rick Delaney <rick@bort.ca> wrote:
Personally i dont think its a big deal. Worst aspect of it was it was yves -- |
From Michael.Schroeder@informatik.uni-erlangen.deOn Wed, Feb 20, 2008 at 11:17:58AM -0500, Rick Delaney wrote:
Hmm, but that did match in perl-5.8, as the regexp compiler used MBOL
Yes, regression tests are always hard to write. Cheers, -- |
@smpeters - Status changed from 'open' to 'resolved' |
From @nwc10Dave notes: add to perldelta the fact (missing from 5.10.0 delta) that /m |
Migrated from rt.perl.org#50114 (status was 'resolved')
Searchable as RT50114$
The text was updated successfully, but these errors were encountered: