Closed Bug 1119729 Opened 10 years ago Closed 9 years ago

Service Workers are not registering in B2G OOP

Categories

(Core :: DOM: Core & HTML, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1137683

People

(Reporter: ferjm, Assigned: ferjm)

References

Details

Attachments

(3 files)

Trying to run https://ferjm.github.io/sw/app/index.html on a B2G maple based build throws this error that causes the service worker registration to fail:

 7648 Gecko  I  WARNING: child tried to open http IPDL channel w/o security info
 7648 Gec..  I  MainPage: Not registered: [Exception... "Illegal value"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "
             native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0"  data: no]

Enabling "network.disable.ipc.security" pref solves the issue.
Printing the principal at [1] gives me:

"ServiceWorkerManager CopyPrincipal - appId 1033 isInBrowserElement 1 uri https://ferjm.github.io"

[1] https://hg.mozilla.org/projects/maple/file/217342aa5d11/dom/workers/ServiceWorkerManager.cpp#l768
This works on desktop and we print

"ServiceWorkerManager CopyPrincipal - appId 0 isInBrowserElement 0 uri https://ferjm.github.io"
I bet it's https://hg.mozilla.org/projects/maple/file/217342aa5d11/dom/workers/ServiceWorkerManager.cpp#l629 which has no related loadgroup or callbacks associated with it, hence the IPDL security failure.
We'll need to grab a loadgroup from the document calling register(). Would you like to take a stab at this Fernando? You'll want to pass it in to the UpdateJob constructor, the way the principal is passed. Otherwise please assign it to me.

I'll likely land fixes only in central from this point on, since we are starting to move things to central and the buggy code is in Bug 1113555.
Flags: needinfo?(ferjmoreno)
Ok, thanks for the pointers Nikhil. I'll try to take look during this week, but I am fairly new to this implementation, so I might end up assigning it to you :|.
Assignee: nobody → ferjmoreno
Flags: needinfo?(ferjmoreno)
Fernando, did baku's patch fix this? Please close this if it did.
Flags: needinfo?(ferjmoreno)
I am not aware of any patch that fixes this issue. We were using the "network.disable.ipc.security" workaround so far.
Flags: needinfo?(ferjmoreno)
Attached patch v1Splinter Review
I'm not sure if this is what you meant in comment 4. Unfortunately, it doesn't fix the issue.
Attachment #8568477 - Flags: feedback?(nsm.nikhil)
Yes, I was testing on central. No more maple testing :) Unfortunately, bug 1133242 doesn't fix this issue.

We are not crashing in this case. What happens here is that we fail to register the service worker and we log this message: "WARNING: child tried to open http IPDL channel w/o security info". Which seems to be the cause of the registration failure.
Sure, but I am about to take a plane. I'll try and post the results here in a few hours. However, it seems that your patch is doing part of what my patch is also doing. Apart from passing the loadgroup associated with the document calling register when creating the new channel I also pass the principal, which is what your patch is doing. This didn't work for me, but I'll try without passing the loadgroup again.
Nikhil, I get the same error with both patches.
Flags: needinfo?(nsm.nikhil)
Summary: Service Workers are not registering in B2G OOP ( with maple branch) → Service Workers are not registering in B2G OOP
Comment on attachment 8568477 [details] [diff] [review]
v1

Review of attachment 8568477 [details] [diff] [review]:
-----------------------------------------------------------------

dropping flag since it doesn't fix the issue. Fernando, has the situation changed on this? I can try getting a build on my flame.
Attachment #8568477 - Flags: feedback?(nsm.nikhil)
Attached file Log
I gave this one another try and it seems that it might be a duplicate of bug 1125961. I attached a log where you can see that we are missing the TabChild instance at [1] and that's the reason why we fail the security checks and the service worker registration.

[1] https://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/HttpChannelChild.cpp#1560
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(nsm.nikhil)
Resolution: --- → DUPLICATE
Bug 1137683 is actually more relevant.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: