<?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>22590</bug_id>
          
          <creation_ts>2008-12-02 08:30:11 -0800</creation_ts>
          <short_desc>empty fragment href&apos;s crashes browser.</short_desc>
          <delta_ts>2011-03-08 11:57:31 -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>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>20342</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mahesh Kulkarni">maheshk</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ddkilzer</cc>
    
    <cc>koivisto</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>maheshk</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101005</commentid>
    <comment_count>0</comment_count>
    <who name="Mahesh Kulkarni">maheshk</who>
    <bug_when>2008-12-02 08:30:11 -0800</bug_when>
    <thetext>On empty fragment url&apos;s, document::gotoanchor crashes browser. 
for ex:
&lt;A href=&quot;#&quot;&gt; link &lt;/a&gt;

Default behavior of empty fragment is to first check if cssTarget is specified, if not goto first element. In case if this cssTarget node is delete by Javascript, browser crashes clicking on &quot;link&quot; in the example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101006</commentid>
    <comment_count>1</comment_count>
      <attachid>25670</attachid>
    <who name="Mahesh Kulkarni">maheshk</who>
    <bug_when>2008-12-02 08:44:37 -0800</bug_when>
    <thetext>Created attachment 25670
fix for empty fragment URL crash

assigning m_cssTarget to null if that node is getting deleted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101064</commentid>
    <comment_count>2</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2008-12-02 13:38:05 -0800</bug_when>
    <thetext>Could you provide a test case as well?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101100</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-12-02 16:02:09 -0800</bug_when>
    <thetext>*** Bug 22591 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101213</commentid>
    <comment_count>4</comment_count>
      <attachid>25712</attachid>
    <who name="Mahesh Kulkarni">maheshk</who>
    <bug_when>2008-12-03 09:29:22 -0800</bug_when>
    <thetext>Created attachment 25712
test case

test case. click on first link, then click second and finally on third link!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101337</commentid>
    <comment_count>5</comment_count>
      <attachid>25670</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-12-04 09:32:12 -0800</bug_when>
    <thetext>Comment on attachment 25670
fix for empty fragment URL crash

The fix looks fine. Now we need a regression test for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102329</commentid>
    <comment_count>6</comment_count>
    <who name="Mahesh Kulkarni">maheshk</who>
    <bug_when>2008-12-11 23:33:32 -0800</bug_when>
    <thetext>Please let me know what is the next thing I can do ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102342</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-12-12 04:47:15 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Please let me know what is the next thing I can do ?

See the &quot;Regression Tests&quot; section on this page:
http://webkit.org/coding/contributing.html

You must have a platform where layout tests are currently supported.  See this page for a list of ports that currently support the tests:
http://build.webkit.org/waterfall</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104832</commentid>
    <comment_count>8</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-01-07 19:22:55 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Created an attachment (id=25712) [review]
&gt; test case
&gt; 
&gt; test case. click on first link, then click second and finally on third link! 

The test case doesn&apos;t crash for me on Safari 3.2 or with the most recent WebKit nightly build r39682.

Which build of WebKit do you see this crash in?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106590</commentid>
    <comment_count>9</comment_count>
    <who name="Mahesh Kulkarni">maheshk</who>
    <bug_when>2009-01-22 04:15:12 -0800</bug_when>
    <thetext>its a very much platform dependent crash. This case was crashing in nokia mobile browser, because there is a clear corrupt/deleted node* left behind. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112837</commentid>
    <comment_count>10</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-09 09:51:12 -0700</bug_when>
    <thetext>The reason the test case doesn&apos;t crash on Mac OS X WebKit is that navigating to a new URL results in a call to gotoAnchor in FrameLoader, and that function calls setCSSTarget(0) when you click on the second link. At that time, the object is still not deleted. I&apos;ll figure out why.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112841</commentid>
    <comment_count>11</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-09 09:56:56 -0700</bug_when>
    <thetext>By adding a missing &quot;preventDefault&quot; to the test case I was able to reproduce a crash when MallocScribble is on, on Mac OS X.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112842</commentid>
    <comment_count>12</comment_count>
      <attachid>28415</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-09 09:57:28 -0700</bug_when>
    <thetext>Created attachment 28415
