bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug xml/29047] StackOverflowError when parsing large XML file with vali


From: kaz at maczuka dot gcd dot org
Subject: [Bug xml/29047] StackOverflowError when parsing large XML file with validation turned on
Date: 18 Sep 2006 11:16:53 -0000


------- Comment #3 from kaz at maczuka dot gcd dot org  2006-09-18 11:16 -------
I have confirmed that this problem is caused by the regex engine.

Running the following simple program with the command like
"java L 3000" will show the problem:

import java.util.regex.*;
public class L {
  public static void main(String[] args) throws Exception {
    Pattern p = Pattern.compile("(b)+");
    int n = Integer.parseInt(args[0]);
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < n; i++) {
      sb.append("b");
    }
    Matcher m = p.matcher(sb);
    m.matches();
  }
}

gnu.java.util.regex.RETokenRepeated uses a recursive call to find
a match, and the longer the match is, the deeper the recursive call
goes.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29047





reply via email to

[Prev in Thread] Current Thread [Next in Thread]