After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778769 - lisbxml crashes on iOS for XML with "comment" element
lisbxml crashes on iOS for XML with "comment" element
Status: RESOLVED DUPLICATE of bug 736077
Product: libxslt
Classification: Platform
Component: general
1.1.29
Other other
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-16 15:30 UTC by MICHEL MOREAU
Modified: 2017-02-16 22:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Stack trace on iOS (12.92 KB, application/zip)
2017-02-16 15:30 UTC, MICHEL MOREAU
Details

Description MICHEL MOREAU 2017-02-16 15:30:35 UTC
Created attachment 345951 [details]
Stack trace on iOS

Hi,

we are building an iOS app (using iOS 10 and Xcode 8.2).
Tis app use XSLT to transform XML file into HTML content. HTML generated content are displayed using UIWebViews .

Everything works fine, even with very large files, but recently we are experiencing a crash, with some XML files. After some research, it appears that the crash happens when
we use a specific markup : <comment><unlist>....</unlist></comment> (see attach file for crash report).
If this section is remove, everything works fine.

Any help on this would be really appreciated.

Regards
Michel

----- 
here is an example of this code :


<?xml version="1.0" encoding="UTF-8"?>
<ecaminopsys layer="1" lid="F.00018546.0011001.031">
   <allphase-sys code="00018546.0011001.023" layer="1" lid="F.00018546.0011001.032">
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.033"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.034"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.035"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.036"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.037"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.038"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.039"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.040"> TEXT </sys>
      <comment code="00018546.0011001.024">
         <unlist bulltype="NDASH" code="00018546.0011001.025" layer="2" lid="F.00018546.0011001.041">
            <para code="00018546.0011001.026" layer="2" lid="F.00018546.0011001.042">
               TEXT
               <tech-label type="pb-sw">LAND RECOVERY</tech-label>
               TEXT
            </para>
            <item layer="2">
               <para code="00018546.0011001.027" layer="2" lid="F.00018546.0011001.043">
                  TEXT
                  <abb>LGCIU</abb>
                  TEXT
                  <abb>TEXT</abb>
                  TEXT
                  <abb> TEXT </abb>
                  TEXT
                  <abb> TEXT </abb>
                  TEXT
                  <abb> TEXT </abb>
                  TEXT
                  <abb> TEXT </abb>
                  TEXT
               </para>
            </item>
            <item layer="2">
               <para code="00018546.0011001.028" layer="2" lid="F.00018546.0011001.044">
                  TEXT                  <measure category="Weight" show-unit="true" system="SI and derived" unit="t">2</measure>
                  TEXT
               </para>
            </item>
            <item layer="2">
               <para code="00018546.0011001.029" layer="2" lid="F.00018546.0011001.045">
                  TEXT
                  <abb> TEXT </abb>
               </para>
            </item>
            <item layer="2">
               <para code="00018546.0011001.030" layer="2" lid="F.00018546.0011001.046">
                  <abb>TEXT</abb>
                  TEXT TEXT
                  <abb> TEXT </abb>
                  TEXT
                  <tech-label type="pb-sw"> TEXT </tech-label>
                  TEXT
               </para>
            </item>
         </unlist>
      </comment>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.047"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.048"> TEXT </sys>
      <sys ecam="true" ecamimportance="A" lid="F.00018546.0011001.049"> TEXT </sys>
   </allphase-sys>
</ecaminopsys>
Comment 1 Nick Wellnhofer 2017-02-16 22:11:28 UTC
The stacktrace is huge, so this is probably a stack overflow caused by a recursive template. Your best option is to replace the recursive template with a non-recursive version or somehow limit the recursion depth. You can also set maxTemplateDepth in xsltTransformContext to a value lower than the default of 3000, and you'll get an error message instead of a crash. In your case, a value of 500 should work.

*** This bug has been marked as a duplicate of bug 736077 ***