Closed Bug 1598516 Opened 10 months ago Closed 10 months ago

Switch DocumentChannel to use a list of disallowed types

Categories

(Core :: Networking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla73
Fission Milestone M4.1
Tracking Status
firefox73 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

(Blocks 1 open bug)

Details

Crash Data

Attachments

(8 files)

DocumentChannel works for most protocols now, so we should enable as many as we can and use a list of types that we explicitly disallow instead.

Without DocumentChannel, nsExtProtocolChannel::OpenURL calls into nsExternalHelperAppService::LoadURI in the content process.
We then manually forward this to the parent process over PContent, create a RemoteWindowContext around the browser parent, and then call LoadURI again.

With DocumemntChannel, the nsExtProtocolChannel already lives in the parent, so we just need to provide a RemoteWindowContext directly (that the code accesses via GetInterface on the callbacks).

Depends on D54246

Previously this error occurred synchronously during AsyncOpen, and we handled it there.
With DocumentChannel we don't find out until it's handled in the parent, so the error is returned to the docshell via a failed status on the request.

Depends on D54247

Looks like this can sometimes fail with moz-extension URIs, so we shouldn't crash

Depends on D54248

Depends on D54249

Without DocumentChannel, we create the real channel in the content process, which fully resolves the URI and so tabbrowser can see this as the URI.

With DocumentChannel, we only create the real channel in the parent, so the initial onStateChange only has the provided URI (which is still about:<page>).

I'm not sure if this is the best fix though.

Other options:

  • Create a temporary real channel in DocumentChannelChild just to get the resolved URI correct.
  • Avoid firing onStateChange until DocumentChannel responds with the resolved URI.
  • Add a new way to resolve just the URI without creating a channel.

Depends on D54250

Blocks: 1596454
Fission Milestone: --- → M5

Changing to M4.1 because it blocks a M4.1 mochitests bug.

Fission Milestone: M5 → M4.1
Priority: P3 → P2
Attachment #9110753 - Attachment description: Bug 1598516 - Manually resolve about: URIs in the frontend. r?kmag,Gijs → Bug 1598516 - Remove isLocalAboutURI since all about: URIs are local. r?Gijs
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b235cf22b0e4
Enable DocumentChannel for all protocols, except for list of known issues. r=kmag
https://hg.mozilla.org/integration/autoland/rev/6ba74ff735ba
Expose a RemoteWindowContext on ParentChannelListener. r=mayhemer,kmag
https://hg.mozilla.org/integration/autoland/rev/72f2256ae171
Handle malformed uri load error with an error page. r=kmag
https://hg.mozilla.org/integration/autoland/rev/e19ada9e8b30
Don't crash if NS_NewChannelInternal fails. r=mayhemer
https://hg.mozilla.org/integration/autoland/rev/894aaa4bc62e
Add DocumentChannel MOZ_LOGs. r=jya
https://hg.mozilla.org/integration/autoland/rev/63a84cdfd937
Remove isLocalAboutURI since all about: URIs are local. r=Gijs
Blocks: 1596932
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/943b440179b9
Enable DocumentChannel for all protocols, except for list of known issues. r=kmag
https://hg.mozilla.org/integration/autoland/rev/b664c8af6e2d
Expose a RemoteWindowContext on ParentChannelListener. r=mayhemer,kmag
https://hg.mozilla.org/integration/autoland/rev/1dc19a039cab
Handle malformed uri load error with an error page. r=kmag
https://hg.mozilla.org/integration/autoland/rev/0a0f80b0b278
Don't crash if NS_NewChannelInternal fails. r=mayhemer
https://hg.mozilla.org/integration/autoland/rev/cc2599921b5e
Add DocumentChannel MOZ_LOGs. r=jya
https://hg.mozilla.org/integration/autoland/rev/e48c0ce38498
Remove isLocalAboutURI since all about: URIs are local. r=Gijs
https://hg.mozilla.org/integration/autoland/rev/b62c5b49b91c
Make Quitter extension retry sending the quit message in case the background script wasn't ready yet. r=mixedpuppy
https://hg.mozilla.org/integration/autoland/rev/7ac1b091aa5f
Don't run extension iframes in their own process. r=kmag

Backed out 8 changesets (bug 1598516) for build bustage at ParentChannelListener.cpp on a CLOSED TREE.

Backout link: https://hg.mozilla.org/integration/autoland/rev/dd7bf37dadb0f64904181900a3861d4424c9c32e

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=7ac1b091aa5f91ddfac46ecdfdf3f14a2e5540d0&selectedJob=279401156

Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=279401156&repo=autoland&lineNumber=18869

Log snippet:

[task 2019-12-03T19:44:49.673Z] 19:44:49 INFO - media/webrtc/signaling/src/sdp/RsdparsaSdp.o
[task 2019-12-03T19:44:49.673Z] 19:44:49 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/media/webrtc/signaling/src/sdp'
[task 2019-12-03T19:44:49.688Z] 19:44:49 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/media/webrtc/signaling/gtest'
[task 2019-12-03T19:44:49.688Z] 19:44:49 INFO - media/webrtc/signaling/gtest/rtpsources_unittests.o
[task 2019-12-03T19:44:49.688Z] 19:44:49 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/media/webrtc/signaling/gtest'
[task 2019-12-03T19:44:49.809Z] 19:44:49 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/netwerk/protocol/http'
[task 2019-12-03T19:44:49.811Z] 19:44:49 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang++ -std=gnu++17 -m32 -o Unified_cpp_protocol_http2.o -c -I/builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers -I/builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DDEBUG=1 -DOS_POSIX=1 -DOS_LINUX=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/builds/worker/workspace/build/src/netwerk/protocol/http -I/builds/worker/workspace/build/src/obj-firefox/netwerk/protocol/http -I/builds/worker/workspace/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -I/builds/worker/workspace/build/src/ipc/chromium/src -I/builds/worker/workspace/build/src/ipc/glue -I/builds/worker/workspace/build/src/dom/base -I/builds/worker/workspace/build/src/extensions/auth -I/builds/worker/workspace/build/src/netwerk/base -I/builds/worker/workspace/build/src/netwerk/cookie -I/builds/worker/workspace/build/src/netwerk/ipc -I/builds/worker/workspace/build/src/netwerk/socket/neqo_glue -I/builds/worker/workspace/build/src/netwerk/url-classifier -I/builds/worker/workspace/build/src/obj-firefox/dist/include -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nspr -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-firefox/mozilla-config.h -Qunused-arguments -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fcrash-diagnostics-dir=/builds/worker/artifacts -march=pentium-m -msse -msse2 -mfpmath=sse -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -Xclang -load -Xclang /builds/worker/workspace/build/src/obj-firefox/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -Os -fno-omit-frame-pointer -funwind-tables -Werror -MD -MP -MF .deps/Unified_cpp_protocol_http2.o.pp Unified_cpp_protocol_http2.cpp
[task 2019-12-03T19:44:49.811Z] 19:44:49 INFO - In file included from Unified_cpp_protocol_http2.cpp:11:
[task 2019-12-03T19:44:49.812Z] 19:44:49 ERROR - /builds/worker/workspace/build/src/netwerk/protocol/http/ParentChannelListener.cpp:163:13: error: unknown type name 'RemoteWindowContext'; did you mean 'dom::RemoteWindowContext'?
[task 2019-12-03T19:44:49.812Z] 19:44:49 INFO - new RemoteWindowContext(mBrowserParent));
[task 2019-12-03T19:44:49.813Z] 19:44:49 INFO - ^~~~~~~~~~~~~~~~~~~
[task 2019-12-03T19:44:49.813Z] 19:44:49 INFO - dom::RemoteWindowContext
[task 2019-12-03T19:44:49.813Z] 19:44:49 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/ContentParent.h:1415:7: note: 'dom::RemoteWindowContext' declared here
[task 2019-12-03T19:44:49.814Z] 19:44:49 INFO - class RemoteWindowContext final : public nsIRemoteWindowContext,
[task 2019-12-03T19:44:49.814Z] 19:44:49 INFO - ^
[task 2019-12-03T19:44:49.814Z] 19:44:49 INFO - 1 error generated.
[task 2019-12-03T19:44:49.815Z] 19:44:49 INFO - /builds/worker/workspace/build/src/config/rules.mk:804: recipe for target 'Unified_cpp_protocol_http2.o' failed
[task 2019-12-03T19:44:49.815Z] 19:44:49 ERROR - make[4]: *** [Unified_cpp_protocol_http2.o] Error 1
[task 2019-12-03T19:44:49.815Z] 19:44:49 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/netwerk/protocol/http'
[task 2019-12-03T19:44:49.815Z] 19:44:49 INFO - /builds/worker/workspace/build/src/config/recurse.mk:74: recipe for target 'netwerk/protocol/http/target-objects' failed
[task 2019-12-03T19:44:49.816Z] 19:44:49 ERROR - make[3]: *** [netwerk/protocol/http/target-objects] Error 2
[task 2019-12-03T19:44:49.816Z] 19:44:49 INFO - make[3]: *** Waiting for unfinished jobs....
[task 2019-12-03T19:44:49.816Z] 19:44:49 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/media/webrtc/signaling/gtest'
[task 2019-12-03T19:44:49.816Z] 19:44:49 INFO - media/webrtc/signaling/gtest/sdp_unittests.o

Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf370938463e
Enable DocumentChannel for all protocols, except for list of known issues. r=kmag
https://hg.mozilla.org/integration/autoland/rev/74d136798dd3
Expose a RemoteWindowContext on ParentChannelListener. r=mayhemer,kmag
https://hg.mozilla.org/integration/autoland/rev/b6f84b01cbd9
Handle malformed uri load error with an error page. r=kmag
https://hg.mozilla.org/integration/autoland/rev/76b86080c868
Don't crash if NS_NewChannelInternal fails. r=mayhemer
https://hg.mozilla.org/integration/autoland/rev/4e269a638350
Add DocumentChannel MOZ_LOGs. r=jya
https://hg.mozilla.org/integration/autoland/rev/31c11dd9146d
Remove isLocalAboutURI since all about: URIs are local. r=Gijs
https://hg.mozilla.org/integration/autoland/rev/33603b723337
Make Quitter extension retry sending the quit message in case the background script wasn't ready yet. r=mixedpuppy
https://hg.mozilla.org/integration/autoland/rev/bc0035aa57fe
Don't run extension iframes in their own process. r=kmag

