<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>50749</bug_id>
          
          <creation_ts>2010-12-09 04:46:42 -0800</creation_ts>
          <short_desc>SVG nested tags recursions cause stack exhaustions</short_desc>
          <delta_ts>2014-12-03 15:27:12 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows Vista</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>63290</dup_id>
          
          <bug_file_loc>http://code.google.com/p/chromium/issues/detail?id=66030</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Berend-Jan Wever">skylined</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>christopher.reiss</cc>
    
    <cc>eric</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>319404</commentid>
    <comment_count>0</comment_count>
      <attachid>76047</attachid>
    <who name="Berend-Jan Wever">skylined</who>
    <bug_when>2010-12-09 04:46:42 -0800</bug_when>
    <thetext>Created attachment 76047
Repro

I could not find an open bug for this issue, even though it has been around for a while.

The following simple repro can be used to check for recursion issues in various tags:
&lt;body&gt;
&lt;script&gt;
  var asTags = [&apos;a&apos;, &apos;altGlyph&apos;, &apos;altGlyphDef&apos;, &apos;altGlyphItem&apos;, &apos;animate&apos;,
    &apos;animateColor&apos;, &apos;animateMotion&apos;, &apos;animateTransform&apos;, &apos;circle&apos;, &apos;clipPath&apos;,
    &apos;color-profile&apos;, &apos;cursor&apos;, &apos;definition-src&apos;, &apos;defs&apos;, &apos;desc&apos;, &apos;ellipse&apos;,
    &apos;feBlend&apos;, &apos;feColorMatrix&apos;, &apos;feComponentTransfer&apos;, &apos;feComposite&apos;,
    &apos;feConvolveMatrix&apos;, &apos;feDiffuseLighting&apos;, &apos;feDisplacementMap&apos;,
    &apos;feDistantLight&apos;, &apos;feFlood&apos;, &apos;feFuncA&apos;, &apos;feFuncB&apos;, &apos;feFuncG&apos;, &apos;feFuncR&apos;,
    &apos;feGaussianBlur&apos;, &apos;feImage&apos;, &apos;feMerge&apos;, &apos;feMergeNode&apos;, &apos;feMorphology&apos;,
    &apos;feOffset&apos;, &apos;fePointLight&apos;, &apos;feSpecularLighting&apos;, &apos;feSpotLight&apos;, &apos;feTile&apos;,
    &apos;feTurbulence&apos;, &apos;filter&apos;, &apos;font&apos;, &apos;font-face&apos;, &apos;font-face-format&apos;,
    &apos;font-face-name&apos;, &apos;font-face-src&apos;, &apos;font-face-uri&apos;, &apos;foreignObject&apos;, &apos;g&apos;,
    &apos;glyph&apos;, &apos;glyphRef&apos;, &apos;hkern&apos;, &apos;image&apos;, &apos;line&apos;, &apos;linearGradient&apos;, &apos;marker&apos;,
    &apos;mask&apos;, &apos;metadata&apos;, &apos;missing-glyph&apos;, &apos;mpath&apos;, &apos;path&apos;, &apos;pattern&apos;, &apos;polygon&apos;,
    &apos;polyline&apos;, &apos;radialGradient&apos;, &apos;rect&apos;, &apos;script&apos;, &apos;set&apos;, &apos;stop&apos;, &apos;style&apos;,
    &apos;svg&apos;, &apos;switch&apos;, &apos;symbol&apos;, &apos;text&apos;, &apos;textPath&apos;, &apos;title&apos;, &apos;tref&apos;, &apos;tspan&apos;,
    &apos;use&apos;, &apos;view&apos;, &apos;vkern&apos;];
  setInterval(function() {
    if (confirm(&apos;Would you like to test &quot;&apos; + asTags[0] + &apos;&quot;...?&apos;)) {
      document.open();
      document.write(&apos;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&apos; + 
          new Array(20000).join(&apos;&lt;&apos; + asTags[0] + &apos;&gt;&apos;));
      document.close();
    }
    asTags.shift();
  }, 1);
&lt;/script&gt;

Here&apos;s a list of the crashes I&apos;ve seen so far:
chrome.dll!WebCore::ContainerNode::willRemove RecursionSOV (d2c46b73f6877654a2020cfd44fc561d)
chrome.dll!WebCore::RenderSVGHiddenContainer::layout+1 RecursionSOV (28afd91631a23d8ec42d3e81959a0578)

My fuzzers also found this one but I cannot reproduce it manually:
chrome.dll!WebCore::RenderSVGModelObject::computeRectForRepaint+1 RecursionSOV (d6b83f31f12c0154765b5a9962f9b8d0)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>332408</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-01-11 09:45:26 -0800</bug_when>
    <thetext>See also: bug 15123.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1052309</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2014-12-03 15:27:12 -0800</bug_when>
    <thetext>Running the test case passes with no crashes. From running it I noticed that processing some of the tags are pretty slow like &lt;svg&gt; for example. But I think these tags should not occur that many in an svg. The slowness should happen because of constructing new heavy objects and because of updating the DOM tree extensively for these tags.

*** This bug has been marked as a duplicate of bug 63290 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>76047</attachid>
            <date>2010-12-09 04:46:42 -0800</date>
            <delta_ts>2010-12-09 04:46:42 -0800</delta_ts>
            <desc>Repro</desc>
            <filename>repro2.html</filename>
            <type>text/html</type>
            <size>813</size>
            <attacher name="Berend-Jan Wever">skylined</attacher>
            
              <data encoding="base64">PGJvZHk+CjxzY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