Bug 80439 - Race condition in handling non-cachable resources.
Summary: Race condition in handling non-cachable resources.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://examples.nfshost.com/nocachera...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-06 12:59 PST by Brian Kuhn
Modified: 2012-09-18 11:54 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Kuhn 2012-03-06 12:59:51 PST
Originally filed as a Chrome bug:
http://code.google.com/p/chromium/issues/detail?id=116988


Chrome Version       : 18.0.1025.39
OS Version: 
URLs (if applicable) : http://examples.nfshost.com/nocacherace/result1/index.html http://examples.nfshost.com/nocacherace/result2/index.html


Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari 5: FAIL
    Firefox 9: OK
         IE 9: OK

What steps will reproduce the problem?
Visit a page that loads a non-cachable script and an iframe that also uses that script.  The unexpected behavior happens if the iframe loads before the script finishes loading.

What is the expected result?
The main page and the iframe should get different copies of the non-cachable script, which is exactly what happens in all other cases.

What happens instead?
The script in the iframe is not requested; instead the copy from the main page is used. If this were to always happen, fine. But it only happens if the iframe is parsed while the script on the main page is mid-download. It seems like Chrome is assuming that the mid-download resource is cachable.


Please provide any additional information below. Attach a screenshot if
possible.

Please see the test cases I've developed to demonstrate the problem:
http://examples.nfshost.com/nocacherace/result1/index.html
http://examples.nfshost.com/nocacherace/result2/index.html


UserAgentString: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.39 Safari/535.19
Comment 1 Alexey Proskuryakov 2012-03-07 11:52:06 PST
This is a long standing problem in the loader, but I'm not sure if we have a bug clearly covering it already.
Comment 2 Brian Kuhn 2012-09-18 10:53:27 PDT
Is there no interest in fixing this?
Comment 3 Nate Chapin 2012-09-18 11:46:37 PDT
At a 2 minute glance, my guess is that the if statement at http://trac.webkit.org/browser/trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp?rev=128914#L583 is too broad. It should probably check the Frame that initiated the CachedResource load, the response headers, or both.
Comment 4 Brady Eidson 2012-09-18 11:54:08 PDT
(In reply to comment #2)
> Is there no interest in fixing this?

Do you have a case for why this needs to be higher priority work than what folks are already working on?

You're also welcome to tackle it yourself!