FXMisc / RichTextFX

Rich-text area for JavaFX
BSD 2-Clause "Simplified" License
1.21k stars 236 forks source link

Stack overflow with certain XML files in XMLEditor demo #167

Closed dawon closed 9 years ago

dawon commented 9 years ago

Hello,

i am working on XML editor with syntax highlighting using RichTextFX. Everything was running smoothly until I started using large XML files. Then my applicatioon and even XML Editor demo started crashing on StackOverFlow exception:

Executing xxx.jar using platform C:\Program Files\Java\jdk1.8.0_51\jre/bin/java
Exception in thread "JavaFX Application Thread" java.lang.StackOverflowError
    at org.reactfx.util.ListsHelper$ConcatListView.size(Lists.java:250)
    at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030)
    at org.reactfx.util.ListsHelper$ConcatListView.size(Lists.java:250)
    at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030)
    at org.reactfx.util.ListsHelper$ConcatListView.size(Lists.java:250)
    at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030)
    at org.reactfx.util.ListsHelper$ConcatListView.size(Lists.java:250)
    at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030)
    at org.reactfx.util.ListsHelper$ConcatListView.size(Lists.java:250)
    at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030)
    at org.reactfx.util.ListsHelper$ConcatListView.size(Lists.java:250)
    at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030)
    at org.reactfx.util.ListsHelper$ConcatListView.size(Lists.java:250)
    at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030)
(etc...)

What is weird: program is working for 15 MB of XML data and it crashes for 2 MB of XML data. I did not spotted any bigger differences in file's structure.

It is working for this data: http://dawon.cz/test1.xml and not working for this: http://dawon.cz/test2.xml

Can you please look into this issue?

Thank you very much

Jakub

cemartins commented 9 years ago

I suspect this is related to the regex expressions for parsing. I can run it through the debugger later on after work to try and find the fault.

dawon commented 9 years ago

Well when I debugged it, it seemed to crash after all regexps were done. But I can be wrong...

cemartins commented 9 years ago

Can you get a StackTrace that includes some instruction before the loop?

dawon commented 9 years ago

Unfortunately no. It continues this way all the way down.

TomasMikula commented 9 years ago

This looks like a bug in ReactFX that I resolved months ago, but somehow I never made a release with that fix. I will fix it soon.

cemartins commented 9 years ago

Cool.

dawon commented 9 years ago

Well I am using RichTextFX "fat" jar, so it is possible, that the new release is not in that jar...

TomasMikula commented 9 years ago

I never even released ReactFX with that fix, so it can't possibly be fixed in RichTextFX.

On Tue, Aug 18, 2015 at 11:47 AM, Jakub Žáček notifications@github.com wrote:

Well I am using RichTextFX "fat" jar, so it is possible, that the new release is not in that jar...

— Reply to this email directly or view it on GitHub https://github.com/TomasMikula/RichTextFX/issues/167#issuecomment-132255494 .

TomasMikula commented 9 years ago

Please try the new version 0.6.6 and confirm that it is resolved. Thanks.

dawon commented 9 years ago

It works well now, thank you very much for such a fast resolution and keep up the good work!