test case with preventDefault added</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112843</commentid>
    <comment_count>13</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-09 10:00:35 -0700</bug_when>
    <thetext>Someone needs to turn that test case into a regression test for the layout tests directory, and then make a patch that includes both the bug fix and the test case.

To make it so the test will show a crash without setting MallocScribble, at least in Debug builds, maybe we can add some code to the setChanged function in an assert. If that function called a virtual function, then I suspect we&apos;d see a crash every time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114800</commentid>
    <comment_count>14</comment_count>
      <attachid>25670</attachid>
    <who name="Adele Peterson">adele</who>
    <bug_when>2009-03-23 11:15:10 -0700</bug_when>
    <thetext>Comment on attachment 25670
fix for empty fragment URL crash

R-&apos;ing the patch until the test case is included as Darin described.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156817</commentid>
    <comment_count>15</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-10-22 00:11:33 -0700</bug_when>
    <thetext>&lt;rdar://problem/7325983&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>157177</commentid>
    <comment_count>16</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-10-23 10:09:06 -0700</bug_when>
    <thetext>I cannot reproduce the crash with ToT. Actually, the code that sets CSS target to 0 was added in &lt;http://trac.webkit.org/changeset/29311&gt;, which was long before this bug was filed.

The code was moved around, and sometimes even removed (but it seems to have been present and functional when this bug was filed). Unfortunately, the original test that came with r29311 is currently disabled, which is tracked as bug 20342.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>364077</commentid>
    <comment_count>17</comment_count>
    <who name="Mahesh Kulkarni">maheshk</who>
    <bug_when>2011-03-08 11:57:31 -0800</bug_when>
    <thetext>Marking this as fixed/duplicate of 20342 as it was fixed by Yael for qtWebkit.

*** This bug has been marked as a duplicate of bug 20342 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>25670</attachid>
            <date>2008-12-02 08:44:37 -0800</date>
            <delta_ts>2010-06-10 19:23:44 -0700</delta_ts>
            <desc>fix for empty fragment URL crash</desc>
            <filename>document.patch</filename>
            <type>text/plain</type>
            <size>1019</size>
            <attacher name="Mahesh Kulkarni">maheshk</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvZG9tL0RvY3VtZW50LmNwcAo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBXZWJDb3JlL2Rv
