<?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>106297</bug_id>
          
          <creation_ts>2013-01-07 21:09:42 -0800</creation_ts>
          <short_desc>Every cached image is an error</short_desc>
          <delta_ts>2013-01-09 16:21:11 -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>Images</component>
          <version>420+</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philip Rogers">pdr</reporter>
          <assigned_to name="Philip Rogers">pdr</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>dglazkov</cc>
    
    <cc>eric</cc>
    
    <cc>japhet</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>801990</commentid>
    <comment_count>0</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-01-07 21:09:42 -0800</bug_when>
    <thetext>Every cached image load causes the following error:
CachedImage::data(...)
    ...
    error(errorOccurred() ? status() : DecodeError);
http://trac.webkit.org/browser/trunk/Source/WebCore/loader/cache/CachedImage.cpp?rev=138976#L381

The culprit is cache revalidation.
When loading cached resources we revalidate the cache by sending a request to the server and waiting for the 304 not modified response. Behind the scenes we actually hold two CachedImages: the cached cached image (sorry!) and the revalidating cached image. If revalidation succeeds with a 304 we throw away the revalidating image and use the cached image. If revalidation fails (server resource changed) we evict the cached cached image and continue to load the revalidating image.

Every cached image load causes an error because, in the success case, we do not cancel the revalidation request once we receive a 304 not modified response. The revalidating cached image continues to load in its merry way: CachedImage::data() is called which creates a new BitmapImage that ends up throwing an error, and ultimately this cached image is freed in the SubResourceLoader because it has no references.

Patch forthcoming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801997</commentid>
    <comment_count>1</comment_count>
      <attachid>181634</attachid>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-01-07 21:31:28 -0800</bug_when>
    <thetext>Created attachment 181634
First pass</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>802020</commentid>
    <comment_count>2</comment_count>
      <attachid>181634</attachid>
    <who name="Build Bot">buildbot</who>
    <bug_when>2013-01-07 22:05:38 -0800</bug_when>
    <thetext>Comment on attachment 181634
First pass

Attachment 181634 did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15734979

New failing tests:
http/tests/inspector/resource-tree/resource-request-content-while-loading.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>802033</commentid>
    <comment_count>3</comment_count>
      <attachid>181634</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-01-07 22:29:12 -0800</bug_when>
    <thetext>Comment on attachment 181634
First pass

Attachment 181634 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15733986

New failing tests:
http/tests/inspector/compiler-source-mapping-debug.html
http/tests/inspector/resource-tree/resource-tree-reload.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>802362</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-01-08 10:41:41 -0800</bug_when>
    <thetext>These broken tests look related to the proposed change, at least at a first glance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>803781</commentid>
    <comment_count>5</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-01-09 15:25:37 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; These broken tests look related to the proposed change, at least at a first glance.

The tests are correctly failing. As strange as it seems, error() needs to be called during cache revalidation :/

I&apos;ve filed a separate bug and put up a patch for the narrower issue of CreateImage() being called on revalidation requests for images: https://bugs.webkit.org/show_bug.cgi?id=106156</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>181634</attachid>
            <date>2013-01-07 21:31:28 -0800</date>
            <delta_ts>2013-01-09 16:21:11 -0800</delta_ts>
            <desc>First pass</desc>
            <filename>106297.1.patch</filename>
            <type>text/plain</type>
            <size>1788</size>
            <attacher name="Philip Rogers">pdr</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEzOTAzMCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIxIEBACisyMDEzLTAxLTA3ICBQaGlsaXAg
Um9nZXJzICA8cGRyQGdvb2dsZS5jb20+CisKKyAgICAgICAgQ2FuY2VsIHN1Y2Nlc3NmdWwgcmV2
YWxpZGF0aW9uIHJlcXVlc3RzCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3df
YnVnLmNnaT9pZD0xMDYyOTcKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4K
KworICAgICAgICBUaGlzIHBhdGNoIGltbWVkaWF0ZWx5IGNhbmNlbHMgc3VjY2Vzc2Z1bCByZXZh
bGlkYXRpb24gcmVxdWVzdHMgYmVjYXVzZSBvbmNlIGEgY2FjaGVkCis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XJjZS9XZWJDb3JlL2xv
YWRlci9TdWJyZXNvdXJjZUxvYWRlci5jcHAJKHJldmlzaW9uIDEzODg3OSkKKysrIFNvdXJjZS9X
ZWJDb3JlL2xvYWRlci9TdWJyZXNvdXJjZUxvYWRlci5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTE3
NSw2ICsxNzUsNyBAQCB2b2lkIFN1YnJlc291cmNlTG9hZGVyOjpkaWRSZWNlaXZlUmVzcG9uCiAg
ICAgICAgICAgICBtZW1vcnlDYWNoZSgpLT5yZXZhbGlkYXRpb25TdWNjZWVkZWQobV9yZXNvdXJj
ZSwgcmVzcG9uc2UpOwogICAgICAgICAgICAgaWYgKCFyZWFjaGVkVGVybWluYWxTdGF0ZSgpKQog
ICAgICAgICAgICAgICAgIFJlc291cmNlTG9hZGVyOjpkaWRSZWNlaXZlUmVzcG9uc2UocmVzcG9u
c2UpOworICAgICAgICAgICAgY2FuY2VsKCk7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAg
IH0KICAgICAgICAgLy8gRGlkIG5vdCBnZXQgMzA0IHJlc3BvbnNlLCBjb250aW51ZSBhcyBhIHJl
Z3VsYXIgcmVzb3VyY2UgbG9hZC4K
</data>
<flag name="commit-queue"
          id="199342"
          type_id="3"
          status="-"
          setter="buildbot"
    />
          </attachment>
      

    </bug>

</bugzilla>