-
Notifications
You must be signed in to change notification settings - Fork 49
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
StackOverflowError using 3.0 #74
Comments
I may take a look. Would you send the relevant HTML to [email protected] ? Thanks! |
Thanks, i have sent the file. |
From your e-mail:
This seems to me like you are trying to parse a HTML document with a CSS parser. You need to parse the HTML file to a DOM first and then to call |
I am sorry, that is the wrong code indeed.
super.document is the org.w3c.dom.Document representation of the file i sent you. All other 800+ tests run fine though. |
I used the DOMSource for obtaining the DOM but I am not able to reproduce the error. I obtain the style map correctly. How do you obtain the DOM? Are you able to do some more debugging? E.g. obtaining the argument values of the |
Hello, I use a very simple SAX ContentHandler to build a DOM structure but i could try a SAX parser to do it for me if it isn't too much of a performance drag. Of what split() call are you referring to? I don't explicitly execute a split() call myself. Thanks! |
I mean the fourth line in the stack trace. It seems that the stack overflow occurs during the String |
The __randomizedtesting just wraps around our tests and randomizes some settings, it does not affect this test. Early next week i'll compile the sources and report back what is passed to the split() command. Thanks! |
Hello, i added some logging just before the split, just System.out.println(classNames); It turns out it tries to split() over 3390 times! I think the parsers ends up in an endless recursion. The classNames below are a set that is repeated 200 times before the Exception occurs. right |
We're integrating jStyleParser and when running hundreds of HTML parse tests, i get a StackOverflowError exception when analyzing a specific stylesheet. I have the HTML but i cannot attach it to this issue so i can send it upon request.
Stack trace:
java.lang.StackOverflowError at __randomizedtesting.SeedInfo.seed([CDDE6B651FEC8B45:8F931EECCE17E8E5]:0) at java.lang.String.indexOf(String.java:1503) at java.lang.String.split(String.java:2338) at java.lang.String.split(String.java:2422) at cz.vutbr.web.csskit.ElementMatcherSafeCS.elementClasses(ElementMatcherSafeCS.java:46) at cz.vutbr.web.domassign.Analyzer.assignDeclarationsToElement(Analyzer.java:256) at cz.vutbr.web.domassign.Analyzer$2.processNode(Analyzer.java:214) at cz.vutbr.web.domassign.Analyzer$2.processNode(Analyzer.java:211) at cz.vutbr.web.domassign.Traversal.levelTraversal(Traversal.java:53) at cz.vutbr.web.domassign.Traversal.levelTraversal(Traversal.java:58) at cz.vutbr.web.domassign.Traversal.levelTraversal(Traversal.java:58) .....
I narrowed it down to two stylesheets on the specific page, but when loading those stylesheets in other HTML pages, the error didn't show up.
The text was updated successfully, but these errors were encountered: