Artifacts Associated With Ticket 505048ffffffffffffffffffffffffffffffffff
Ticket change [c4b9dc91d8] (rid 111885) by dgp on 2002-01-17 19:56:27:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% regexp {\A\s*[^<]*\s*<([^>]+)>} "Newsletter Subscriber <[email protected]>" all mail error while matching regular expression: "can't happen" -- you found a bug - foundin initialized to: "obsolete: 8.4a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "43. Regexp"
- title initialized to: "impossible occurs!"
- type initialized to: "Bug"
Ticket change [624ad9c8ae] (rid 92391) by dgp on 2002-01-18 03:01:40:
- icomment:
Logged In: YES user_id=80530 Simpler case: % regexp {\A\s*[^<]*\s*<([^>]+)>} "a <a>" all mail error while matching regular expression: "can't happen" -- you found a bug - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [2ca35a7b5e] (rid 118938) by dgp on 2002-01-18 03:03:35:
- icomment:
Logged In: YES user_id=80530 simpler still: % regexp {\A\s*[^<]*\s*<([^>]+)>} a<a> all mail error while matching regular expression: "can't happen" -- you found a bug - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [951616bc7a] (rid 106102) by dgp on 2002-01-18 03:16:41:
- icomment:
Logged In: YES user_id=80530 yet simpler variations: % regexp {\A\s*([^b]*)b} ab all mail error while matching regular expression: "can't happen" -- you found a bug % regexp {\A\s*[^b]*(b)} ab all mail error while matching regular expression: "can't happen" -- you found a bug % regexp {\A(\s*)[^b]*(b)} ab all mail error while matching regular expression: "can't happen" -- you found a bug Location of the capturing parens doesn't seem to matter as long as they are there. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [ce40396ab5] (rid 96020) by dgp on 2002-01-18 04:11:16:
- icomment:
Logged In: YES user_id=80530 A comment from Helmut Giese in c.l.t leads to: % regexp {\A\s*[^b]*b} ab all 1 % set all % Although no "can't happen" error, one would expect $all to be ab, but it's not. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [80ac967195] (rid 116906) by dkf on 2002-01-18 16:20:31:
- icomment:
Logged In: YES user_id=79902 Eep! Nasty, nasty, nasty... % regexp -inline {\A\s*[^b]*b} ab `h % regexp -indices -inline {\A\s*[^b]*b} ab {3 -139006} The first made me go "Eh?" and the second makes me want to hide, because it indicates that something is seriously wrong. Upping the priority. - login: "dkf"
- mimetype: "text/plain"
- priority changed to: "7 High"
- username: "dkf"
- icomment:
Ticket change [cc544d76eb] (rid 95681) by dkf on 2002-01-18 16:24:24:
- icomment:
Logged In: YES user_id=79902 But substituting ^ for \A makes the problem go away; maybe the bug lies there?
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [0550f07032] (rid 89037) by hartweg on 2002-04-18 17:00:35:
- icomment:
Logged In: YES user_id=338658 Just an observation that may (or may not) help track this down. If the \s* elements are removed (which still gives desired output sinces they are redundent as whitespace is also "eaten" by the [^>]* or [^b]* elements) then the error does not occur.
- login: "hartweg"
- mimetype: "text/plain"
- username: "hartweg"
- icomment:
Ticket change [6de287bec7] (rid 128779) by mistachkin on 2003-05-10 17:24:57:
- foundin changed to: "None"
- icomment:
Logged In: YES user_id=113501 I don't know if this helps, but I traced the problem to this line (with assert enabled, that is): regexec.c, near line #318 assert(end != NULL); /* search RE succeeded so loop should */ By the way, this still applies in CVS HEAD (8.5a0).
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
Ticket change [509841d50b] (rid 126000) by mistachkin on 2003-05-10 20:10:15:
- icomment:
Logged In: YES user_id=113501 After further research, I have uncovered the following information: In file regexec.c on line #281, there is the following code: close = shortest(v, s, v->start, v->start, v->stop, &cold, (int *)NULL); This call is not producing the correct result for this "buggy" regexp. I came to this conclusion after I was able to obtain the correct result by manually setting the loop start variable begin to the value of v->start. As we can see here, "begin" gets it's initial value from the variable "open", which gets it's initial value from the variable "cold", which is set by function "shortest" prior to the loop. The following attempts to illustrate the flow of this very important value: cold = NULL; close = shortest(v, s, v->start, v->start, v->stop, &cold, (int *)NULL); <more code here> open = cold; cold = NULL; <more code here> for (begin = open; begin <= close; begin++) { <more code here> <this loop is extremely sensitive to the starting value of "begin"> } Further analysis reveals the reason why the variable "cold" is getting an invalid value (off by one "character", which is actually 2 bytes). This is due to function "shortest" calling function "lastcold", which iterates through the "d- >ssets" array looking for a NOPROGRESS flag. I believe this is the root cause of the problem, the NOPROGRESS flag is being set on d->sset[2] incorrectly, specifically in the "miss" function called (quite a few times) by: find --> shortest --> miss The interesting thing about this is that it appears to be a very fancy off-by-one error. It may be worthwhile to further analyze the differences between "{^blah}" and "{\Ablah}" to understand why the NOPROGRESS flag is being set incorrectly. - login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [e4a7e97793] (rid 87989) by dgp on 2003-11-13 05:18:08:
- assignee changed to: "pvgoran"
Ticket change [f583bab140] (rid 130120) by dgp on 2003-11-13 08:16:53:
- foundin changed to: "obsolete: 8.4.5"
Ticket change [ead9e148bf] (rid 103439) by pvgoran on 2003-11-15 18:37:23:
- icomment:
Logged In: YES user_id=383758 This bug results from an error in code that splits states into "progress" and "no-progress" ones. This error causes an interesting situation with the pre-collected single-linked list of states to be splitted: many items were added to the list, but only several of them are accessible from the list beginning, since the "tmp" member of struct state (which is used here to hold a pointer to the next list item) gets overwritten, which results in a "looped" chain. As a result, not all of states are splitted, and one state is splitted two times, causing incorrect "no-progress" flag values. The bug fix is checked into CVS (regcomp.c, revision 1.8). Also, a patch with this fix is attached here.
- login: "pvgoran"
- mimetype: "text/plain"
- username: "pvgoran"
- icomment:
Ticket change [96186423d3] (rid 106264) by pvgoran on 2003-11-15 18:41:28:
- icomment:
File Added - 67582: regcomp.c.diff
- login: "pvgoran"
- mimetype: "text/plain"
- username: "pvgoran"
- icomment:
Add attachment "regcomp.c.diff" [2be80100e1] (rid 118822) by pvgoran on 2003-11-15 18:41:28.
Ticket change [a254314b2b] (rid 109871) by pvgoran on 2003-11-15 18:43:39:
- closedate changed to: "2003-11-15T11:43:39"
- closer changed to: "pvgoran"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [c14f79ab55] (rid 111303) by dgp on 2003-11-16 01:05:37:
- assignee changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Thanks! Assigning back to myself for the addition of tests to the test suite, and to consider a backport for Tcl 8.4.5.
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "dgp"
Ticket change [71012d1f2b] (rid 100586) by dgp on 2003-11-18 00:44:55:
- icomment:
Logged In: YES user_id=80530 Added tests reg-33.* to test all the bugs fixed by this patch.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [3db72e3308] (rid 121136) by dgp on 2003-11-18 00:53:23:
- icomment:
Logged In: YES user_id=80530 Back ported fixand tests for Tcl 8.4.5.
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "dgp"
- icomment:
Ticket change [a33f347a00] (rid 110020) by dgp on 2003-11-18 00:53:24:
- closedate changed to: "2003-11-17T17:53:24"
- closer changed to: "dgp"