You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The XML-Pull parser does not handle invalid XML files very well.
The attached file contains incomplete XML data. When running this file through the parser, a lot of 'char's are allocated and not freed anymore until there is no free memory left which leads to an OOM.
The parser works very well with a complete, valid XML file of the same format and data.
You can easily reproduce the exception with the attached files:
Welcome to Scala version 2.9.0.r24458-b20110315020117 (JavaHotSpot(TM) 64-BitServerVM, Java1.6.0_24).
Type in expressions to have them evaluated.
Type:help for more information.
scala>importscala.xml.pull.XMLEventReaderimportscala.xml.pull.XMLEventReader
scala>importscala.io.Sourceimportscala.io.Source
scala>valparser=newXMLEventReader( Source.fromFile("intervals.SRER.xml.defect") )
parser: scala.xml.pull.XMLEventReader= non-empty iterator
scala>while (parser.hasNext) parser.next
Exception in thread "XMLEventReader" java.lang.OutOfMemoryError:Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:572)
at java.lang.StringBuilder.append(StringBuilder.java:203)
at scala.collection.mutable.StringBuilder.append(StringBuilder.scala:252)
at scala.xml.parsing.MarkupParserCommon$$class.xAttributeValue(MarkupParserCommon.scala:66)
at scala.xml.pull.XMLEventReader$$Parser.xAttributeValue(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParserCommon$$class.xAttributeValue(MarkupParserCommon.scala:74)
at scala.xml.pull.XMLEventReader$$Parser.xAttributeValue(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.xAttributes(MarkupParser.scala:294)
at scala.xml.pull.XMLEventReader$$Parser.xAttributes(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.mkAttributes(MarkupParser.scala:261)
at scala.xml.pull.XMLEventReader$$Parser.mkAttributes(XMLEventReader.scala:58)
at scala.xml.pull.XMLEventReader$$Parser.mkAttributes(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParserCommon$$class.xTag(MarkupParserCommon.scala:44)
at scala.xml.pull.XMLEventReader$$Parser.xTag(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.element1(MarkupParser.scala:528)
at scala.xml.pull.XMLEventReader$$Parser.element1(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.content1(MarkupParser.scala:396)
at scala.xml.pull.XMLEventReader$$Parser.content1(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.content(MarkupParser.scala:417)
at scala.xml.pull.XMLEventReader$$Parser.content(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.element1(MarkupParser.scala:542)
at scala.xml.pull.XMLEventReader$$Parser.element1(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.content1(MarkupParser.scala:396)
at scala.xml.pull.XMLEventReader$$Parser.content1(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.content(MarkupParser.scala:417)
at scala.xml.pull.XMLEventReader$$Parser.content(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.element1(MarkupParser.scala:542)
at scala.xml.pull.XMLEventReader$$Parser.element1(XMLEventReader.scala:58)
at scala.xml.parsing.MarkupParser$$class.content1(MarkupParser.scala:396)
at scala.xml.pull.XMLEventReader$$Parser.content1(XMLEventReader.scala:58)
=== Additional information ===
Input file is attached to this ticket as bz2.
=== What versions of the following are you using? ===
Scala: 2.9.0.r24458-b20110315020117
Java: java version "1.6.0_24"
Operating system: Mac OS X 10.6
The text was updated successfully, but these errors were encountered:
The XML-Pull parser does not handle invalid XML files very well.
The attached file contains incomplete XML data. When running this file through the parser, a lot of 'char's are allocated and not freed anymore until there is no free memory left which leads to an OOM.
The parser works very well with a complete, valid XML file of the same format and data.
This might be related to ticket #3840
You can easily reproduce the exception with the attached files:
=== Additional information ===
Input file is attached to this ticket as bz2.
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: