windowIDs getter on shared worker crashes the content process
Categories
(Core :: DOM: Workers, defect)
Tracking
()
People
(Reporter: jdescottes, Unassigned)
References
Details
For Bug 1936766, I am starting to monitor workers in content processes via nsIWorkerDebuggerManager. However when I get a notification about a shared worker, trying to read windowIDs crashes the content process in my browser mochitests.
I see devtools is already working around this by only accessing windowIDs for dedicated workers and skipping shared workers: https://searchfox.org/firefox-main/rev/7709f0a26aeb3c39a5fd86e794425530f0d0b528/devtools/server/connectors/js-process-actor/target-watchers/worker.sys.mjs#364,377-379,384-385,398-402
if (dbg.type === TYPE_DEDICATED) {
...
dbg.windowIDs.includes(
subBrowsingContext.currentWindowContext.innerWindowId
)
...
return false;
}
...
if (dbg.type === TYPE_SHARED) {
// Bug 1607778 - Don't expose shared workers when debugging a tab.
// For now, they are only exposed in the browser toolbox, when Session Context Type is set to "all".
return false;
}
| Reporter | ||
Comment 1•6 days ago
•
|
||
Assertion failure:
Assertion failure: mRemoteWorkerController, at /builds/worker/checkouts/gecko/dom/workers/WorkerPrivate.cpp:6475
https://searchfox.org/firefox-main/rev/7709f0a26aeb3c39a5fd86e794425530f0d0b528/dom/workers/WorkerPrivate.cpp#6473-6477
RemoteWorkerChild* WorkerPrivate::GetRemoteWorkerController() {
AssertIsOnMainThread();
MOZ_ASSERT(mRemoteWorkerController);
return mRemoteWorkerController;
}
And stack trace in debug mode:
0:25.77 GECKO(9490) #01: mozilla::dom::WorkerPrivate::GetRemoteWorkerController() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x57eb008)
0:25.77 GECKO(9490) #02: mozilla::dom::WorkerDebugger::GetWindowIDs(nsTArray<unsigned long long>&) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x57b4624)
0:25.77 GECKO(9490) #03: _NS_InvokeByIndex (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x568630)
0:25.77 GECKO(9490) #04: CallMethodHelper::Call() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x11f2524)
0:25.77 GECKO(9490) #05: XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x11f21f8)
0:25.77 GECKO(9490) [Parent 9490, RemoteLzyStream] WARNING: [1.1]: GetUserData call for port 'D9C1F6D1E6FCE1B3.CA3ADBFFFB358BC2' failed: file /builds/worker/checkouts/gecko/ipc/glue/NodeController.cpp:428
0:25.77 GECKO(9490) #06: XPC_WN_GetterSetter(JSContext*, unsigned int, JS::Value*) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x11f48b4)
0:25.77 GECKO(9490) #07: CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f2d458)
0:25.77 GECKO(9490) #08: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f2cd08)
0:25.77 GECKO(9490) #09: js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f2e08c)
0:25.77 GECKO(9490) #10: js::CallGetter(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::MutableHandle<JS::Value>) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f2f2dc)
0:25.77 GECKO(9490) #11: bool GetExistingProperty<(js::AllowGC)1>(JSContext*, js::MaybeRooted<JS::Value, (js::AllowGC)1>::HandleType, js::MaybeRooted<js::NativeObject*, (js::AllowGC)1>::HandleType, js::MaybeRooted<JS::PropertyKey, (js::AllowGC)1>::HandleType, js::PropertyInfoBase (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x831a4b0)
0:25.77 GECKO(9490) #12: bool NativeGetPropertyInline<(js::AllowGC)1>(JSContext*, js::MaybeRooted<js::NativeObject*, (js::AllowGC)1>::HandleType, js::MaybeRooted<JS::Value, (js::AllowGC)1>::HandleType, js::MaybeRooted<JS::PropertyKey, (js::AllowGC)1>::HandleType, IsNameLookup, js (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x831abf8)
0:25.77 GECKO(9490) #13: js::GetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, js::PropertyName*, JS::MutableHandle<JS::Value>) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x70bee3c)
0:25.77 GECKO(9490) #14: js::GetProperty(JSContext*, JS::Handle<JS::Value>, JS::Handle<js::PropertyName*>, JS::MutableHandle<JS::Value>) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f4b468)
0:25.77 GECKO(9490) #15: js::Interpret(JSContext*, js::RunState&) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f39e0c)
0:25.77 GECKO(9490) #16: js::RunScript(JSContext*, js::RunState&) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f2c414)
0:25.77 GECKO(9490) #17: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f2cd18)
0:25.77 GECKO(9490) #18: js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x7f2e08c)
0:25.77 GECKO(9490) #19: JS_CallFunctionValue(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x81a3804)
0:25.77 GECKO(9490) #20: nsXPCWrappedJS::CallMethod(unsigned short, nsXPTMethodInfo const*, nsXPTCMiniVariant*) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x11eac4c)
0:25.77 GECKO(9490) #21: PrepareAndDispatch (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x56927c)
0:25.77 GECKO(9490) #22: SharedStub (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x568680)
0:25.77 GECKO(9490) #23: mozilla::dom::WorkerDebuggerManager::RegisterDebuggerMainThread(mozilla::dom::WorkerPrivate*, bool) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x57b73bc)
0:25.77 GECKO(9490) #24: mozilla::dom::WorkerPrivate::Constructor(JSContext*, nsTSubstring<char16_t> const&, bool, mozilla::dom::WorkerKind, mozilla::dom::RequestCredentials, mozilla::dom::WorkerType, nsTSubstring<char16_t> const&, nsTSubstring<char> const&, mozilla::dom::WorkerL (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x57d82d8)
0:25.77 GECKO(9490) #25: mozilla::dom::RemoteWorkerChild::ExecWorkerOnMainThread(mozilla::dom::RemoteWorkerData&&, mozilla::ipc::Endpoint<mozilla::dom::PRemoteWorkerNonLifeCycleOpControllerChild>&&) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x580b900)
0:25.77 GECKO(9490) #26: mozilla::detail::RunnableFunction<mozilla::dom::RemoteWorkerChild::ExecWorker(mozilla::dom::RemoteWorkerData const&, mozilla::ipc::Endpoint<mozilla::dom::PRemoteWorkerNonLifeCycleOpControllerChild>&&)::$_0>::Run() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x5822e5c)
0:25.77 GECKO(9490) #27: mozilla::RunnableTask::Run() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x519dec)
0:25.77 GECKO(9490) #28: mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x5142fc)
0:25.77 GECKO(9490) #29: mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x5119cc)
0:25.77 GECKO(9490) #30: mozilla::TaskController::ProcessPendingMTTask(bool) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x511e58)
0:25.78 GECKO(9490) #31: mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_1>::Run() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x524bd4)
0:25.78 GECKO(9490) #32: nsThread::ProcessNextEvent(bool, bool*) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x53b3d8)
0:25.78 GECKO(9490) #33: NS_ProcessNextEvent(nsIThread*, bool) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x54156c)
0:25.78 GECKO(9490) #34: mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x105c858)
0:25.78 GECKO(9490) #35: MessageLoop::RunInternal() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0xfcb6dc)
0:25.78 GECKO(9490) #36: MessageLoop::Run() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0xfcb5d4)
0:25.78 GECKO(9490) #37: nsBaseAppShell::Run() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x5ded63c)
0:25.78 GECKO(9490) #38: nsAppShell::Run() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x5e6bab4)
0:25.78 GECKO(9490) #39: XRE_RunAppShell() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x6fe8304)
0:25.78 GECKO(9490) #40: mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x105d1f4)
0:25.78 GECKO(9490) #41: MessageLoop::RunInternal() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0xfcb6dc)
0:25.78 GECKO(9490) #42: MessageLoop::Run() (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0xfcb5d4)
0:25.78 GECKO(9490) #43: XRE_InitChildProcess(int, char**, XREChildData const*) (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/XUL + 0x6fe719c)
0:25.78 GECKO(9490) #44: main (/Users/juliandescottes/Development/mozilla/hg/mozilla-unified/objdir.noindex/dist/NightlyDebug.app/Contents/MacOS/plugin-container.app/Contents/MacOS/plugin-container + 0x6cc)
Description
•