bugGrammatica - Bugs: bug #3653, Regular Expression: Quantifier...


You are not allowed to post comments on this tracker with your current authentication level.

bug #3653: Regular Expression: Quantifier matching may fail on second attempt

Submitter:  Per Cederberg <cederberg>
Submitted:  Sat 17 May 2003 11:39:58 AM UTC
Severity:  9 - Critical Item Group:  Software
Status:  Fixed Assigned to:  cederberg
Open/Closed:  Closed

Mon 26 May 2003 07:34:49 AM UTC, comment #2: 

Included in version 1.1 released today.

Per Cederberg <cederberg>
Group administrator
Sat 17 May 2003 02:24:07 PM UTC, comment #1: 

This was caused by an error in the RepeatElement class in
the regular expression package. It was only an issue for
the Java implementation, and was caused by appending
characters to the CharBuffer while the RepeatElement class
maintained a state for the previous matches. When adding
more characters to the end, longer matches were possible
that weren't properly discovered due to the matcher state
not being properly reset.

A reset call has now been added in both the C# and Java
version, and an automatic test has been added for Java.
It is impossible to trigger this error in the C# version,
as the string in the matcher never changes.

Per Cederberg <cederberg>
Group administrator
Sat 17 May 2003 11:39:58 AM UTC, original submission:  

The regular expression quantifier matching uses an internal
state in order to speed up the matching. When using the same
matcher several times on a character buffer that has been
modified, the matching can fail due to remembering previous
information about the string to be matched.

This error occurs very infrequently in the tokenizer, and
wasn't detected until several hundred files had been parsed

Per Cederberg <cederberg>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2003-05-26 cederberg Open/ClosedOpen None
2003-05-17 cederberg StatusNone None

Back to the top

Powered by Savane 3.13-b921.
Corresponding source code