|
2014-07-23
| ||
| 14:50 | • Closed ticket [1280817fff]: regexp hangs on some valid REs plus 6 other chan... artifact: cab7e9b1cf user: dgp | |
|
2013-10-17
| ||
| 19:05 | • Ticket [1280817fff]: 7 changes artifact: a63a78cd5b user: dgp | |
|
2005-12-08
| ||
| 21:03 | • Ticket [1280817fff]: 4 changes artifact: 680f73d213 user: nobody | |
|
2005-09-02
| ||
| 16:50 | • New ticket [1280817fff]. artifact: b791010402 user: nobody | |
regexp hangs on some valid REs
Closed / Out of Date1280817fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 12 years ago
Descriptionplain2005-09-02 16:50:09
Certain valid regular expressions cause [regexp]
to hang, apparently in the expression-compilation phase.
The following one-line command hangs Tcl, with memory
requirements increasing apparently without limit:
regexp -about {(\m.*\M)*}
If the final * quantifier is removed, the bug does
not occur.
If the grouping parentheses are removed, the bug does
not occur.
If the grouping is made noncapturing with ?:, the
bug still occurs.
Observed with Tcl 8.4.9.1 snd also 8.3.4, on Win2000.
Submitted by Jonathan Bromley,
[email protected]
nobodyplain2005-12-08 21:03:12
Logged In: NO
Note:
% regexp -about {(\m\M)}
1 {REG_UNONPOSIX REG_ULOCALE REG_UIMPOSSIBLE}
If the IMPOSSIBLE is genuine (and usable), then perhaps
nfatree() in regcomp.c should 'accumulate' its return value
from nfanode so that it retains any IMPOSSIBLE flag.
Something like:
int ret = 0;
if (t->left != NULL) {
ret |= nfatree(v, t->left, f);
}
if (t->right != NULL) {
ret |= nfatree(v, t->right, f);
}
ret |= nfanode(v, t, f);
return ret;
Then compile() can check the return value:
/* build compacted NFAs for tree and lacons */
re->re_info |= nfatree(v, v->tree, debug);
if (re->re_info & REG_UIMPOSSIBLE) {
/* throw an error */
}
More investigation needed :-)
dgpplain2013-10-17 19:05:01
Possibly connected to 8f245009b0
dgpplain2014-07-23 14:50:13
Turns out this is a dup of bugs 1810038 and 1810264 (or rather, they Duped this one!). Both fixed long ago in time for the 8.5.0 release.
Log in (anonymous is fine) to add a comment.