StackOverflowError when exporting large pages to PDF

XMLWordPrintable

    • 21
    • Severity 3 - Minor
    • 13

      Issue Summary

      Exporting large pages to PDF leads to StackOverflowError even after setting high memory for stack size.

      There is no proper pattern as to how large the page should be which will eventually lead to the error when exported to PDF.

      Steps to Reproduce

      1. Increase the stack size to 100 MB (as an example)
        CATALINA_OPTS="-Dconversion.sandbox.stack.limit.megabytes=100 ${CATALINA_OPTS}" 
      1. Create a large page with 1000+ lines (as an example)
      2. Export the page to PDF.

      Expected Results

      • It is expected that the PDF export of the page completes successfully

      Actual Results

      • PDF export leads to error - StackOverflowError
        2024-02-13 10:53:04,164 ERROR [http-nio-8090-exec-3 url: /confluence/500page.jsp; user: admin] [atlassian.confluence.status.SystemErrorInformationLogger] logException Unhandled exception 5e1dd2bf-75a0-4512-8952-c9815ae1d012: Method \"execute\" failed for object com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction@744cb65f
         -- traceId: 0b1b919166770a56
        ognl.MethodFailedException: Method "execute" failed for object com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction@744cb65f [java.lang.StackOverflowError]
        Caused by: java.lang.StackOverflowError
                at java.base/java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1217)
                at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1418)
                at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1169)
                at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1543)
                at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1500)
                at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1423)
                at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1169)
                at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1543) 

      Workaround

      We need to delete the data from the page and then export the page to PDF. As mentioned earlier, there is no fixed pattern of how much data (number of lines) to be retained on the page, we should follow a trial and error approach.

            Assignee:
            Unassigned
            Reporter:
            Ravi Dixit
            Votes:
            15 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated: