-
Notifications
You must be signed in to change notification settings - Fork 17
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
knockoff
method throws StackOverflowError
#35
Comments
I haven't done anything in Scala in a while, so I'm not sure. I'll check it out when I have some free time. The expression that's failing is
This is a basic search for HTML tags. I may have to sanitize that tag name, is there any kind of interesting HTML in the document you're trying to parse? |
I'm one of @ardok 's colleagues. We ran JProfiler against this section of code. Just to show you: http://i.imgur.com/bv63l36.png That CPU time tree is from 3-4 minutes of execution time, most of which were spent compiling a markdown file we have. The tree extends quite far beyond what is shown here. |
I just updated the 2.10 build to 2.10.2, it doesn't really seem that it's build related at all, which makes sense. How are HTML tags being used? Is there any stretch of code that appears like an HTML tag? Like |
I don't think there is any. |
FYI, this is what we're currently using: https://github.com/ardok/knockoff/tree/non-recursive I reverted your master branch to this commit: 74bfe4b (before you add |
Thanks! What I really use is a reproduction case, I'm still not able to actually -Tristan On Mon, Sep 9, 2013 at 1:42 PM, Ardo [email protected] wrote:
|
Give this a shot with your |
i just had the same issue on a fresh install of a scala play app on a ubuntu 32 bit VM. the exact same install on a 64 bit VM works fine - can't explain it, but it must be due to some environment issues. the content it tries to parse has a few html tags, yes... without the tags it works fine every time. i'm using 0.8.1 |
The one that works fine for me is this from this commit (dated July 22, 2012): 74bfe4b I forked from that commit and update it to use scala 2.10.2. If you're gonna use my forked repo, just remember to change the version in |
I'm using Scala 2.10.2, hence using 0.8.1 version.
Calling
knockoff
method keeps throwing me this:java.lang.StackOverflowError: null
at java.util.regex.Pattern.group0(Pattern.java:2513) ~[na:1.6.0_26]
at java.util.regex.Pattern.sequence(Pattern.java:1806) ~[na:1.6.0_26]
at java.util.regex.Pattern.expr(Pattern.java:1752) ~[na:1.6.0_26]
at java.util.regex.Pattern.compile(Pattern.java:1460) ~[na:1.6.0_26]
at java.util.regex.Pattern.(Pattern.java:1133) ~[na:1.6.0_26]
at java.util.regex.Pattern.compile(Pattern.java:823) ~[na:1.6.0_26]
at scala.util.matching.Regex.(Regex.scala:153) ~[scala-library-2.10.2.jar:na]
at scala.collection.immutable.StringLike$class.r(StringLike.scala:224) ~[scala-library-2.10.2.jar:na]
at scala.collection.immutable.StringOps.r(StringOps.scala:31) ~[scala-library-2.10.2.jar:na]
at scala.collection.immutable.StringLike$class.r(StringLike.scala:213) ~[scala-library-2.10.2.jar:na]
at scala.collection.immutable.StringOps.r(StringOps.scala:31) ~[scala-library-2.10.2.jar:na]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:261) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270) ~[knockoff_2.10-0.8.1.jar:0.8.1]
Any idea?
Oh and just to add more info, using the version for Scala 2.9 works just fine.
UPDATE 08/29/13 10:06 : will try increasing stack size and cross my fingers
The text was updated successfully, but these errors were encountered: