<?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>44153</bug_id>
          
          <creation_ts>2010-08-17 22:47:06 -0700</creation_ts>
          <short_desc>Null dereference in DOMSelection::deleteFromDocument</short_desc>
          <delta_ts>2012-04-26 12:47:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>42959</blocked>
    
    <blocked>84991</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Barth">abarth</reporter>
          <assigned_to name="Adam Barth">abarth</assigned_to>
          <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>enrica</cc>
    
    <cc>eric</cc>
    
    <cc>kojii</cc>
    
    <cc>rniwa</cc>
    
    <cc>skylined</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>265954</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-17 22:47:06 -0700</bug_when>
    <thetext>Null dereference in DOMSelection::deleteFromDocument</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>265956</commentid>
    <comment_count>1</comment_count>
      <attachid>64671</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-17 22:49:35 -0700</bug_when>
    <thetext>Created attachment 64671
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>265976</commentid>
    <comment_count>2</comment_count>
      <attachid>64671</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-08-18 00:38:22 -0700</bug_when>
    <thetext>Comment on attachment 64671
Patch

Clearing flags on attachment: 64671

Committed r65587: &lt;http://trac.webkit.org/changeset/65587&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>265977</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-08-18 00:38:26 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>266247</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-08-18 10:55:17 -0700</bug_when>
    <thetext>It&apos;s unfortunate we are landing this without a test case. I have run into similar circumstances many times before with fuzzers, crashes I understood fully but could not reproduce with a test case, and in the past I have typically struggled to make a test case for a day or two before landing without a test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>266326</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-18 12:56:42 -0700</bug_when>
    <thetext>We can revert the change if you like.  I have very little understanding of layout or editing.  I suspect that someone who understands these areas might be able to create a test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>266363</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-08-18 14:05:56 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; We can revert the change if you like. I have very little understanding of layout or editing. I suspect that someone who understands these areas might be able to create a test case.

I don’t have a specific strategy to suggest to make sure a test case gets created. I don’t care who creates it. I would like to see someone add it to WebKit, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>266390</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-18 14:46:38 -0700</bug_when>
    <thetext>Reopened for the test.

@enrica: any thoughts on who might understand this code well enough to write a test for this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>267060</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-08-19 16:50:53 -0700</bug_when>
    <thetext>Adam, do you have a stack trace from this preserved somewhere?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>267064</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-19 16:53:34 -0700</bug_when>
    <thetext>I didn&apos;t save the stack.  It was pretty boring.  This method is callable directly from JavaScript.  The trick is to get the DOM / render tree set up in such a way that updateLayout() makes the current selection disappear.  There&apos;s likely to be some trick to get that it happen, but I don&apos;t know enough about layout or selections to know how to set that up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>267066</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-08-19 16:55:24 -0700</bug_when>
    <thetext>I don&apos;t know a lot about it either, but my guess is that one adds display:none to a style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>267940</commentid>
    <comment_count>11</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-08-23 09:09:43 -0700</bug_when>
    <thetext>One possible way to test this is:
1. create a selection
2. execCommand(&apos;indent&apos;). This will move the selection under a block by cloning the selection under the new block and deleting the original one
3. call deleteFromDocument on the original selection</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>270595</commentid>
    <comment_count>12</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-27 11:04:38 -0700</bug_when>
    <thetext>That doesn&apos;t seem to work.  We need to make this condition true and have layout() blow away the selection.

    if (v &amp;&amp; renderer() &amp;&amp; (v-&gt;layoutPending() || renderer()-&gt;needsLayout()))
        v-&gt;layout();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>270596</commentid>
    <comment_count>13</comment_count>
      <attachid>65734</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-27 11:05:21 -0700</bug_when>
    <thetext>Created attachment 65734
Failed attempt at a test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>283938</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-09-23 14:13:57 -0700</bug_when>
    <thetext>I got this crash once, and added debug output to DOMSelection::deleteFromDocument(). If I hit this again, it will be easy to construct a test case. But it&apos;s quite rare.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>286412</commentid>
    <comment_count>15</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-09-28 11:47:44 -0700</bug_when>
    <thetext>I&apos;m not sure this should be open any longer.  Our window for creating a test is gone.  Either this should be reverted or closed it seems.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>286419</commentid>
    <comment_count>16</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-09-28 11:53:23 -0700</bug_when>
    <thetext>Sad. Unfortunately, I never got this crash for the second time - but considering how easy it was to dump current selection state before it was lost for someone who could reproduce this, it&apos;s really wrong to not have a regression test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>286522</commentid>
    <comment_count>17</comment_count>
      <attachid>69103</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-09-28 14:14:41 -0700</bug_when>
    <thetext>Created attachment 69103
failed attempt, hits other crashes

This is a hard one to reproduce.  I hit all sorts of other crashes before getting to this one.  Try replacing &apos;bold&apos; by &apos;indent&apos;, &apos;insertorderedlist&apos;, etc...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>286532</commentid>
    <comment_count>18</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-09-28 14:26:37 -0700</bug_when>
    <thetext>(In reply to comment #17)
&gt; Created an attachment (id=69103) [details]
&gt; failed attempt, hits other crashes
&gt; 
&gt; This is a hard one to reproduce.  I hit all sorts of other crashes before getting to this one.  Try replacing &apos;bold&apos; by &apos;indent&apos;, &apos;insertorderedlist&apos;, etc...

Please file bugs about the other crashes! :)  Those should be fixed too...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>286542</commentid>
    <comment_count>19</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-09-28 14:42:41 -0700</bug_when>
    <thetext>(In reply to comment #18)
&gt; (In reply to comment #17)
&gt; &gt; Created an attachment (id=69103) [details] [details]
&gt; &gt; failed attempt, hits other crashes
&gt; &gt; 
&gt; &gt; This is a hard one to reproduce.  I hit all sorts of other crashes before getting to this one.  Try replacing &apos;bold&apos; by &apos;indent&apos;, &apos;insertorderedlist&apos;, etc...
&gt; 
&gt; Please file bugs about the other crashes! :)  Those should be fixed too...

Sure I can file bugs.  But the real issue with these kind of crashes is our making a lot of assumptions after calling functions that modify DOM such as appendChild.  We ultimately need to make DOM mutation events asynchronous and don&apos;t fire it until we get out of composite editing commands.  Because it&apos;s really hard (or possibly impossible) for us to handle all possible modifications script can make at every stage of editing code.  I&apos;m hoping to send out a proposal about this in a week or two.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610665</commentid>
    <comment_count>20</comment_count>
    <who name="Koji Ishii">kojii</who>
    <bug_when>2012-04-26 09:02:22 -0700</bug_when>
    <thetext>In case you&apos;re still looking for a test case, I happened to come to this bug from bug 42844 and it looks like it has a reproducible script attached.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610825</commentid>
    <comment_count>21</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-04-26 12:32:54 -0700</bug_when>
    <thetext>*** Bug 42844 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610828</commentid>
    <comment_count>22</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-04-26 12:34:30 -0700</bug_when>
    <thetext>Let&apos;s add a test for this.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>64671</attachid>
            <date>2010-08-17 22:49:35 -0700</date>
            <delta_ts>2010-08-18 00:38:22 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-44153-20100817224933.patch</filename>
            <type>text/plain</type>
            <size>1721</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
ODc2ZDFlNTQwNTI0OGM2NTFkYjllNTM0Nzc4MDFjZjE5NTI3NDk5My4uNTVmZDI2MzVkY2I4NDg0
ZTU3NjM5ZWY3MDY1MDViYzQ3MGFlNzhmMSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cK
KysrIGIvV2ViQ29yZS9DaGFuZ2VMb2cKQEAgLTIsNiArMiwyMyBAQAogCiAgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgogCisgICAgICAgIE51bGwgZGVyZWZlcmVuY2UgaW4gRE9N
U2VsZWN0aW9uOjpkZWxldGVGcm9tRG9jdW1lbnQKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtp
dC5vcmcvc2hvd19idWcuY2dpP2lkPTQ0MTUzCisKKyAgICAgICAgZGVsZXRlRnJvbURvY3VtZW50
IGNoZWNrcyBzZWxlY3Rpb24tPmlzTm9uZSgpIGJlZm9yZSBjYWxsaW5nCisgICAgICAgIHNlbGVj
dGlvbi0+c2VsZWN0aW9uKCkudG9Ob3JtYWxpemVkUmFuZ2UoKSwgYnV0IHRvTm9ybWFsaXplZFJh
bmdlKCkKKyAgICAgICAgbm90ZXMgdGhhdCBpdCBuZWVkcyB0byB1cGRhdGVMYXlvdXQoKSwgd2hp
Y2ggY2FuIG1ha2UgdGhlIHNlbGVjdGlvbgorICAgICAgICBpc05vbmUoKSBhZ2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AgICBzZWxlY3Rpb24tPm1vZGlm
eShTZWxlY3Rpb25Db250cm9sbGVyOjpBbHRlcmF0aW9uRXh0ZW5kLCBTZWxlY3Rpb25Db250cm9s
bGVyOjpEaXJlY3Rpb25CYWNrd2FyZCwgQ2hhcmFjdGVyR3JhbnVsYXJpdHkpOwogCiAgICAgUmVm
UHRyPFJhbmdlPiBzZWxlY3RlZFJhbmdlID0gc2VsZWN0aW9uLT5zZWxlY3Rpb24oKS50b05vcm1h
bGl6ZWRSYW5nZSgpOworICAgIGlmICghc2VsZWN0ZWRSYW5nZSkKKyAgICAgICAgcmV0dXJuOwog
CiAgICAgRXhjZXB0aW9uQ29kZSBlYyA9IDA7CiAgICAgc2VsZWN0ZWRSYW5nZS0+ZGVsZXRlQ29u
dGVudHMoZWMpOwo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>65734</attachid>
            <date>2010-08-27 11:05:21 -0700</date>
            <delta_ts>2010-08-27 11:05:21 -0700</delta_ts>
            <desc>Failed attempt at a test</desc>
            <filename>deleteFromDocument-crash.html</filename>
            <type>text/html</type>
            <size>630</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5Pgo8ZGl2IGlkPSJ0ZXN0Ij5mb29iYXJiYXo8L2Rpdj4KPGRpdiBpZD0iY29u
c29sZSI+PC9kaXY+CjxzY3JpcHQ+CmlmICh3aW5kb3cubGF5b3V0VGVzdENvbnRyb2xsZXIpCiAg
ICBsYXlvdXRUZXN0Q29udHJvbGxlci5kdW1wQXNUZXh0KCk7Cgp2YXIgciA9IGRvY3VtZW50LmNy
ZWF0ZVJhbmdlKCk7CnZhciBzID0gd2luZG93LmdldFNlbGVjdGlvbigpOwp2YXIgdGVzdERpdiA9
IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJ0ZXN0Iik7CgpmdW5jdGlvbiBsb2coc3RyKSB7CiAg
ICB2YXIgbGkgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJsaSIpOwogICAgbGkuYXBwZW5kQ2hp
bGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoc3RyKSk7CiAgICBkb2N1bWVudC5nZXRFbGVtZW50
QnlJZCgiY29uc29sZSIpLmFwcGVuZENoaWxkKGxpKTsKfQoKdmFyIHIgPSBkb2N1bWVudC5jcmVh
dGVSYW5nZSgpOwpyLnNldFN0YXJ0KHRlc3REaXYuZmlyc3RDaGlsZCwgMSk7CnIuc2V0RW5kKHRl
c3REaXYuZmlyc3RDaGlsZCwgMyk7CnMuYWRkUmFuZ2Uocik7CmRvY3VtZW50LmV4ZWNDb21tYW5k
KCdpbmRlbnQnKQpzLmRlbGV0ZUZyb21Eb2N1bWVudCgpCjwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRt
bD4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>69103</attachid>
            <date>2010-09-28 14:14:41 -0700</date>
            <delta_ts>2010-09-28 14:14:41 -0700</delta_ts>
            <desc>failed attempt, hits other crashes</desc>
            <filename>selection-crash.html</filename>
            <type>text/html</type>
            <size>536</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PGh0bWw+CjxkaXYgaWQ9InRlc3QiIGNvbnRlbnRlZGl0YWJsZT5oZWxsbyB3b3JsZDwvZGl2Pgo8
c2NyaXB0PgoKdmFyIHRlc3QgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgndGVzdCcpOwp3aW5k
b3cuZ2V0U2VsZWN0aW9uKCkuc2V0UG9zaXRpb24odGVzdCwgMCk7CndpbmRvdy5nZXRTZWxlY3Rp
b24oKS5tb2RpZnkoJ21vdmUnLCAnZm9yd2FyZCcsICdjaGFyYWN0ZXInKTsKd2luZG93LmdldFNl
bGVjdGlvbigpLm1vZGlmeSgnZXh0ZW5kJywgJ2ZvcndhcmQnLCAnY2hhcmFjdGVyJyk7CgpmdW5j
dGlvbiBtb2RpZmllZCgpIHsKICAgIHdoaWxlICh0ZXN0LmZpcnN0Q2hpbGQpCiAgICAgICAgdGVz
dC5yZW1vdmVDaGlsZCh0ZXN0LmZpcnN0Q2hpbGQpOwogICAgd2luZG93LmdldFNlbGVjdGlvbigp
LmRlbGV0ZUZyb21Eb2N1bWVudCgpOwp9Cgp0ZXN0LmFkZEV2ZW50TGlzdGVuZXIoJ0RPTVN1YnRy
ZWVNb2RpZmllZCcsIG1vZGlmaWVkLCBmYWxzZSk7CmRvY3VtZW50LmV4ZWNDb21tYW5kKCdib2xk
Jyk7Cgo8L3NjcmlwdD4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>