Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OOM for ConstructingParser #209

Merged
merged 4 commits into from
Jun 26, 2018
Merged

Fix OOM for ConstructingParser #209

merged 4 commits into from
Jun 26, 2018

Conversation

ashawley
Copy link
Member

This tries to fix the long-standing defects in ConstructingParser that were shown to cause out of memory exceptions. The original tests contributed by Artem Stasiuk in #32 presumed fixing the methods would make them throw exceptions. I made a more minimal fix: I followed the suggestions of A.P. Marki that not every syntax error is fatal, and that it is better to address the infinite loops in various method than actually terminate processing with an exception. Admittedly, this code is pretty inconsistent with respect to termination. I suggest we take that on later.

To be honest, making further improvements would have consequences in the behavior of XMLEventReader. I decided to not go there. There is a plan to drop XMLEventReader in #200. Given, my most recent experience here, I'd say that's still a good idea.

Shorten test names and minimize string literals.
Add eof checks to:

- MarkupParser.xEntityValue
- MarkupParser.xComment
- MarkupParser.systemLiteral
- MarkupParser.pubidLiteral
- MarkupParser.notationDecl
- MarkupParserCommon.xAttributeValue
- MarkupParserCommon.xTakeUntil
@ashawley ashawley merged commit db03589 into scala:master Jun 26, 2018
@ashawley ashawley deleted the issue-4520 branch June 26, 2018 12:50
@ashawley ashawley mentioned this pull request Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants