Closed Bug 1617067 Opened 4 years ago Closed 3 years ago

Assertion failure: IsSameOrigin(*match, aClientUrl), at src/dom/serviceworkers/ServiceWorkerManager.cpp:239

Categories

(Core :: DOM: Service Workers, defect, P2)

defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox75 --- affected

People

(Reporter: tsmith, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, crash, testcase, Whiteboard: [bugmon:confirmed])

Attachments

(2 files)

Attached file testcase.html

Reduced with m-c 20200220-b532be9d2719

Test case must be served via a HTTP server.

Assertion failure: IsSameOrigin(*match, aClientUrl), at src/dom/serviceworkers/ServiceWorkerManager.cpp:239

#0 mozilla::dom::ServiceWorkerManager::RegistrationDataPerPrincipal::ScopeContainer::MatchScope(nsTSubstring<char> const&) const src/dom/serviceworkers/ServiceWorkerManager.cpp:239:7
#1 mozilla::dom::ServiceWorkerManager::FindScopeForPath(nsTSubstring<char> const&, nsTSubstring<char> const&, mozilla::dom::ServiceWorkerManager::RegistrationDataPerPrincipal**, nsTSubstring<char>&) src/dom/serviceworkers/ServiceWorkerManager.cpp:1813:54
#2 mozilla::dom::ServiceWorkerManager::GetServiceWorkerRegistrationInfo(nsTSubstring<char> const&, nsIURI*) const src/dom/serviceworkers/ServiceWorkerManager.cpp:1716:8
#3 mozilla::dom::ServiceWorkerManager::GetServiceWorkerRegistrationInfo(nsIPrincipal*, nsIURI*) const src/dom/serviceworkers/ServiceWorkerManager.cpp:1700:10
#4 mozilla::dom::ServiceWorkerManager::IsAvailable(nsIPrincipal*, nsIURI*) src/dom/serviceworkers/ServiceWorkerManager.cpp:2271:7
#5 mozilla::dom::ServiceWorkerInterceptController::ShouldPrepareForIntercept(nsIURI*, nsIChannel*, bool*) src/dom/serviceworkers/ServiceWorkerInterceptController.cpp:44:21
#6 mozilla::net::HttpBaseChannel::ShouldIntercept(nsIURI*) src/netwerk/protocol/http/HttpBaseChannel.cpp:2836:31
#7 mozilla::net::nsHttpChannel::Connect() src/netwerk/protocol/http/nsHttpChannel.cpp:742:7
#8 mozilla::net::nsHttpChannel::ContinueOnBeforeConnect(bool, nsresult) src/netwerk/protocol/http/nsHttpChannel.cpp:709:10
#9 mozilla::net::nsHttpChannel::OnBeforeConnect() src/netwerk/protocol/http/nsHttpChannel.cpp:635:10
#10 mozilla::net::nsHttpChannel::PrepareToConnect() src/netwerk/protocol/http/nsHttpChannel.cpp:512:10
#11 mozilla::net::nsHttpChannel::ContinueBeginConnectWithResult() src/netwerk/protocol/http/nsHttpChannel.cpp:7135:10
#12 mozilla::net::nsHttpChannel::BeginConnect() src/netwerk/protocol/http/nsHttpChannel.cpp:6932:8
#13 mozilla::net::nsHttpChannel::OnProxyAvailable(nsICancelable*, nsIChannel*, nsIProxyInfo*, nsresult) src/netwerk/protocol/http/nsHttpChannel.cpp:7233:10
#14 mozilla::net::nsAsyncResolveRequest::DoCallback() src/netwerk/base/nsProtocolProxyService.cpp:403:18
#15 Run src/netwerk/base/nsProtocolProxyService.cpp:267:20
#16 mozilla::net::nsAsyncResolveRequest::ProcessLocally(mozilla::net::nsProtocolInfo&, nsIProxyInfo*, bool)::'lambda'(mozilla::net::nsAsyncResolveRequest*, nsIProxyInfo*, bool)::operator()(mozilla::net::nsAsyncResolveRequest*, nsIProxyInfo*, bool) const src/netwerk/base/nsProtocolProxyService.cpp:249:14
#17 operator() /builds/worker/fetches/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/std_function.h:706:14
#18 mozilla::net::nsAsyncResolveRequest::AsyncApplyFilters::Finish() src/netwerk/base/nsProtocolProxyService.cpp:597:10
#19 mozilla::net::nsAsyncResolveRequest::AsyncApplyFilters::ProcessNextFilter() src/netwerk/base/nsProtocolProxyService.cpp:507:14
#20 mozilla::net::nsAsyncResolveRequest::AsyncApplyFilters::AsyncProcess(mozilla::net::nsAsyncResolveRequest*) src/netwerk/base/nsProtocolProxyService.cpp:483:19
#21 mozilla::net::nsAsyncResolveRequest::ProcessLocally(mozilla::net::nsProtocolInfo&, nsIProxyInfo*, bool) src/netwerk/base/nsProtocolProxyService.cpp:258:33
#22 mozilla::net::nsProtocolProxyService::AsyncResolveInternal(nsIChannel*, unsigned int, nsIProtocolProxyCallback*, nsICancelable**, bool, nsIEventTarget*) src/netwerk/base/nsProtocolProxyService.cpp:1551:15
#23 mozilla::net::nsProtocolProxyService::AsyncResolve2(nsIChannel*, unsigned int, nsIProtocolProxyCallback*, nsIEventTarget*, nsICancelable**) src/netwerk/base/nsProtocolProxyService.cpp:1571:10
#24 mozilla::net::nsHttpChannel::ResolveProxy() src/netwerk/protocol/http/nsHttpChannel.cpp
#25 mozilla::net::nsHttpChannel::MaybeResolveProxyAndBeginConnect() src/netwerk/protocol/http/nsHttpChannel.cpp:6664:7
#26 operator() /builds/worker/fetches/clang/bin/../lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/std_function.h:706:14
#27 Exec src/netwerk/url-classifier/AsyncUrlChannelClassifier.cpp:490:23
#28 CompleteClassification src/netwerk/url-classifier/AsyncUrlChannelClassifier.cpp:690:20
#29 operator() src/netwerk/url-classifier/AsyncUrlChannelClassifier.cpp:819:38
#30 mozilla::detail::RunnableFunction<mozilla::net::AsyncUrlChannelClassifier::CheckChannel(nsIChannel*, std::function<void ()>&&)::$_0::operator()() const::'lambda'()>::Run() src/obj-firefox/dist/include/nsThreadUtils.h:559:5
#31 nsThread::ProcessNextEvent(bool, bool*) src/xpcom/threads/nsThread.cpp:1220:14
#32 NS_ProcessNextEvent(nsIThread*, bool) src/xpcom/threads/nsThreadUtils.cpp:481:10
#33 mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) src/ipc/glue/MessagePump.cpp:87:21
#34 RunInternal src/ipc/chromium/src/base/message_loop.cc:315:10
#35 RunHandler src/ipc/chromium/src/base/message_loop.cc:308:3
#36 MessageLoop::Run() src/ipc/chromium/src/base/message_loop.cc:290:3
#37 nsBaseAppShell::Run() src/widget/nsBaseAppShell.cpp:137:27
#38 nsAppStartup::Run() src/toolkit/components/startup/nsAppStartup.cpp:272:30
#39 XREMain::XRE_mainRun() src/toolkit/xre/nsAppRunner.cpp:4566:22
#40 XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) src/toolkit/xre/nsAppRunner.cpp:4701:8
#41 XRE_main(int, char**, mozilla::BootstrapConfig const&) src/toolkit/xre/nsAppRunner.cpp:4752:21
#42 do_main src/browser/app/nsBrowserApp.cpp:217:22
#43 main src/browser/app/nsBrowserApp.cpp:331:16
Flags: in-testsuite?
Attached file empty.js

A Pernosco session is available here: https://pernos.co/debug/y4A0kqbHJGvFMxjlFbwIOw/index.html

PopulateFromOrigin returned false, thus we return nullptr. To signal what exactly? We have a correctly populated originNoSuffix, it seems, which is the only thing that matters in the following code. So what wants PopulateFromOrigin tell us with the false return value?

Interesting: the BasePrincipal::CreateContentPrincipal has been created once as BasePrincipal::CreateCodebasePrincipal as part of bug 1178533, which talks about signed packages handling. It has then been renamed, probably because it seemed useful also for other use cases. The 'return nullptr;' is legacy from the first version and might not be the correct handling in all (generalized) cases?

Flags: needinfo?(echuang)
Assignee: nobody → echuang
Flags: needinfo?(echuang)
Priority: -- → P2
Severity: normal → S3
Assignee: echuang → nobody
Flags: needinfo?(bugmail)

Bugmon Analysis:
Unable to reproduce bug using the following builds:

mozilla-central 20210224215151-69be3221f49a
mozilla-central 20200227033937-7a5cb26a2d51

Whiteboard: [bugmon:confirmed]

This seems to have been fixed elsewhere more than a year ago.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(bugmail)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: