Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-54754

Page with excessive nested span tags causes Synchrony to stop working

XMLWordPrintable

      The fix for this bug has been released to our Long Term Support release.

      The fix for this bug is now available in the latest release of Confluence 7.19

      Note

      Additional notes about this fix can be found here.

      Summary

      There are some conditions where Confluence does not flatten html (specifically <span></span>) tags allowing multiple nested tags to be created that results in a stack overflow in the collaborative editor when parsing the page.

      This behaviour can also cause the browser to crash for the same reason if Synchrony manages to parse the tags and return the page to the browser. Editing can also be slow or unresponsive in different ways, such as when pasting additional content.

      Expected Results

      Confluence should not allow nested tags sufficient to cause a stack overflow when editing a page.

      Actual Results

      Confluence allows sufficient nested tags to caused Synchrony to stack overflow and the thread to crash, or the browser to crash.

      This Synchrony crash presents with the following errors

      The following errors thrown in the atlassian-synchrony.log file:

      Synchrony Error
      {"synchrony":{"client":{"xj":"LTGdPBRd8dBKsBjD26IxbH0","Tj":"Maximum call stack size exceeded\nRangeError: Maximum call stack size exceeded\n    at xC (eval at <anonymous> (<ConfluenceBaseURL>/s/202a4eb254bd334279a734425f2367bc-CDN/en_GB/7111/583f3f4010922d699723a091097524472954c767/e860d0fc70e2f6d6e8992c9ce453f407/_/download/contextbatch/js/_super/batch.js?locale=en-GB:188:128), <anonymous>:875:12)\n    at Function.DC.j (eval at <anonymous> (<ConfluenceBaseURL>/s/202a4eb254bd334279a734425f2367bc-
      ...
      CDN/en_GB/7111/583f3f4010922d699723a091097524472954c767/e860d0fc70e2f6d6e8992c9ce453f407/_/download/contextbatch/js/_super/batch.js?locale=en-GB:188:128), <anonymous>:980:296)"},"entity":"/Synchrony-b495020f-be6e-32c1-97aa-722a3a3b3328/confluence-220529801","message":"synchrony.http [error] Maximum call stack size exceeded","source":"client","throwable":null,"ns":"synchrony.http","level":"error"},"message":"synchrony.http [error] Maximum call stack size exceeded"}
      

      Checking the page storage format, multiple nested tags exist with an excessive stack depth

      Storage Format
      <p><span style="color: rgb(0,0,0);"><strong><span><strong><span><strong><span><strong><span style="color: rgb(255,102,0);"><span style="color: rgb(0,51,102);" lang="ko"><span lang="ko"><strong><span style="color: rgb(255,102,0);"><span style="color: rgb(0,51,102);" lang="ko"><span style="color: rgb(255,102,0);"><span style="color: rgb(0,51,102);" lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span style="color: rgb(255,102,0);"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span style="color: rgb(0,51,102);" lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><strong><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko">ㅇ사전</span></span><span lang="ko"><span lang="ko">&nbsp;검토 : 미진행<span style="color: rgb(255,102,0);" lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><strong><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko"><span lang="ko">&nbsp;</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></strong></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></strong></span></span></span></strong></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></strong></span></strong></span></span></strong></span></span></strong></span></span></strong></span></span></span></span></strong></span></span></strong></span></span></strong></span></span></strong></span></span></span></strong></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></strong></span></strong></span></span></strong></span></span></strong></span></span></strong></span></span></span></span></strong></span></span></strong></span></span></strong></span></span></strong></span></span></span></strong></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></strong></span></strong></span></span></strong></span></span></strong></span></span></strong></span></span></span></span></strong></span></span></strong></span></span></strong></span></span></strong></span></span></span></strong></span></span></strong></span></span></strong></span></span></span></strong></span></span></strong></span></span></strong></span></span></span></strong></span></span></strong></span></span></strong></span></span></span></span></span></span></strong></span></span></span></strong></span></strong></span></strong></span></strong></span></p>
      

      Workaround

      1. Install Confluence Source Code Editor
      2. Edit the page, then click the Source Editor icon to edit the page source
      3. Search for the stack of nested tags
      4. Once identified, remove all nested <span></span> tags between the <p> and </p> tags
      5. Save Page

      Alternately, the remove formatting editor option can be used to strip out all the formatting including these span tags.
      If the issue persists even after upgrading to the fixed version, please follow the above steps.

      Notes

      The excessive nested tags is caused by maintaining the formatting on a given page in a paragraph or table, and adding new content that also contains formatting data.

      For instance

      1. Create a table with 2 rows
      2. Fill out content in both rows
      3. In the second row, add formatting like colours, new fonts, bolding etc
      4. Insert a new row below row 2
        • Span tags from the source row will be continued into the new row
      5. Copy and paste the cells from the source row (2) into the destination row (3)
        • Span tags are inserted from the clipboard inside the existing span tags
      6. Repeat steps 4 and 5 until Synchrony stops responding (6-7 times on average)
      How to identify possibly affected pages

      Run the following SQL query to identify possibly affected pages:

      SQL Query
      SELECT c.contentid, c.title, c.version, c.spaceid, s.spacekey
      FROM content c
      JOIN bodycontent bc ON c.contentid = bc.contentid
      JOIN spaces s ON s.spaceid = c.spaceid
      WHERE
      bc.body LIKE '%</span></span></span></span></span></span></span></span></span></span>%'
      AND c.prevver is null
      ;
      

              glipatov George Lipatov
              kng Kenny Ng (Inactive)
              Votes:
              43 Vote for this issue
              Watchers:
              134 Start watching this issue

                Created:
                Updated:
                Resolved: