imp has asked for the wisdom of the Perl Monks concerning the following question:
I was revisiting Negating Regexes: Tips, Tools, And Tricks Of The Trade and caused perl to segfault with one of the patterns I tried. I reduced the pattern to he simplest form that still causes a problem.
Tested with:
This is perl, v5.8.7 built for i486-linux-gnu-thread-multi Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
This works:
This segfaults"1" =~ qr[(??{/^1/})]
"<" =~ qr[(??{/^</})]
Segfault re=debug output:
Is this fixed in later perls?Freeing REx: `","' Compiling REx `(??{/^</})' size 4 Got 36 bytes for offset annotations. Compiling REx `^<' size 4 Got 36 bytes for offset annotations. first at 2 1: BOL(2) 2: EXACT <<>(4) 4: END(0) anchored `<' at 0 (checking anchored) anchored(BOL) minlen 1 Offsets: [4] 1[1] 2[1] 0[0] 3[0] first at 1 1: LOGICAL[2](2) 2: EVAL(4) 4: END(0) minlen 0 with eval Offsets: [4] 10[0] 10[0] 0[0] 11[0] Matching REx `(??{/^</})' against `<' Setting an EVAL scope, savestack=15 0 <> <<> | 1: LOGICAL[2] 0 <> <<> | 2: EVAL re_eval 0x8153fe8 Guessing start of match, REx `^<' against `<'... Guessed: match at offset 0 Matching REx `^<' against `<' Setting an EVAL scope, savestack=15 0 <> <<> | 1: BOL 0 <> <<> | 2: EXACT <<> 1 <<> <> | 4: END Match successful! Compiling REx `1' size 3 Got 28 bytes for offset annotations. first at 1 1: EXACT <1>(3) 3: END(0) anchored `1' at 0 (checking anchored isall) minlen 1 Offsets: [3] 1[1] 0[0] 2[0] Entering embedded `1' Setting an EVAL scope, savestack=21 0 <> <<> | 1: EXACT <1> failed... Freeing REx: `"1"' failed... Setting an EVAL scope, savestack=24 1 <<> <> |50339: LOGICAL[2] 1 <<> <> |50340: EVAL
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: regex bug in perl 5.8.7
by dmitri (Priest) on May 25, 2007 at 16:44 UTC | |
Re: regex bug in perl 5.8.7
by dave_the_m (Monsignor) on May 25, 2007 at 18:41 UTC | |
by imp (Priest) on May 25, 2007 at 18:46 UTC | |
by mr_mischief (Monsignor) on May 25, 2007 at 21:38 UTC | |
by dave_the_m (Monsignor) on May 25, 2007 at 22:01 UTC | |
by mr_mischief (Monsignor) on May 29, 2007 at 14:25 UTC | |
Re: regex bug in perl 5.8.7
by TGI (Parson) on May 25, 2007 at 16:58 UTC | |
Re: regex bug in perl 5.8.7
by Skeeve (Parson) on May 25, 2007 at 17:18 UTC | |
Re: regex bug in perl 5.8.7
by diotalevi (Canon) on May 25, 2007 at 23:22 UTC | |
by imp (Priest) on May 25, 2007 at 23:44 UTC | |
by diotalevi (Canon) on May 26, 2007 at 00:12 UTC | |
by imp (Priest) on May 26, 2007 at 04:31 UTC | |
Re: regex bug in perl 5.8.7
by vrk (Chaplain) on May 25, 2007 at 18:22 UTC |
Back to
Seekers of Perl Wisdom