bS9Eb2N1bWVudC5jcHAJKHJldmlzaW9uIDM4NDIwKQorKysgV2ViQ29yZS9kb20vRG9jdW1lbnQu
Y3BwCSh3b3JraW5nIGNvcHkpCkBAIC0yNTQ5LDYgKzI1NDksOSBAQAogICAgICAgICBmcmFtZS0+
c2VsZWN0aW9uKCktPm5vZGVXaWxsQmVSZW1vdmVkKG4pOwogICAgICAgICBmcmFtZS0+ZHJhZ0Nh
cmV0Q29udHJvbGxlcigpLT5ub2RlV2lsbEJlUmVtb3ZlZChuKTsKICAgICB9CisKKyAgICBpZiAo
bV9jc3NUYXJnZXQgPT0gbikKKyAgICAgICAgbV9jc3NUYXJnZXQgPSAwOwogfQogCiB2b2lkIERv
Y3VtZW50Ojp0ZXh0SW5zZXJ0ZWQoTm9kZSogdGV4dCwgdW5zaWduZWQgb2Zmc2V0LCB1bnNpZ25l
ZCBsZW5ndGgpCkluZGV4OiBXZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBXZWJDb3Jl
L0NoYW5nZUxvZwkocmV2aXNpb24gMzg0MjApCisrKyBXZWJDb3JlL0NoYW5nZUxvZwkod29ya2lu
ZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBACisyMDA4LTEyLTAyICBNYWhlc2ggS3Vsa2FybmkgIDxt
YWhlc2gua3Vsa2FybmlAbm9raWEuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IC4KKworICAg
ICAgICBJbiBjYXNlIG9mIGVtcHR5IGZyYWdtZW50IGxpbmssIGlmIG1fY3NzVGFyZ2V0IGlzIGRl
bGV0ZWQgdGhlbiB3ZSBoYXZlIHRvIHNldCBtX2Nzc1RhcmdldCBub2RlIHRvIE5VTEwuCisKKyAg
ICAgICAgKiBkb20vRG9jdW1lbnQuY3BwOgorICAgICAgICAoV2ViQ29yZTo6RG9jdW1lbnQ6Om5v
ZGVXaWxsQmVSZW1vdmVkKToKKworCiAyMDA4LTExLTE0ICBHcmVnIEJvbHNpbmdhICA8Ym9sc2lu
Z2FAYXBwbGUuY29tPgogCiAgICAgICAgIFJldmlld2VkIGJ5IERhcmluIEFkbGVyLgo=
</data>
<flag name="review"
          id="11977"
          type_id="1"
          status="-"
          setter="adele"
    />
          </attachment>
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>25712</attachid>
            <date>2008-12-03 09:29:22 -0800</date>
            <delta_ts>2009-03-09 09:57:28 -0700</delta_ts>
            <desc>test case</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>347</size>
            <attacher name="Mahesh Kulkarni">maheshk</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8c2NyaXB0PgpmdW5jdGlvbiBkZWxldGVNZSgpCnsKICAgIHZhciBmaXJz
dE5vZGUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiY29udGFpbmVyIik7CiAgICBmaXJzdE5v
ZGUuaW5uZXJIVE1MID0gIiI7Cn0KPC9zY3JpcHQ+CjwvaGVhZD4KPGJvZHk+CjxkaXYgaWQ9ImNv
bnRhaW5lciI+CjxhIGlkPSJtZW1lIiBocmVmPSIjbWVtZSIgPiBjbGljayBtZSBmaXJzdCA8L2E+
CjwvZGl2Pgo8YSBocmVmPSIjIiBvbmNsaWNrPSJkZWxldGVNZSgpIj4gYW5kIHNlY29uZCBjbGlj
ayA8L2E+PC9icj4KPGEgaHJlZj0iIyI+IGFuZCB0aGlyZCBjbGljayA8L2E+CjwvYm9keT4KPC9o
dG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>28415</attachid>
            <date>2009-03-09 09:57:28 -0700</date>
            <delta_ts>2009-03-09 09:57:28 -0700</delta_ts>
            <desc>test case with preventDefault added</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>371</size>
            <attacher name="Darin Adler">darin</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8c2NyaXB0PgpmdW5jdGlvbiBkZWxldGVNZSgpCnsKICAgIHZhciBmaXJz
dE5vZGUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiY29udGFpbmVyIik7CiAgICBmaXJzdE5v
ZGUuaW5uZXJIVE1MID0gIiI7Cn0KPC9zY3JpcHQ+CjwvaGVhZD4KPGJvZHk+CjxkaXYgaWQ9ImNv
bnRhaW5lciI+CjxhIGlkPSJtZW1lIiBocmVmPSIjbWVtZSIgPiBjbGljayBtZSBmaXJzdCA8L2E+
CjwvZGl2Pgo8YSBocmVmPSIjIiBvbmNsaWNrPSJkZWxldGVNZSgpOyBldmVudC5wcmV2ZW50RGVm
YXVsdCgpIj4gYW5kIHNlY29uZCBjbGljayA8L2E+PC9icj4KPGEgaHJlZj0iIyI+IGFuZCB0aGly
ZCBjbGljayA8L2E+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>