djspiewak/anti-xml — Issue #75: XML.fromString(xmlString) throws StackOverflowException
Author: eirirlar
Created: 2011-11-28 07:29:39+00:00
State: open

Using anti-xml 0.2 with scala 2.9.1.

val xmlString = new Scanner(this.getClass.getClassLoader.getResourceAsStream(thefilestring), "UTF-8").useDelimiter("\\A").next
val xml = XML.fromString(xmlString)

The above throws StackOverflowException on certain files like the one linked to below.

java.lang.StackOverflowError
at java.util.regex.Pattern$Loop.match(Pattern.java:4683)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4615)
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4466)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3694)
at java.util.regex.Pattern$Branch.match(Pattern.java:4502)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
at java.util.regex.Pattern$Loop.match(Pattern.java:4683)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4615)
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4466)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3694)
at java.util.regex.Pattern$Branch.match(Pattern.java:4502)
...

See this link for an example file that triggers this exception.

http://pastebin.com/5CmM8SY3