Closed
Bug 1328761
Opened 8 years ago
Closed 8 years ago
Forever [Uploading...] in Gecko Profiler 2.0.13
Categories
(Core :: Networking: HTTP, defect)
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox51 | --- | unaffected |
firefox52 | --- | fixed |
firefox53 | --- | fixed |
People
(Reporter: alice0775, Assigned: bzbarsky)
References
Details
(Keywords: regression, singleprocess, Whiteboard: [necko-active])
Attachments
(6 files, 1 obsolete file)
108.29 KB,
image/png
|
Details | |
400.46 KB,
image/png
|
Details | |
64.46 KB,
image/png
|
Details | |
3.55 KB,
patch
|
dragana
:
review+
jcristau
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
1.90 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
5.23 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
Steps To Reproduce:
1. Ctrl+Shift+2
2. Wait to finish retrieve symbol etc.
3. Click [Shear...] button
4. Click [Shear] button
Actual Results:
Forever [Uploading...]
Expected Results:
URL link should be shown (I do not know exact behavior ov ver2.0.13)
Reporter | ||
Comment 1•8 years ago
|
||
typo
s/Shear/Share/g
Comment 2•8 years ago
|
||
Thanks Alice. I've moved this to https://github.com/mstange/cleopatra/issues/108 .
I haven't seen this myself; I suspect I'll need to add some debug messages that print to the console if things go wrong.
Do you see the request to profile-store.appspot.com in the devtools network panel if you click the Share button?
Reporter | ||
Comment 3•8 years ago
|
||
Screenshot(after step 4 and waited >1min)
it requested to profile-store.appspot.com, but response is 0 byte....
Comment 4•8 years ago
|
||
Interesting! What are the response headers? Are there any warnings in the console?
Reporter | ||
Comment 5•8 years ago
|
||
Web console:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://profile-store.appspot.com/compressed-store. (Reason: missing token ‘content-type’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel).
uncaught exception: 0
Comment 6•8 years ago
|
||
Thanks, that explains why it fails... somewhat. On my machine, the response headers of the OPTIONS request start with
Access-Control-Allow-Origin: *
Do you get something else?
Comment 7•8 years ago
|
||
Reporter | ||
Comment 8•8 years ago
|
||
Comment 9•8 years ago
|
||
Ok, so your request headers contain a "Access-Control-Request-Headers: content-type" header. My request headers do not contain this header. I wonder why.
The server would need to reply with a "Access-Control-Allow-Headers" response header that contains "content-type", e.g.:
"Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers"
But apparently it's not configured to do that.
Bz, do you know why Alice's and my request headers might differ? The code for the XHR is at https://github.com/mstange/cleopatra/blob/cleopatra-react/src/content/cleopatra-profile-store.js .
Comment 10•8 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #9)
> Ok, so your request headers contain a "Access-Control-Request-Headers:
> content-type" header. My request headers do not contain this header. I
> wonder why.
> Bz, do you know why Alice's and my request headers might differ? The code
> for the XHR is at
> https://github.com/mstange/cleopatra/blob/cleopatra-react/src/content/cleopatra-profile-store.js .
Flags: needinfo?(bzbarsky)
Comment 11•8 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #9)
> The server would need to reply with a "Access-Control-Allow-Headers"
> response header that contains "content-type", e.g.:
> "Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers"
> But apparently it's not configured to do that.
Jeff, can you configure the server to send those headers?
Flags: needinfo?(jmuizelaar)
Comment 12•8 years ago
|
||
Alice, what Firefox build are you using? I'm using yesterday's nightly, Built from https://hg.mozilla.org/mozilla-central/rev/f13abb8ba9f366c9f32a3146245adf642528becd 53.0a1 20170105030229
Reporter | ||
Comment 13•8 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #12)
> Alice, what Firefox build are you using? I'm using yesterday's nightly,
> Built from
> https://hg.mozilla.org/mozilla-central/rev/
> f13abb8ba9f366c9f32a3146245adf642528becd 53.0a1 20170105030229
[App]
Vendor=Mozilla
Name=Firefox
RemotingName=firefox
CodeName=Nightly
Version=53.0a1
BuildID=20170105030229
SourceRepository=https://hg.mozilla.org/mozilla-central
SourceStamp=f13abb8ba9f366c9f32a3146245adf642528becd
ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Reporter | ||
Comment 14•8 years ago
|
||
I found that disabling e10s seems to cause this problem.
If enable e10s, the problem seems to fix.
Reporter | ||
Updated•8 years ago
|
status-firefox51:
--- → unaffected
status-firefox52:
--- → affected
Keywords: singleprocess
Version: 53 Branch → 52 Branch
Reporter | ||
Comment 15•8 years ago
|
||
Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=e20fe9571c84457ff1e32fb2183edb8bf8054d7f&tochange=01c1359222ea6f86699b771d306c06137dcf78aa
Regressed by: Bug 1207233
Blocks: 1207233
Keywords: regression
Updated•8 years ago
|
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 16•8 years ago
|
||
Hmm. That's really odd. The behavior you describe happened with the _first_ attempt to patch bug 1207233, and broke Cleopatra, but the thing that landed in the regression window you note should have fixed that problem.
And we have a test that tests that we _don't_ set a Content-Type header in this case, and we're passing it. See http://searchfox.org/mozilla-central/source/testing/web-platform/tests/XMLHttpRequest/setrequestheader-content-type.htm the "ArrayBufferView request sends no Content-Type without setRequestHeader() call" bit. That's Cleopatra's situation.
I also just checked on http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm in both e10s and non-e10s mode, and we pass the ArrayBufferView test both ways.
Alice0775, what happens when you run that test in your browser in non-e10s mode? Do you have any extensions that might be relevant?
Flags: needinfo?(alice0775)
Reporter | ||
Comment 17•8 years ago
|
||
(In reply to Boris Zbarsky [:bz] (still a bit busy) from comment #16)
> Alice0775, what happens when you run that test in your browser in non-e10s
> mode?
Tested on Nightly53.0a1(2016-01-05):
#1 with newly created profile(e10s is enabled by default):
Summary
Harness status: OK
Found 32 tests
29 Pass
3 Fail
Details
*snip passed results*
Fail ReadableStream request respects setRequestHeader("") assert_unreached: Skipping test as could not create a ReadableStream; Reached unreachable code
request/<@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:17:13
Test.prototype.step@http://w3c-test.org/resources/testharness.js:1406:20
test@http://w3c-test.org/resources/testharness.js:501:9
request@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:13:9
@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:217:7
Fail ReadableStream request with under type sends no Content-Type without setRequestHeader() call assert_unreached: Skipping test as could not create a ReadableStream; Reached unreachable code
request/<@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:17:13
Test.prototype.step@http://w3c-test.org/resources/testharness.js:1406:20
test@http://w3c-test.org/resources/testharness.js:501:9
request@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:13:9
@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:223:7
Fail ReadableStream request keeps setRequestHeader() Content-Type and charset assert_unreached: Skipping test as could not create a ReadableStream; Reached unreachable code
request/<@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:17:13
Test.prototype.step@http://w3c-test.org/resources/testharness.js:1406:20
test@http://w3c-test.org/resources/testharness.js:501:9
request@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:13:9
@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:229:7
=======================================================================
#2 with with newly created profile, and disable e10s from options:
Summary
Harness status: OK
Found 32 tests
29 Pass
3 Fail
Details
*snip passed results*
Fail ReadableStream request respects setRequestHeader("") assert_unreached: Skipping test as could not create a ReadableStream; Reached unreachable code
request/<@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:17:13
Test.prototype.step@http://w3c-test.org/resources/testharness.js:1406:20
test@http://w3c-test.org/resources/testharness.js:501:9
request@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:13:9
@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:217:7
Fail ReadableStream request with under type sends no Content-Type without setRequestHeader() call assert_unreached: Skipping test as could not create a ReadableStream; Reached unreachable code
request/<@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:17:13
Test.prototype.step@http://w3c-test.org/resources/testharness.js:1406:20
test@http://w3c-test.org/resources/testharness.js:501:9
request@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:13:9
@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:223:7
Fail ReadableStream request keeps setRequestHeader() Content-Type and charset assert_unreached: Skipping test as could not create a ReadableStream; Reached unreachable code
request/<@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:17:13
Test.prototype.step@http://w3c-test.org/resources/testharness.js:1406:20
test@http://w3c-test.org/resources/testharness.js:501:9
request@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:13:9
@http://w3c-test.org/XMLHttpRequest/setrequestheader-content-type.htm:229:7
==================================================================
> Do you have any extensions that might be relevant?
Gecko Profiler only.
No the other addon is installed.
Flags: needinfo?(alice0775)
Reporter | ||
Comment 18•8 years ago
|
||
#3 with newly created profile + Gecko Profiler(e10s is enabled by default):
#4 with newly created profile + Gecko Profiler and disable e10s from options:
I got same results of Comment#17.
Reporter | ||
Comment 19•8 years ago
|
||
I can also reproduce the problem on Ubuntu16.04LTS and Windows7SP1 when e10s is disabled
Assignee | ||
Comment 20•8 years ago
|
||
Right, Gecko doesn't implement ReadableStream. But the point is what you're seeing is that the relevant test is passing in all your configurations.
So I stepped through this, and the issue comes from the change to HttpBaseChannel::ExplicitSetUploadStream. The old code was:
SetRequestHeader(NS_LITERAL_CSTRING("Content-Type"), aContentType,
false);
The new code is:
if (!aContentType.IsVoid()) {
if (aContentType.IsEmpty()) {
SetEmptyRequestHeader(NS_LITERAL_CSTRING("Content-Type"));
} else {
SetRequestHeader(NS_LITERAL_CSTRING("Content-Type"), aContentType,
false);
}
}
Now the thing is, SetRequestHeader() with an empty header value will _remove_ the header when the third arg is false. So when !aContentType.IsVoid() && aContentType.IsEmpty() we changed behavior: we used to not send a Content-Type header and now we send one with value "".
The same changeset modified XHR to do the right thing and pass a void string to ExplicitSetUploadStream.
But in this testcase, we're calling ExplicitSetUploadStream from HttpBaseChannel::SetupReplacementChannel. That's happening because we're ending up in InterceptedChannelChrome::ResetInterception which presumably has to do with service worker usage on the page or something?
Anyway, there aren't that many callers of ExplicitSetUploadStream, thankfully. The one in Navigator::SendBeacon looks buggy in the same way to me. The one in FetchDriver::Fetch, I can't tell. The on in SetupReplacementChannel is buggy. The one in XHR is OK. The other ones all pass in nonempty strings for the type anyway, afaict.
Assignee | ||
Comment 21•8 years ago
|
||
Ben, can you check whether the FetchDriver behavior is correct? Can mRequest->Headers() not have a content-type header set? Comments make it sound like no, but per spec at step 35 of the Request ctor, sure sounds like it could if there is no body or in various other cases in which https://fetch.spec.whatwg.org/#concept-bodyinit-extract returns null... I guess the comments are a bit misleading since result.Failed() can only happen on invalid header name, and we control the name, and this has nothing to do with the _setting_ of content-type?
And if there is no header our string will end up void, looks like. So this one looks ok.
Component: Gecko Profiler → Networking: HTTP
Assignee | ||
Comment 22•8 years ago
|
||
I'll leave the beacon thing for bug 1329298.
Assignee | ||
Comment 23•8 years ago
|
||
Argh, and actual needinfo for Ben for comment 21.
Flags: needinfo?(bkelly)
Assignee | ||
Comment 24•8 years ago
|
||
This fixes the steps from comment 0. I could really use help with writing a testcase for this...
Attachment #8824524 -
Flags: review?(dd.mozilla)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 25•8 years ago
|
||
Attachment #8824529 -
Flags: review?(dd.mozilla)
Assignee | ||
Updated•8 years ago
|
Attachment #8824524 -
Attachment is obsolete: true
Attachment #8824524 -
Flags: review?(dd.mozilla)
Comment 26•8 years ago
|
||
I agree that the content-type header can be void in FetchDriver. It seems this all works correctly, but the comment is wrong.
Flags: needinfo?(bkelly)
Assignee | ||
Comment 27•8 years ago
|
||
Attachment #8824557 -
Flags: review?(bkelly)
Comment 28•8 years ago
|
||
Comment on attachment 8824557 [details] [diff] [review]
part 2. Update some FetchDriver comments to more clearly reflect reality
Review of attachment 8824557 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
Attachment #8824557 -
Flags: review?(bkelly) → review+
Updated•8 years ago
|
Whiteboard: [necko-active]
Comment 29•8 years ago
|
||
Comment on attachment 8824529 [details] [diff] [review]
Correctly propagate the Content-Type request header during redirects, for cases when it's _not_ set
Review of attachment 8824529 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry for the delay
Attachment #8824529 -
Flags: review?(dd.mozilla) → review+
Assignee | ||
Comment 30•8 years ago
|
||
Try caught a bug: "if (contentType.IsEmpty())" should be "if (contentTypeArg.IsEmpty())" in HttpBaseChannel::SetUploadStream.
Assignee | ||
Comment 31•8 years ago
|
||
Hmm. Markus, did you change the server side here by any chance? I just tried to reproduce again (so I could test that the patch with the fix from comment 30 still fixes the original bug), but now I can't reproduce at all, even with a vanilla build without this patch...
Flags: needinfo?(mstange)
Reporter | ||
Comment 32•8 years ago
|
||
I can reproduce the problem if e10s is disabled.
Assignee | ||
Comment 33•8 years ago
|
||
Oh, right, I forgot that e10s disabled is needed! OK, good, the patch still fixes things.
I'll land this now, then think about a test for this on Tuesday...
Flags: needinfo?(mstange)
Flags: needinfo?(jmuizelaar)
Comment 34•8 years ago
|
||
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/750307a1e3f9
part 1. Correctly propagate the Content-Type request header during redirects, for cases when it's _not_ set. r=dragana
https://hg.mozilla.org/integration/mozilla-inbound/rev/18ab7878c67b
part 2. Update some FetchDriver comments to more clearly reflect reality. r=bkelly
Assignee | ||
Comment 35•8 years ago
|
||
Comment on attachment 8824529 [details] [diff] [review]
Correctly propagate the Content-Type request header during redirects, for cases when it's _not_ set
Approval Request Comment
[Feature/Bug causing the regression]: Bug 1207233
[User impact if declined]: Some sites may be broken. Basically anything
involving cross-site XHR and a redirect, and maybe anything that involves
cross-site XHR and serviceworkers.
[Is this code covered by automated tests?]: Clearly not enough. I'll add more
before landing this on Auroda.
[Has the fix been verified in Nightly?]: Not yet, but manually verified in
my build.
[Needs manual test from QE? If yes, steps to reproduce]: No
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: Somewhat. That, and the fact that we apparently
already shipped this bug in Firefox 50, is why I'm only requesting Aurora
uplift, not beta. But I think we expect service workers to be more and
more popular, so it would be good to have this bug in the wild as little
as we have risk tolerance for.
[Why is the change risky/not risky?]: It's changing some pretty core HTTP code.
I think it's changing it correctly, but clearly that's what we thought in
the bug that caused this one.
[String changes made/needed]: None
Attachment #8824529 -
Flags: approval-mozilla-aurora?
Comment 36•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/750307a1e3f9
https://hg.mozilla.org/mozilla-central/rev/18ab7878c67b
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Comment 37•8 years ago
|
||
Comment on attachment 8824529 [details] [diff] [review]
Correctly propagate the Content-Type request header during redirects, for cases when it's _not_ set
content-type handling fix, aurora52+, hopefully with more tests coming as mentioned in comment 35
Attachment #8824529 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 38•8 years ago
|
||
I checked that we fail the new test with the typed array without this patch, and pass it with the patch
Attachment #8827602 -
Flags: review?(bkelly)
Assignee | ||
Updated•8 years ago
|
Attachment #8827602 -
Flags: approval-mozilla-aurora?
Updated•8 years ago
|
Attachment #8827602 -
Flags: review?(bkelly) → review+
Comment 39•8 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1eeaa7ae6b3a
Tests. r=bkelly
Comment 40•8 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-aurora/rev/1e9635dd5012
https://hg.mozilla.org/releases/mozilla-aurora/rev/2d2e70db03c3
https://hg.mozilla.org/releases/mozilla-aurora/rev/29d706c05b1d
Flags: in-testsuite+
Assignee | ||
Updated•8 years ago
|
Attachment #8827602 -
Flags: approval-mozilla-aurora?
Comment 41•8 years ago
|
||
bugherder |
You need to log in
before you can comment on or make changes to this bug.
Description
•