RichTextFX icon indicating copy to clipboard operation
RichTextFX copied to clipboard

Stack overflow with certain XML files in XMLEditor demo

Open dawon opened this issue 11 years ago • 10 comments

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

dawon avatar Aug 18 '15 10:08 dawon

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.

cemartins avatar Aug 18 '15 11:08 cemartins

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

dawon avatar Aug 18 '15 11:08 dawon

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

cemartins avatar Aug 18 '15 11:08 cemartins

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

dawon avatar Aug 18 '15 11:08 dawon

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.

TomasMikula avatar Aug 18 '15 15:08 TomasMikula

Cool.

cemartins avatar Aug 18 '15 15:08 cemartins

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

dawon avatar Aug 18 '15 15:08 dawon

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 [email protected] 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 avatar Aug 18 '15 15:08 TomasMikula

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

TomasMikula avatar Aug 18 '15 20:08 TomasMikula

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

dawon avatar Aug 19 '15 07:08 dawon