Backed out 8 changesets (Bug 1598516) for run startup hangs

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=linux%2Crun&fromchange=d2f8a8875708e694346e9ec7b5d5d0761e3662ca&tochange=09111adf1bd1502668e50d0983afc0bc97b99694&selectedJob=279424792

Backout link: https://hg.mozilla.org/integration/autoland/rev/9cead615dadbd3652e527c97f05f55434415729a

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=279424792&repo=autoland&lineNumber=310

[task 2019-12-03T21:29:09.584Z] Installing setuptools, pip, wheel...done.
[task 2019-12-03T21:29:10.597Z] running build_ext
[task 2019-12-03T21:29:10.597Z] building 'psutil._psutil_linux' extension
[task 2019-12-03T21:29:10.597Z] creating build
[task 2019-12-03T21:29:10.597Z] creating build/temp.linux-x86_64-2.7
[task 2019-12-03T21:29:10.597Z] creating build/temp.linux-x86_64-2.7/psutil
[task 2019-12-03T21:29:10.597Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=563 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
[task 2019-12-03T21:29:10.597Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=563 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_posix.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o
[task 2019-12-03T21:29:10.597Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=563 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o
[task 2019-12-03T21:29:10.597Z] creating build/lib.linux-x86_64-2.7
[task 2019-12-03T21:29:10.597Z] creating build/lib.linux-x86_64-2.7/psutil
[task 2019-12-03T21:29:10.597Z] x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/psutil/_psutil_common.o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o -o build/lib.linux-x86_64-2.7/psutil/_psutil_linux.so
[task 2019-12-03T21:29:10.597Z] building 'psutil._psutil_posix' extension
[task 2019-12-03T21:29:10.597Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=563 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
[task 2019-12-03T21:29:10.597Z] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=563 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_posix.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o
[task 2019-12-03T21:29:10.597Z] x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/psutil/_psutil_common.o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o -o build/lib.linux-x86_64-2.7/psutil/_psutil_posix.so
[task 2019-12-03T21:29:10.597Z] copying build/lib.linux-x86_64-2.7/psutil/_psutil_linux.so -> psutil
[task 2019-12-03T21:29:10.597Z] copying build/lib.linux-x86_64-2.7/psutil/_psutil_posix.so -> psutil
[task 2019-12-03T21:29:10.597Z]
[task 2019-12-03T21:29:10.597Z] Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt)
[taskcluster:error] Task timeout after 1200 seconds. Force killing container.
[taskcluster 2019-12-03 21:48:37.433Z] === Task Finished ===
[taskcluster 2019-12-03 21:48:37.434Z] Unsuccessful task run with exit code: -1 completed in 1218.749 seconds

Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9a9051421265
Enable DocumentChannel for all protocols, except for list of known issues. r=kmag
https://hg.mozilla.org/integration/autoland/rev/fd3b7af6c012
Expose a RemoteWindowContext on ParentChannelListener. r=mayhemer,kmag
https://hg.mozilla.org/integration/autoland/rev/3422602420a0
Handle malformed uri load error with an error page. r=kmag
https://hg.mozilla.org/integration/autoland/rev/dfb2624a9857
Don't crash if NS_NewChannelInternal fails. r=mayhemer
https://hg.mozilla.org/integration/autoland/rev/abece0ceac3d
Add DocumentChannel MOZ_LOGs. r=jya
https://hg.mozilla.org/integration/autoland/rev/dfee5b58e921
Remove isLocalAboutURI since all about: URIs are local. r=Gijs
https://hg.mozilla.org/integration/autoland/rev/e100ba2fc666
Make Quitter extension retry sending the quit message in case the background script wasn't ready yet. r=mixedpuppy
https://hg.mozilla.org/integration/autoland/rev/94663676950d
Don't run extension iframes in their own process. r=kmag
Duplicate of this bug: 1600571
Crash Signature: [@ mozilla::dom::ContentChild::RecvCrossProcessRedirect]
Regressions: 1601959
Flags: needinfo?(matt.woodrow)
Regressions: 1601243
Regressions: 1601252
You need to log in before you can comment on or make changes to this bug.