<?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>11554</bug_id>
          
          <creation_ts>2006-11-09 08:56:14 -0800</creation_ts>
          <short_desc>REGRESSION (r17682): Assertion failure in IconLoader::didFinishLoading() when the icon request returns 404 or 403</short_desc>
          <delta_ts>2006-11-10 13:25:07 -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>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>data:text/html,&lt;link%20rel=&quot;shortcut%20icon&quot;%20href=&quot;http://www.apple.com/filenotfound&quot;&gt;</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mitz</reporter>
          <assigned_to>mitz</assigned_to>
          <cc>beidson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>46386</commentid>
    <comment_count>0</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-11-09 08:56:14 -0800</bug_when>
    <thetext>The assertion in IconLoader::didFinishLoading() is hit when the icon URL request returns a result code outside the 200-299 range.

The assertion fails because in this case, finishLoading() is called first from didReceiveResponse().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46392</commentid>
    <comment_count>1</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-11-09 09:40:38 -0800</bug_when>
    <thetext>I&apos;ll look into this soon...  definitely a regression from before some work Darin and I did a couple of days ago</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46355</commentid>
    <comment_count>2</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-11-09 16:12:51 -0800</bug_when>
    <thetext>I thought the problem here was due to refactoring Darin and I did earlier causing a preexisting ASSERT to be hit - I see now what maciej changed in 17682. Looking at it now</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46347</commentid>
    <comment_count>3</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-11-09 17:30:40 -0800</bug_when>
    <thetext>Maciej&apos;s addition of didFailWithError changed what we should be checking in this method - very small change, at that.  Patch is coming</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46346</commentid>
    <comment_count>4</comment_count>
      <attachid>11449</attachid>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-11-09 17:35:31 -0800</bug_when>
    <thetext>Created attachment 11449
Proposed fix

Maciej&apos;s didFailWithError addition brought this one about - simple fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46310</commentid>
    <comment_count>5</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-11-09 20:27:51 -0800</bug_when>
    <thetext>Discussed this with Maciej on IRC, I need to explore a little more - he claims didFailWithError should be terminal for a ResourceHandler, and didFinishLoading should not be called after.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46314</commentid>
    <comment_count>6</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-11-09 23:12:35 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; Discussed this with Maciej on IRC, I need to explore a little more - he claims
&gt; didFailWithError should be terminal for a ResourceHandler, and didFinishLoading
&gt; should not be called after.
&gt; 

To clarify my initial description, didFailWithError is never called in this case, only didReceiveResponse is. I think perhaps the way to deal with this situation is to change the behavior of didReceiveResponse for statuses outside the 200-299 range, so that it will only set an &quot;invalid icon data&quot; flag, and later in finishLoading to examine this flag, and if it is set, skip the icon processing and go straight to clearLoadingState. The flag could also be used to save the work of copying of data in didReceiveData.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46316</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-11-09 23:57:58 -0800</bug_when>
    <thetext>Yah, I totally jumped to an assumption when I was debugging and saw m_handle == 0 - I assumed it could only happen in two places, but can really happen in 3.  

Addressing your suggestion - Darin and I actually went through great lengths to remove as moving flags and vars as possible - it would be a shame to put one back in.  

With this greater, complete understand of what&apos;s happening, I think my original patch becomes valid again, in a slightly expanded form.  Stay tuned...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46320</commentid>
    <comment_count>8</comment_count>
      <attachid>11456</attachid>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-11-10 00:37:53 -0800</bug_when>
    <thetext>Created attachment 11456
This is a more complete fix to this bug, and another bug too!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46321</commentid>
    <comment_count>9</comment_count>
      <attachid>11456</attachid>
    <who name="">mitz</who>
    <bug_when>2006-11-10 00:47:07 -0800</bug_when>
    <thetext>Comment on attachment 11456
This is a more complete fix to this bug, and another bug too!

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46323</commentid>
    <comment_count>10</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-11-10 01:19:02 -0800</bug_when>
    <thetext>Committed in r17702, please verify</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>11449</attachid>
            <date>2006-11-09 17:35:31 -0800</date>
            <delta_ts>2006-11-10 00:37:53 -0800</delta_ts>
            <desc>Proposed fix</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1107</size>
            <attacher name="Brady Eidson">beidson</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09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RsZSA9PSBtX2hhbmRsZSk7Ci0g
