Closed Bug 1171486 Opened 5 years ago Closed 5 years ago

Startup crash with service workers registered because of recursive initialization of the service worker manager service

Categories

(Core :: DOM: Service Workers, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

Attachments

(2 files)

I hit these two assertions at startup when debugging a test:

[31317] ###!!! ASSERTION: Recursive GetService!: 'Error', file /Users/ehsan/moz/src/xpcom/components/nsComponentManager.cpp, line 1546
#01: nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x177196]
#02: CallGetService(char const*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2089f1]
#03: nsGetServiceByContractID::operator()(nsID const&, void**) const[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2064a8]
#04: nsCOMPtr<nsIServiceWorkerManager>::assign_from_gs_contractid(nsGetServiceByContractID, nsID const&)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1fda23]
#05: nsCOMPtr<nsIServiceWorkerManager>::nsCOMPtr(nsGetServiceByContractID)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1fd9e1]
#06: nsCOMPtr<nsIServiceWorkerManager>::nsCOMPtr(nsGetServiceByContractID)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1f623d]
#07: mozilla::services::GetServiceWorkerManager()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1e65a8]
#08: mozilla::dom::workers::ServiceWorkerManager::GetInstance()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37a464f]
#09: mozilla::dom::workers::ServiceWorkerManager::AddScopeAndRegistration(nsACString_internal const&, mozilla::dom::workers::ServiceWorkerRegistrationInfo*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37aed13]
#10: mozilla::dom::workers::ServiceWorkerManager::CreateNewRegistration(nsCString const&, nsIPrincipal*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37adc31]
#11: mozilla::dom::workers::ServiceWorkerManager::LoadRegistrations(nsTArray<mozilla::dom::ServiceWorkerRegistrationData> const&)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37a5ac0]
#12: mozilla::dom::workers::ServiceWorkerManager::ServiceWorkerManager()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37a53fc]
#13: mozilla::dom::workers::ServiceWorkerManager::ServiceWorkerManager()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37a5c45]
#14: mozilla::dom::workers::ServiceWorkerManager::FactoryCreate()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4397bda]
#15: ServiceWorkerManagerConstructor(nsISupports*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x43928ca]
#16: mozilla::GenericFactory::CreateInstance(nsISupports*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ec4ce]
#17: nsComponentManagerImpl::CreateInstanceByContractID(char const*, nsISupports*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x17b9f2]
#18: nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x177422]
#19: CallGetService(char const*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2089f1]
#20: nsGetServiceByContractID::operator()(nsID const&, void**) const[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2064a8]
#21: nsCOMPtr<nsIServiceWorkerManager>::assign_from_gs_contractid(nsGetServiceByContractID, nsID const&)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1fda23]
#22: nsCOMPtr<nsIServiceWorkerManager>::nsCOMPtr(nsGetServiceByContractID)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1fd9e1]
#23: nsCOMPtr<nsIServiceWorkerManager>::nsCOMPtr(nsGetServiceByContractID)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1f623d]
#24: mozilla::services::GetServiceWorkerManager()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1e65a8]
#25: nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1b3dbff]
#26: nsGlobalWindow::SetNewDocument(nsIDocument*, nsISupports*, bool)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1943493]
#27: non-virtual thunk to nsGlobalWindow::SetNewDocument(nsIDocument*, nsISupports*, bool)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1945796]
#28: nsDocumentViewer::InitInternal(nsIWidget*, nsISupports*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, bool, bool, bool)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3fbc474]
#29: nsDocumentViewer::Init(nsIWidget*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3fbb9a4]
#30: nsDocShell::SetupNewViewer(nsIContentViewer*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x46a7791]
#31: nsDocShell::Embed(nsIContentViewer*, char const*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x46a650b]
#32: nsDocShell::CreateContentViewer(nsACString_internal const&, nsIRequest*, nsIStreamListener**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4676da4]
#33: nsDSURIContentListener::DoContent(nsACString_internal const&, bool, nsIRequest*, nsIStreamListener**, bool*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x46757d9]
#34: nsDocumentOpenInfo::TryContentListener(nsIURIContentListener*, nsIChannel*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1384996]
#35: nsDocumentOpenInfo::DispatchContent(nsIRequest*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1383135]
#36: nsDocumentOpenInfo::OnStartRequest(nsIRequest*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1382a7f]
#37: nsBaseChannel::OnStartRequest(nsIRequest*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2cdbd6]
#38: non-virtual thunk to nsBaseChannel::OnStartRequest(nsIRequest*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2cded7]
#39: nsInputStreamPump::OnStateStart()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x301d6c]
#40: nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x30188c]
#41: non-virtual thunk to nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3029ef]
#42: nsInputStreamReadyEvent::Run()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x16a3c0]
#43: nsThread::ProcessNextEvent(bool, bool*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x19b75f]
#44: NS_ProcessPendingEvents(nsIThread*, unsigned int)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x212d8a]
#45: nsBaseAppShell::NativeEventCallback()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3ad9cc9]
#46: nsAppShell::ProcessGeckoEvents(void*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3b594bd]
#47: __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x80a01]
#48: __CFRunLoopDoSources0[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x72b8d]
#49: __CFRunLoopRun[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x721bf]
#50: CFRunLoopRunSpecific[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x71bd8]
#51: RunCurrentEventLoopInMode[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x3256f]
#52: ReceiveNextEventCommon[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x321ee]
#53: _BlockUntilNextEventMatchingListInModeWithFilter[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x3212b]
#54: _DPSNextEvent[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x919bb]
#55: -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:][/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x90f68]
#56: -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:][/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3b57fd7]
#57: -[NSApplication run][/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x86bf3]
#58: nsAppShell::Run()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3b59e8c]
#59: nsAppStartup::Run()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4ba1c21]
#60: XREMain::XRE_mainRun()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c6f64d]
#61: XREMain::XRE_main(int, char**, nsXREAppData const*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c6ff92]
#62: XRE_main[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c70452]
#63: do_main(int, char**, nsIFile*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/firefox +0x294a]
#64: main[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/firefox +0x1d25]
Assertion failure: swm, at /Users/ehsan/moz/src/dom/workers/ServiceWorkerManager.cpp:2611
#01: mozilla::dom::workers::ServiceWorkerManager::AddScopeAndRegistration(nsACString_internal const&, mozilla::dom::workers::ServiceWorkerRegistrationInfo*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37aed7c]
#02: mozilla::dom::workers::ServiceWorkerManager::CreateNewRegistration(nsCString const&, nsIPrincipal*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37adc31]
#03: mozilla::dom::workers::ServiceWorkerManager::LoadRegistrations(nsTArray<mozilla::dom::ServiceWorkerRegistrationData> const&)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37a5ac0]
#04: mozilla::dom::workers::ServiceWorkerManager::ServiceWorkerManager()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37a53fc]
#05: mozilla::dom::workers::ServiceWorkerManager::ServiceWorkerManager()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x37a5c45]
#06: mozilla::dom::workers::ServiceWorkerManager::FactoryCreate()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4397bda]
#07: ServiceWorkerManagerConstructor(nsISupports*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x43928ca]
#08: mozilla::GenericFactory::CreateInstance(nsISupports*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ec4ce]
#09: nsComponentManagerImpl::CreateInstanceByContractID(char const*, nsISupports*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x17b9f2]
#10: nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x177422]
#11: CallGetService(char const*, nsID const&, void**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2089f1]
#12: nsGetServiceByContractID::operator()(nsID const&, void**) const[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2064a8]
#13: nsCOMPtr<nsIServiceWorkerManager>::assign_from_gs_contractid(nsGetServiceByContractID, nsID const&)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1fda23]
#14: nsCOMPtr<nsIServiceWorkerManager>::nsCOMPtr(nsGetServiceByContractID)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1fd9e1]
#15: nsCOMPtr<nsIServiceWorkerManager>::nsCOMPtr(nsGetServiceByContractID)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1f623d]
#16: mozilla::services::GetServiceWorkerManager()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1e65a8]
#17: nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1b3dbff]
#18: nsGlobalWindow::SetNewDocument(nsIDocument*, nsISupports*, bool)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1943493]
#19: non-virtual thunk to nsGlobalWindow::SetNewDocument(nsIDocument*, nsISupports*, bool)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1945796]
#20: nsDocumentViewer::InitInternal(nsIWidget*, nsISupports*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, bool, bool, bool)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3fbc474]
#21: nsDocumentViewer::Init(nsIWidget*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3fbb9a4]
#22: nsDocShell::SetupNewViewer(nsIContentViewer*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x46a7791]
#23: nsDocShell::Embed(nsIContentViewer*, char const*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x46a650b]
#24: nsDocShell::CreateContentViewer(nsACString_internal const&, nsIRequest*, nsIStreamListener**)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4676da4]
#25: nsDSURIContentListener::DoContent(nsACString_internal const&, bool, nsIRequest*, nsIStreamListener**, bool*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x46757d9]
#26: nsDocumentOpenInfo::TryContentListener(nsIURIContentListener*, nsIChannel*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1384996]
#27: nsDocumentOpenInfo::DispatchContent(nsIRequest*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1383135]
#28: nsDocumentOpenInfo::OnStartRequest(nsIRequest*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1382a7f]
#29: nsBaseChannel::OnStartRequest(nsIRequest*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2cdbd6]
#30: non-virtual thunk to nsBaseChannel::OnStartRequest(nsIRequest*, nsISupports*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2cded7]
#31: nsInputStreamPump::OnStateStart()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x301d6c]
#32: nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x30188c]
#33: non-virtual thunk to nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3029ef]
#34: nsInputStreamReadyEvent::Run()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x16a3c0]
#35: nsThread::ProcessNextEvent(bool, bool*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x19b75f]
#36: NS_ProcessPendingEvents(nsIThread*, unsigned int)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x212d8a]
#37: nsBaseAppShell::NativeEventCallback()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3ad9cc9]
#38: nsAppShell::ProcessGeckoEvents(void*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3b594bd]
#39: __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x80a01]
#40: __CFRunLoopDoSources0[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x72b8d]
#41: __CFRunLoopRun[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x721bf]
#42: CFRunLoopRunSpecific[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x71bd8]
#43: RunCurrentEventLoopInMode[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x3256f]
#44: ReceiveNextEventCommon[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x321ee]
#45: _BlockUntilNextEventMatchingListInModeWithFilter[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x3212b]
#46: _DPSNextEvent[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x919bb]
#47: -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:][/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x90f68]
#48: -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:][/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3b57fd7]
#49: -[NSApplication run][/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x86bf3]
#50: nsAppShell::Run()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3b59e8c]
#51: nsAppStartup::Run()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4ba1c21]
#52: XREMain::XRE_mainRun()[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c6f64d]
#53: XREMain::XRE_main(int, char**, nsXREAppData const*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c6ff92]
#54: XRE_main[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c70452]
#55: do_main(int, char**, nsIFile*)[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/firefox +0x294a]
#56: main[/Users/ehsan/moz/src/obj-ff-clang-plugin.noindex/dist/NightlyDebug.app/Contents/MacOS/firefox +0x1d25]

We should not call LoadRegistrations from the constructor, I think.

This issue hits us with any profile with registered service workers and the pref enabled, so we should fix it before re-enabling service workers.  I have a patch that I'm testing...
(In reply to Nikhil Marathe [:nsm] (needinfo? please) from comment #1)
> I believe this is already fixed by bug 1155153.

Perhaps, but the patch that I have is better in a few respects.  Let me finish testing it and submit it...
Here is why I think my patch is better: it eliminates the now unneeded UUID for the SWM object, it avoids going through the XPCOM service manager for the native consumers, and it eliminates the FactoryCreate method and just uses GetInstance() for obtaining an instance of the SWM no matter who wants to use it.
Comment on attachment 8615424 [details] [diff] [review]
Avoid recursively obtaining the service worker manager service

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

::: dom/workers/ServiceWorkerManager.cpp
@@ +2297,5 @@
> +  if (firstTime) {
> +    AssertIsOnMainThread();
> +
> +    gInstance = new ServiceWorkerManager();
> +    gInstance->Init();

This can be broken in case Init() needs to use GetInstance().
In my latest patch I propose a different approach, and I'm going to land it soon. Can you rebase your code on top of bug 1155153 ?
(In reply to Andrea Marchesini (:baku) from comment #5)
> Comment on attachment 8615424 [details] [diff] [review]
> Avoid recursively obtaining the service worker manager service
> 
> Review of attachment 8615424 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/workers/ServiceWorkerManager.cpp
> @@ +2297,5 @@
> > +  if (firstTime) {
> > +    AssertIsOnMainThread();
> > +
> > +    gInstance = new ServiceWorkerManager();
> > +    gInstance->Init();
> 
> This can be broken in case Init() needs to use GetInstance().
> In my latest patch I propose a different approach, and I'm going to land it
> soon. Can you rebase your code on top of bug 1155153 ?

Oops, sorry, I saw this after my autolander landed this patch.  :/

You're right though, did you mean that I should set the boolean flag before calling Init()?
Flags: needinfo?(amarchesini)
> You're right though, did you mean that I should set the boolean flag before
> calling Init()?

Take a look at what I did in bug 155153. Maybe still land my approach if that is ok for you.
Flags: needinfo?(amarchesini) → needinfo?(ehsan)
https://hg.mozilla.org/mozilla-central/rev/2096212a25cb
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
(In reply to Andrea Marchesini (:baku) from comment #8)
> > You're right though, did you mean that I should set the boolean flag before
> > calling Init()?
> 
> Take a look at what I did in bug 155153. Maybe still land my approach if
> that is ok for you.

Wrong bug number?  I did take a look at a bug that did something similar earlier today but I can't find it right now...  Do you mind pointing me to the specific code though?  IIRC that patch did a lot more than this.

That being said, I'm pretty sure comment 7 will fix it.  Let me make a quick patch.
Flags: needinfo?(ehsan)
Attachment #8615794 - Flags: review?(amarchesini) → review+
Duplicate of this bug: 1170493
You need to log in before you can comment on or make changes to this bug.