Closed
Bug 1198544
Opened 10 years ago
Closed 10 years ago
FetchDriver can call OnResponseAvailable multiple times, leading to crashes
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla43
| Tracking | Status | |
|---|---|---|
| firefox43 | --- | fixed |
People
(Reporter: khuey, Assigned: jdm)
References
Details
Attachments
(3 files)
|
9.10 KB,
text/plain
|
Details | |
|
7.68 KB,
patch
|
nsm
:
review+
bkelly
:
feedback+
|
Details | Diff | Splinter Review |
|
2.49 KB,
patch
|
Details | Diff | Splinter Review |
OnStopRequest should probably not call OnResponseAvailable. But it does need to report the error somehow, and it's not clear to me where that should go since InternalResponse::mTerminationReason appears to be completely unused.
Comment 1•10 years ago
|
||
In my opinion, OnStopRequest should abort the pipe with an error code causing the body to become invalid. Its too late to return an Error Response object.
Comment 2•10 years ago
|
||
And then call OnResponseEnd().
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → josh
| Assignee | ||
Comment 3•10 years ago
|
||
The test asserts without my fix and passes with it.
Attachment #8659251 -
Flags: review?(nsm.nikhil)
| Assignee | ||
Comment 4•10 years ago
|
||
Comment 5•10 years ago
|
||
Comment on attachment 8659251 [details] [diff] [review]
Prevent FetchDriver from creating multiple responses if OnStopRequest yields a failing status code
Review of attachment 8659251 [details] [diff] [review]:
-----------------------------------------------------------------
Nice!
Attachment #8659251 -
Flags: feedback+
Comment on attachment 8659251 [details] [diff] [review]
Prevent FetchDriver from creating multiple responses if OnStopRequest yields a failing status code
Review of attachment 8659251 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/fetch/FetchDriver.cpp
@@ +883,5 @@
> + nsCOMPtr<nsIAsyncOutputStream> outputStream = do_QueryInterface(mPipeOutputStream);
> + if (outputStream) {
> + outputStream->CloseWithStatus(NS_BINDING_FAILED);
> + }
> + SucceedWithResponse();
Call ContinueHttpFetchAfterNetworkFetch()?
Can you add a comment that we resolve with success even though we failed since a successful Response has already been delivered in OnStartRequest().
::: dom/workers/test/serviceworkers/fetch/interrupt.sjs
@@ +10,5 @@
> + response.write("Content-Type: text/plain; charset=utf-8\r\n");
> + response.write("Cache-Control: no-cache, must-revalidate\r\n");
> + response.write("\r\n");
> +
> + response.write(body);
Nit: for loop with N = 10 and using N in the Content-Length :)
Attachment #8659251 -
Flags: review?(nsm.nikhil) → review+
No longer blocks: 1185150
| Assignee | ||
Comment 7•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/132aa442af953fab46644e34c60c6782350b703b
Bug 1198544 - Prevent FetchDriver from creating multiple responses if OnStopRequest yields a failing status code. r=nsm
Backed out for linux debug bc5 failures like https://treeherder.mozilla.org/logviewer.html#?job_id=13975361&repo=mozilla-inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/9ef95c4879fa
Flags: needinfo?(josh)
| Assignee | ||
Comment 9•10 years ago
|
||
This fixes the crash observed on inbound, stemming from the changes requested during the review.
Flags: needinfo?(josh)
Attachment #8660150 -
Flags: review?(nsm.nikhil)
Comment on attachment 8660150 [details] [diff] [review]
interdiff
Review of attachment 8660150 [details] [diff] [review]:
-----------------------------------------------------------------
Ah... I'd rather you revert the patch to call SucceedWithResponse() as before rather than introduce this variable. Sorry.
Attachment #8660150 -
Flags: review?(nsm.nikhil)
Updated•10 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 11•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/5af5ff26d3858268b19ddfbd15306b6ed07a3816
Bug 1198544 - Prevent FetchDriver from creating multiple responses if OnStopRequest yields a failing status code. r=nsm
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•