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

java.lang.StackOverflowError on JDK 1.6 #9

Open
myabc opened this issue Nov 18, 2013 · 7 comments
Open

java.lang.StackOverflowError on JDK 1.6 #9

myabc opened this issue Nov 18, 2013 · 7 comments

Comments

@myabc
Copy link
Owner

myabc commented Nov 18, 2013

From alex.coles on October 31, 2008 00:26:59

What steps will reproduce the problem? 1. Use SoyLatte JDK
java version "1.6.0_03-p3"
Java(TM) SE Runtime Environment (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00)
Java HotSpot(TM) Server VM (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00, mixed
mode)

  1. Excecute MarkdownJ unit tests using "mvn test" What is the expected output? What do you see instead? MarkdownTestTester fails with the the StackOverflowError. Needs further investigation, but
    looking at stack trace, it looks as though there is some unlimited recursion going on in the RegEx
    engine.

This error is not reproducible using the latest version of the 32-bit JDK 5.0 for Leopard. Please use labels and text to provide additional information.

Attachment: com.petebevin.markdown.test.MarkdownTestTester.txt

Original issue: http://code.google.com/p/markdownj/issues/detail?id=6

@ghost ghost assigned myabc Nov 18, 2013
@myabc
Copy link
Owner Author

myabc commented Nov 18, 2013

From alex.coles on October 30, 2008 16:31:18

Labels: Java-1.6

@myabc
Copy link
Owner Author

myabc commented Nov 18, 2013

From [email protected] on December 28, 2008 01:23:21

Hi Alex,
the same thing (unlimited recursion with RegEx engine, Stack overflow) happens on
windows with SUN 1.6.0_05.b13 Java.
Frank Steimke

@myabc
Copy link
Owner Author

myabc commented Nov 18, 2013

From alex.coles on August 13, 2009 11:36:27

Status: Started
Labels: -Priority-Medium Priority-High Usability

@myabc
Copy link
Owner Author

myabc commented Nov 18, 2013

From [email protected] on September 24, 2009 17:59:41

Hi, I was able to reproduce this issue with different jdk versions, so I don't think that
this is specifically jdk related. My test case involves the rendering of an html table
and I observe that above some number of rows I get the SOE.

The root cause may be with the tokenizeHtml method, which takes this pattern:

Pattern p = Pattern.compile("" +
"(?s:<!(--.?--\s)+>)" +
"|" +
"(?s:<?.*??>)" +
"|" +
nestedTags +
"", Pattern.CASE_INSENSITIVE);

Maybe this triggers this kind of issue: http://bugs.sun.com/bugdatabase/view_bug.do? bug_id=5050507.

Thinking about this implementation of Markdown with regular expressions, I would suggest
using a grammar file and standard parsers like this: http://github.com/jgm/peg-markdown

@myabc
Copy link
Owner Author

myabc commented Nov 18, 2013

From alex.coles on September 27, 2009 03:26:34

Upgrading this to critical.

@etorreborre, thanks for your help reducing this down.
I agree with you about creating anew implementation not based on regular expressions,
and as such, there's a new ticket #16.

Summary: java.lang.StackOverflowError on JDK 1.6
Labels: -Priority-High Priority-Critical

@myabc
Copy link
Owner Author

myabc commented Nov 18, 2013

From pepijndevos on December 15, 2009 09:29:16

Is this issue related to big files or to bad regexes?
I played with a few small files and they worked fine, but one large file did not. It had
no tables in it.
The file I used can be obtained by concatenating all files in the markdown test suit
floating around on the web.

I was comparing Markdown engines for Clojure(a JVM Lisp).
For those who cannot wait until this is fixed:
Showdown running on Rhino runs surprisingly fast! http://briancarper.net/blog/clojure-and-markdown-and-javascript-and-java-and

@andreban
Copy link

Does anybody have a test case or an example where this error happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants