Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-5320

Long string will cause a java.lang.StackOverflowError for files in repository

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 3.7.1, 3.8.0
    • 3.5.1, 3.5.3, 3.5.4, 3.6.1, 3.6.2
    • None

      A very long string inside a file will cause a java.lang.StackOverflowError for files in repository when trying to view the source of this file or trying to add it to a review.

      The following is shown in the logs:

      2014-09-02 17:47:41,707 WARN  [qtp1829860190-171 ] org.eclipse.jetty.servlet.ServletHandler ServletHandler-doHandle - Error for /browse/merc/WFScheduleXMLTest.cs
      java.lang.StackOverflowError
      	at java.util.regex.Pattern$LazyLoop.match(Pattern.java:4730)
      	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4615)
      	at java.util.regex.Pattern$BranchConn.match(Pattern.java:4466)
      	at java.util.regex.Pattern$CharProperty.match(Pattern.java:3694)
      	at java.util.regex.Pattern$Branch.match(Pattern.java:4502)
      	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
      	(...)
      

      Steps to Reproduce

      1. Create a file which highlights a string (in my test I used a .cs file).
      2. Define a long string (e.g. assigning it to a variable).
      3. Save and commit it to the repository.
      4. Have this file indexed by FishEye and try viewing its content.

      The file used to test this is attached (test.cs).

      Workaround

      • Break the long line in smaller lines.

      OR

      • Increase the thread stack size by increasing the -Xss JVM parameter (e.g. "-Xss2m"). This can be set in the FISHEYE_OPTS environment variable (refer to Environment Variables for further information on this). Please notice that increasing the thread stack size will allocate more memory for each thread, so Out of Memory errors may happen after increasing this setting if you do not have enough memory allocated for FishEye.

            [FE-5320] Long string will cause a java.lang.StackOverflowError for files in repository

            We are currently on an older version,
            "You are running release CR3.5.2 FE3.5.2 (20140806120101 2014-08-06), please report your release number when reporting bugs."
            and the new version is on the way, but not in place yet.

            I was seeing this on a single line that was 1389 chars long.
            Is there a specific line length I can search for (under the default configuration) while I wait for the new version to arrive?

            Deleted Account (Inactive) added a comment - We are currently on an older version, "You are running release CR3.5.2 FE3.5.2 (20140806120101 2014-08-06), please report your release number when reporting bugs." and the new version is on the way, but not in place yet. I was seeing this on a single line that was 1389 chars long. Is there a specific line length I can search for (under the default configuration) while I wait for the new version to arrive?

            Seeing this with native repo in crucible 3.6.1

            Dennis Jakobsen added a comment - Seeing this with native repo in crucible 3.6.1

            Hi mmielke1,

            Thanks for your suggestion, I tested this locally and for the file I used to test -Xss2m helped opening the file. I added this as a workaround, but please check on the note I added: this option must be set carefully, as it can lead to Out of Memory errors with more memory being allocated per thread.

            Gustavo Refosco (Inactive) added a comment - Hi mmielke1 , Thanks for your suggestion, I tested this locally and for the file I used to test -Xss2m helped opening the file. I added this as a workaround, but please check on the note I added: this option must be set carefully, as it can lead to Out of Memory errors with more memory being allocated per thread.

            Additionally, my issue (above) was with Crucible 3.6.1 and attached files. So, I don't think git/svn/hg has anything to do with it...

            Mark Mielke added a comment - Additionally, my issue (above) was with Crucible 3.6.1 and attached files. So, I don't think git/svn/hg has anything to do with it...

            I see a similar stack trace with another Perl script. I was able to get the file from 5000+ lines down to about 300 lines and still reproduce the problem, but managed to lose it. I raised the thread stack size from the default of -Xss1m to -Xss4m and this particular problems seems to be resolved. I suspect this means that a regular expression being used is performing excessive recursion and back tracking.

            Here is the stack I was seeing:

            2014-12-01 03:03:18,854 ERROR - Exception "javax.el.ELException: java.lang.StackOverflowError" (javax.servlet.ServletException) while processing "/json/cru/...-16066/loadFrxAjax" (Referer:"https://.../cru/...-16066")
            javax.servlet.ServletException: javax.el.ELException: java.lang.StackOverflowError
                    at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:285)
                    at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:111)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
                    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
            ...
            Caused by: javax.el.ELException: java.lang.StackOverflowError
                    at javax.el.BeanELResolver.getValue(BeanELResolver.java:310)
                    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188)
                    at com.sun.el.parser.AstValue.getValue(AstValue.java:120)
                    at com.sun.el.parser.AstValue.getValue(AstValue.java:167)
                    at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)
                    at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1009)
                    at org.apache.jsp.WEB_002dINF.jsp.crucible.review.monolithic.displayFrxInnerDiv_jsp._jspx_meth_rev_diffOptionsFormAjax_0(displayFrxInnerDiv_jsp.java:304)
                    at org.apache.jsp.WEB_002dINF.jsp.crucible.review.monolithic.displayFrxInnerDiv_jsp._jspx_meth_cru_asJavascriptString_2(displayFrxInnerDiv_jsp.java:274)
                    at org.apache.jsp.WEB_002dINF.jsp.crucible.review.monolithic.displayFrxInnerDiv_jsp._jspService(displayFrxInnerDiv_jsp.java:110)
                    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
            ...
            Caused by: java.lang.StackOverflowError
                    at java.util.regex.Pattern$Slice.match(Pattern.java:3969)
                    at java.util.regex.Pattern$Branch.match(Pattern.java:4604)
                    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
                    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
                    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
                    at java.util.regex.Pattern$BranchConn.match(Pattern.java:4568)
                    at java.util.regex.Pattern$CharProperty.match(Pattern.java:3777)
                    at java.util.regex.Pattern$Branch.match(Pattern.java:4604)
                    at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
                    at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
                    at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
                    at java.util.regex.Pattern$BranchConn.match(Pattern.java:4568)
                    at java.util.regex.Pattern$CharProperty.match(Pattern.java:3777)
            ...
            

            Mark Mielke added a comment - I see a similar stack trace with another Perl script. I was able to get the file from 5000+ lines down to about 300 lines and still reproduce the problem, but managed to lose it. I raised the thread stack size from the default of -Xss1m to -Xss4m and this particular problems seems to be resolved. I suspect this means that a regular expression being used is performing excessive recursion and back tracking. Here is the stack I was seeing: 2014-12-01 03:03:18,854 ERROR - Exception "javax.el.ELException: java.lang.StackOverflowError" (javax.servlet.ServletException) while processing "/json/cru/...-16066/loadFrxAjax" (Referer:"https://.../cru/...-16066") javax.servlet.ServletException: javax.el.ELException: java.lang.StackOverflowError at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:285) at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669) ... Caused by: javax.el.ELException: java.lang.StackOverflowError at javax.el.BeanELResolver.getValue(BeanELResolver.java:310) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188) at com.sun.el.parser.AstValue.getValue(AstValue.java:120) at com.sun.el.parser.AstValue.getValue(AstValue.java:167) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224) at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1009) at org.apache.jsp.WEB_002dINF.jsp.crucible.review.monolithic.displayFrxInnerDiv_jsp._jspx_meth_rev_diffOptionsFormAjax_0(displayFrxInnerDiv_jsp.java:304) at org.apache.jsp.WEB_002dINF.jsp.crucible.review.monolithic.displayFrxInnerDiv_jsp._jspx_meth_cru_asJavascriptString_2(displayFrxInnerDiv_jsp.java:274) at org.apache.jsp.WEB_002dINF.jsp.crucible.review.monolithic.displayFrxInnerDiv_jsp._jspService(displayFrxInnerDiv_jsp.java:110) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) ... Caused by: java.lang.StackOverflowError at java.util.regex.Pattern$Slice.match(Pattern.java:3969) at java.util.regex.Pattern$Branch.match(Pattern.java:4604) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658) at java.util.regex.Pattern$Loop.match(Pattern.java:4785) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717) at java.util.regex.Pattern$BranchConn.match(Pattern.java:4568) at java.util.regex.Pattern$CharProperty.match(Pattern.java:3777) at java.util.regex.Pattern$Branch.match(Pattern.java:4604) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658) at java.util.regex.Pattern$Loop.match(Pattern.java:4785) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717) at java.util.regex.Pattern$BranchConn.match(Pattern.java:4568) at java.util.regex.Pattern$CharProperty.match(Pattern.java:3777) ...

            Pulasthi added a comment -

            This happens with Subversion as well.

            Pulasthi added a comment - This happens with Subversion as well.

              glewandowski Grzegorz Lewandowski
              grefosco Gustavo Refosco (Inactive)
              Affected customers:
              5 This affects my team
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: