Closed
Bug 1151916
Opened 10 years ago
Closed 10 years ago
Refreshing a webpage using service worker's caches API breaks when using caches.open() or caches;
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(firefox40 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: salva, Assigned: nsm)
References
Details
Attachments
(1 file, 1 obsolete file)
STR
0. Load the following custom prefs into Gaia
user_pref('dom.caches.enabled', true);
user_pref('dom.serviceWorkers.enabled', true);
user_pref('dom.serviceWorkers.testing.enabled', true);
user_pref('network.disable.ipc.security', true);
1. Tap on the search bar
2. Visit http://lodr.github.io/open-crash
3. Once the page is loaded, tap on the refresh button
4. Close the browser
5. Visit http://lodr.github.io/open-crash again
6. Once loaded, tap on refresh
Expected:
The page refreshes properly.
Actual:
The page crashes. If you observe the traces in adb logcat, you can see how the last trace is `Before open...`
Reporter | ||
Comment 1•10 years ago
|
||
Do you think this could be related with bug 1151892?
Flags: needinfo?(amarchesini)
Comment 2•10 years ago
|
||
I have the same STR with other app only with \caches;\ in the 'fetch' handler without opening the cache:
URL: https://music.hostedweb.tid.es
Code of SW: https://music.hostedweb.tid.es/offliner-worker.js
I/Browser ( 1871): Content JS LOG: Offliner running!
I/Browser ( 1871): at <anonymous> (https://music.hostedweb.tid.es/offliner-worker.js:5:1)
I/Browser ( 1871): Content JS LOG: Offliner attached all listeners!
I/Browser ( 1871): at <anonymous> (https://music.hostedweb.tid.es/offliner-worker.js:78:1)
I/Browser ( 1871): Content JS LOG: Offliner > Fetch method 1 https://music.hostedweb.tid.es/
I/Browser ( 1871): at <anonymous> (https://music.hostedweb.tid.es/offliner-worker.js:32:3)
I/Gecko ( 1122):
I/Gecko ( 1122): ###!!! [Parent][MessageChannel] Error: Channel error: cannot send/recv
I/Gecko ( 1122):
I/Gecko ( 1122): ############ ErrorPage.js
I/Gecko ( 1122): [Parent 1122] WARNING: pipe error (95): Connection reset by peer: file ../../../gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 456
I/GeckoDump( 1122): Crash reporter : Can't fetch app.reportCrashes. Exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getBoolPref]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: chrome://b2g/content/shell.js :: shell_reportCrash :: line 146" data: no]
Comment 3•10 years ago
|
||
Same happens from Browser or when the app has been installed as trusted hosted app
Updated•10 years ago
|
Summary: Refreshing a webpage using service worker's caches API breaks when using caches.open() → Refreshing a webpage using service worker's caches API breaks when using caches.open() or caches;
Comment 4•10 years ago
|
||
bkelly knows more about cache. Moving the NI.
Flags: needinfo?(amarchesini) → needinfo?(bkelly)
Comment 5•10 years ago
|
||
I'm traveling at the moment and I don't have my flame with me. I'll have to check next week.
Does this effect the desktop browser in e10s mode?
Comment 6•10 years ago
|
||
If you could get a stack trace of the crash, I could try to look at it sooner. Sadly, I don't remember how to get a stack trace from a b2g crash.
Flags: needinfo?(salva)
Comment 7•10 years ago
|
||
Ben, I have reproduced a crash in Firefox Desktop Nightly following the steps in the description but replacing http with https in the URL that Salva posted.
I am not sure if it's exactly the same issue but just in case, it can help you. The crash report is available at: https://crash-stats.mozilla.com/report/index/e1acfe9f-b5e4-48f3-aabb-13f682150408
By the way, I also have crashes in nightly using the URL included by Cristian in comment 2.
Comment 8•10 years ago
|
||
This is crashing on WorkerPrivate::GetPrincipalInfo():
https://dxr.mozilla.org/mozilla-central/source/dom/workers/WorkerPrivate.h#574
Because the mInfo.mPrincipalInfo is nullptr. This should not be possible, though, because mPrincipalInfo is always initialized in WorkerPrivate::SetPrincipal().
So it seems script is running before SetPrincipal() is called!
This is most likely fallout from bug 931249.
Reporter | ||
Comment 9•10 years ago
|
||
I think Maria already provided what you need. Clearing ni.
Flags: needinfo?(salva)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nsm.nikhil
Flags: needinfo?(nsm.nikhil)
Assignee | ||
Comment 10•10 years ago
|
||
/r/6927 - Bug 1151916 - Set worker principalinfo on cache load. r=bkelly
Pull down this commit:
hg pull -r 89f2f6e2e5d59e7a61f2b3125a286cb7d7d816eb https://reviewboard-hg.mozilla.org/gecko/
Attachment #8591086 -
Flags: review?(bkelly)
Comment 11•10 years ago
|
||
Comment on attachment 8591086 [details]
MozReview Request: bz://1151916/nsm
https://reviewboard.mozilla.org/r/6925/#review5771
r=me with the one comment address and a test case that triggers the failure. It seems getting a cached SW to load and accessing `self.caches` is enough of a test case.
::: dom/workers/ScriptLoader.cpp
(Diff revision 1)
> + mWorkerPrivate->SetPrincipal(principal, loadGroup);
I think maybe we should only do this in the same success case as where we call `mWorkerPrivate->SetBaseURI()` above. I don't think we should call `SetPrincipal()` if an error occurrs.
Attachment #8591086 -
Flags: review?(bkelly) → review+
Updated•10 years ago
|
Status: NEW → ASSIGNED
Comment 13•10 years ago
|
||
Nikhil, is the test proving difficult? I'd be ok doing that in a follow-up if it means we can fix this issue soon. I think this bug is probably making it difficult to do any SW development in Nightly Firefox right now.
Flags: needinfo?(nsm.nikhil)
Assignee | ||
Comment 14•10 years ago
|
||
Assignee | ||
Comment 15•10 years ago
|
||
Test was involved but easy, just waiting on try now.
Flags: needinfo?(nsm.nikhil)
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(amarchesini)
Assignee | ||
Comment 16•10 years ago
|
||
Reporter | ||
Updated•10 years ago
|
Blocks: nga-toolkit-service-workers
Comment 17•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Assignee | ||
Comment 18•9 years ago
|
||
Attachment #8591086 -
Attachment is obsolete: true
Attachment #8619980 -
Flags: review+
Assignee | ||
Comment 19•9 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•