jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [DO NOT REPLY: Bug 3561] Stack overflow with certain patterns.
Date Wed, 12 Sep 2001 13:55:04 GMT
PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT
ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW
AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE
DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL
BE LOST SOMEWHERE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3561

*** shadow/3561	Wed Sep 12 00:38:25 2001
--- shadow/3561.tmp.16941	Wed Sep 12 06:55:04 2001
***************
*** 2,10 ****
  | Stack overflow with certain patterns.                                      |
  +----------------------------------------------------------------------------+
  |        Bug #: 3561                        Product: ORO                     |
! |       Status: NEW                         Version: 2.0.4                   |
! |   Resolution:                            Platform: PC                      |
! |     Severity: Major                    OS/Version: Linux                   |
  |     Priority: Other                     Component: Main                    |
  +----------------------------------------------------------------------------+
  |  Assigned To: oro-dev@jakarta.apache.org                                   |
--- 2,10 ----
  | Stack overflow with certain patterns.                                      |
  +----------------------------------------------------------------------------+
  |        Bug #: 3561                        Product: ORO                     |
! |       Status: RESOLVED                    Version: 2.0.4                   |
! |   Resolution: LATER                      Platform: PC                      |
! |     Severity: Normal                   OS/Version: Linux                   |
  |     Priority: Other                     Component: Main                    |
  +----------------------------------------------------------------------------+
  |  Assigned To: oro-dev@jakarta.apache.org                                   |
***************
*** 19,21 ****
--- 19,45 ----
  ------- Additional Comments From tanis@sport1.uibk.ac.at  2001-09-12 00:38 -------
  Created an attachment (id=527)
  Also works with the pattern inside this .java - file.
+ 
+ 
+ ------- Additional Comments From dfs@apache.org  2001-09-12 06:55 -------
+ The problem is really in the pattern, not so much in the matcher.  You are
+ using patterns that match the empty string, which will match an infinite number
+ of times when used in conjunction with a repetition operator.  However, it
+ is undesirable to repeatedly match the empty string as the result of the
+ same null matching construct, so we'll try to do
+ something about this in a later version as we push toward Perl 5.6 
+ compatibility.  The solution for now is to be more careful about writing
+ patterns (how you write a Perl pattern can have an enormous impact on its
+ matching efficiency in both Perl and jakarta-oro).  If you
+ really don't want to think about how the NFA represented by a Perl regular
+ expression is interpreted, then put the empty string matching constructs
+ as far to the left as possible.  In other words, write
+ "'(\\\\?|[^'\\\\]+)+'"
+ instead of
+ "'([^'\\\\]+|\\\\?)+'"
+ 
+ However, these two patterns do have slightly different meanings and you may
+ have to reduce the expression to a more efficient equivalent one (see
+ discussion of "first" and "forward" and NFA reduction in Aho, Sethi, and
+ Ullman's "Compilers: Principles, Techniques, and Tools" or even "Mastering
+ Regular Expressions" by Jeff Friedl)

Mime
View raw message