Closed
Bug 902121
Opened 11 years ago
Closed 10 years ago
Uncaught error NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS when writing to document.cookie
Categories
(Firefox OS Graveyard :: General, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jrburke, Assigned: bkelly)
Details
(Keywords: perf, Whiteboard: [c= p=4 s=2013.12.06 u=])
Attachments
(2 files, 1 obsolete file)
35.44 KB,
application/zip
|
Details | |
1.31 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
When running on an unagi device with mozilla-central, I see the following error in the logcat when trying to set document.cookie from a certified app: E/GeckoConsole( 509): ThirdPartyCookieProbe: Uncaught error [Exception... "Component returned failure code: 0x804b0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) [nsIEffectiveTLDService.getBaseDomainFromHost]" nsresult: "0x804b0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS)" location: "JS frame :: resource://gre/modules/ThirdPartyCookieProbe.jsm :: normalizeHost :: line 181" data: no] E/GeckoConsole( 509): undefined Shows up with latest B2G master with mozilla central (did a BRANCH=master configure and build of B2G today), but has been that way for the week since I started using mozilla-central. Steps to reproduce: 1) Install the attached zip file by using the FirefoxOS Simulator to push the expanded zip file to the device. Instructions on how to do that available here: https://github.com/jrburke/gaia-dev-zip#for-the-ux-person 2) Open the cookietest app and have logcat running. The error should show up. It did not show up with b2g18. A cookie is used by the email app to allow a fast-restore into message list from a cold boot, so this message will show up in the log for anyone launching the email app.
Comment 1•11 years ago
|
||
Is this potentially related to the problem cited in https://bugzilla.mozilla.org/show_bug.cgi?id=901697#c1?
Reporter | ||
Comment 2•11 years ago
|
||
It sounds like the same root cause. If I had to guess, something with the structure or kind of the URL/protocol used for packaged apps is not fitting with some cookie checks. If there is a preference to address the issue by using that other ticket, that is fine with me. This one has a small app test case that may be useful.
Comment 3•10 years ago
|
||
Got the same issue when opening delicious.com, which may read/write some data to cookie. I'm using the geeksphone 1.2 image on KEON, the logcat shows uncaught exception: E/GeckoConsole( 1931): ThirdPartyCookieProbe: Uncaught error [Exception... "Component returned failure code: 0x804b0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) [nsIEffectiveTLDService.getBaseDomainFromHost]" nsresult: "0x804b0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS)" location: "JS frame :: resource://gre/modules/ThirdPartyCookieProbe.jsm :: normalizeHost :: line 181" data: no] E/GeckoConsole( 1931): undefined
Comment 4•10 years ago
|
||
(In reply to classicning from comment #3) > Got the same issue when opening delicious.com, which may read/write some > data to cookie. > > I'm using the geeksphone 1.2 image on KEON, the logcat shows uncaught > exception: > > E/GeckoConsole( 1931): ThirdPartyCookieProbe: Uncaught error [Exception... > "Component returned failure code: 0x804b0050 > (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) > [nsIEffectiveTLDService.getBaseDomainFromHost]" nsresult: "0x804b0050 > (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS)" location: "JS frame :: > resource://gre/modules/ThirdPartyCookieProbe.jsm :: normalizeHost :: line > 181" data: no] > E/GeckoConsole( 1931): undefined And this issue will crash the whole system. Vote for it because it's a critical one needed to be fixed. I cannot reproduce it on simulator. But users with other devices have confirmed this issue: http://www.reddit.com/r/FireFoxOS/comments/1o1ovg/system_crashed_when_opening_deliciouscom_from_keon/
Comment 5•10 years ago
|
||
According to my inverigation, this is not the root cause of system crash. It's just a minor issue within Gecko.
Updated•10 years ago
|
Priority: -- → P3
Assignee | ||
Comment 6•10 years ago
|
||
It seems that for these cookies on b2g the issuer URI is not set. Therefore the code here sends "?" for the referrer URI: http://mxr.mozilla.org/mozilla-central/source/netwerk/cookie/nsCookieService.cpp#1772 But the telemetry ThirdPartyCookieProbe.jsm always tries to normalize this URI: http://mxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/ThirdPartyCookieProbe.jsm#79 Apparently trying to normalize "?" throws an exception because its an invalid URI. David, what do you think is the correct fix here? Skip the normalization if |referrer === "?"| ?
Flags: needinfo?(dteller)
Comment 7•10 years ago
|
||
(In reply to Ben Kelly [:bkelly] from comment #6) > David, what do you think is the correct fix here? Skip the normalization if > |referrer === "?"| ? Sounds like a good plan.
Flags: needinfo?(dteller)
Assignee | ||
Comment 8•10 years ago
|
||
Comment 9•10 years ago
|
||
Comment on attachment 8338186 [details] [diff] [review] third-party-cookie-referrer.patch Review of attachment 8338186 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/components/telemetry/ThirdPartyCookieProbe.jsm @@ +74,5 @@ > // Not a third-party cookie > return; > } > // Add host to this._thirdPartyCookies > + let firstParty = (referrer === "?") ? referrer : normalizeHost(referrer); Yes, but please add a comment.
Attachment #8338186 -
Flags: review?(dteller) → review+
Assignee | ||
Comment 10•10 years ago
|
||
Thanks for the review! Added comment indicating that nsCookieService will pass "?" if the issuer is unknown and that we don't want to try to normalize an invalid URI like this. Carrying r+ forward.
Attachment #8338186 -
Attachment is obsolete: true
Attachment #8338501 -
Flags: review+
Assignee | ||
Comment 11•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=e5d149817e73
Comment 13•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/4704a41581c6
Keywords: checkin-needed
Comment 14•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4704a41581c6
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Whiteboard: [c= p=4 s= u=] → [c= p=4 s=2013.12.06 u=]
You need to log in
before you can comment on or make changes to this bug.
Description
•