-
Notifications
You must be signed in to change notification settings - Fork 417
Closed
Labels
status: completedWork completed, can be closedWork completed, can be closedtype: bugThe issue describes a bugThe issue describes a bug
Milestone
Description
When running epubcheck on an epub with a large opf file (13k+ lines, 841k) it throws the following StackOverflowError. Unfortunately I can't share the epub since it isn't public content.
epubcheck-4.2.6$ java -jar epubcheck.jar foobar.epub
Validating using EPUB version 3.2 rules.
java.lang.StackOverflowError
at java.base/java.util.LinkedList.unlinkFirst(LinkedList.java:178)
at java.base/java.util.LinkedList.poll(LinkedList.java:679)
at com.adobe.epubcheck.opf.XRefChecker.checkReadingOrder(XRefChecker.java:538)
at com.adobe.epubcheck.opf.XRefChecker.checkReadingOrder(XRefChecker.java:599)
at com.adobe.epubcheck.opf.XRefChecker.checkReadingOrder(XRefChecker.java:599)
I've seen that the recommended fix is to increase xss, but is there a way to change epubcheck to not require as much stack size?
This particular opf file has 6000+ <itemref>
elements in the <spine>
, and if I'm reading correctly it looks like these are evaluated using a recursive algorithm.
Question: Would changing the above to use iteration instead of recursion potentially decrease the required stack size?
Metadata
Metadata
Assignees
Labels
status: completedWork completed, can be closedWork completed, can be closedtype: bugThe issue describes a bugThe issue describes a bug