ICAgZmluaXNoTG9hZGluZyhoYW5kbGUtPnVybCgpKTsKKyAgICBpZiAobV9oYW5kbGUpIHsKKyAg
ICAgICAgQVNTRVJUKGhhbmRsZSA9PSBtX2hhbmRsZSk7CisgICAgICAgIGZpbmlzaExvYWRpbmco
aGFuZGxlLT51cmwoKSk7CisgICAgfQogfQogCiB2b2lkIEljb25Mb2FkZXI6OmZpbmlzaExvYWRp
bmcoY29uc3QgS1VSTCYgaWNvblVSTCkK
</data>
<flag name="review"
          id="4030"
          type_id="1"
          status="-"
          setter="beidson"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>11456</attachid>
            <date>2006-11-10 00:37:53 -0800</date>
            <delta_ts>2006-11-10 00:47:07 -0800</delta_ts>
            <desc>This is a more complete fix to this bug, and another bug too!</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1920</size>
            <attacher name="Brady Eidson">beidson</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDE3NzAx
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTcgQEAKKzIwMDYtMTEt
MTAgIEJyYWR5IEVpZHNvbiA8YmVpZHNvbkBhcHBsZS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQg
YnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgaHR0cDovL2J1Z3Mud2Via2l0Lm9yZy9zaG93
X2J1Zy5jZ2k/aWQ9MTE1NTQKKyAgICAgICAgRml4IHRoZSBhYm92ZSBidWcgKGluIGRpZEZpbmlz
aExvYWRpbmcpIGFuZCBhbHNvIGFub3RoZXIgcG90ZW50aWFsIGJ1ZyBpbiBkaWRGY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xXaXRoRXJyb3IoUmVzb3VyY2VIYW5kbGUqIGhhbmRsZSwgY29uc3QgUmVz
b3VyY2VFcnJvciYpCiB7CisgICAgQVNTRVJUKG1fbG9hZElzSW5Qcm9ncmVzcyk7CisgICAgbV9i
dWZmZXIuY2xlYXIoKTsKICAgICBmaW5pc2hMb2FkaW5nKGhhbmRsZS0+dXJsKCkpOwogfQogCiB2
b2lkIEljb25Mb2FkZXI6OmRpZEZpbmlzaExvYWRpbmcoUmVzb3VyY2VIYW5kbGUqIGhhbmRsZSkK
IHsKLSAgICBBU1NFUlQoaGFuZGxlID09IG1faGFuZGxlKTsKLSAgICBmaW5pc2hMb2FkaW5nKGhh
bmRsZS0+dXJsKCkpOworICAgIC8vIElmIHRoZSBpY29uIGxvYWQgcmVzdWx0ZWQgYW4gZXJyb3It
cmVzcG9uc2UgZWFybGllciwgdGhlIFJlc291cmNlSGFuZGxlIHdhcyBraWxsZWQgYW5kIGljb24g
ZGF0YSBjb21taXRlZCB2aWEgZmluaXNoTG9hZGluZygpCisgICAgLy8gSW4gdGhhdCBjYXNlIHRo
aXMgZGlkRmluaXNoTG9hZGluZyBjYWxsYmFjayBpcyBwb2ludGxlc3MgYW5kIHdlIGJhaWwuICBP
dGhlcndpc2UsIGZpbmlzaExvYWRpbmcoKSBhcyBleHBlY3RlZAorICAgIGlmIChtX2xvYWRJc0lu
UHJvZ3Jlc3MpIHsKKyAgICAgICAgQVNTRVJUKGhhbmRsZSA9PSBtX2hhbmRsZSk7CisgICAgICAg
IGZpbmlzaExvYWRpbmcoaGFuZGxlLT51cmwoKSk7CisgICAgfQogfQogCiB2b2lkIEljb25Mb2Fk
ZXI6OmZpbmlzaExvYWRpbmcoY29uc3QgS1VSTCYgaWNvblVSTCkK
</data>
<flag name="review"
          id="4031"
          type_id="1"
          status="+"
          setter="mitz"
    />
          </attachment>
      

    </bug>

</bugzilla>