Closed Bug 1858809 Opened 11 months ago Closed 5 months ago

Assertion failure: aWorkerPrivate, at /builds/worker/checkouts/gecko/dom/workers/WorkerRunnable.cpp:62

Categories

(Core :: DOM: Workers, defect, P3)

defect

Tracking

()

VERIFIED FIXED
126 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox118 --- wontfix
firefox119 --- wontfix
firefox120 --- wontfix
firefox121 --- wontfix
firefox124 --- wontfix
firefox125 --- wontfix
firefox126 --- verified

People

(Reporter: tsmith, Assigned: asuth)

References

(Blocks 1 open bug, Regression)

Details

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

Attachments

(2 files)

Attached file testcase.html

Found while fuzzing m-c 20230824-1d5eb1343cc8 (--enable-debug --enable-fuzzing)

To reproduce via Grizzly Replay:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch -d --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html

Assertion failure: aWorkerPrivate, at /builds/worker/checkouts/gecko/dom/workers/WorkerRunnable.cpp:62

#0 0x7f8aef6d855d in mozilla::dom::WorkerRunnable::WorkerRunnable(mozilla::dom::WorkerPrivate*, mozilla::dom::WorkerRunnable::TargetAndBusyBehavior) /builds/worker/checkouts/gecko/dom/workers/WorkerRunnable.cpp:62:3
#1 0x7f8aef68bc39 in WorkerDebuggeeRunnable /builds/worker/checkouts/gecko/dom/workers/WorkerRunnable.h:466:9
#2 0x7f8aef68bc39 in mozilla::dom::EventWithOptionsRunnable::EventWithOptionsRunnable(mozilla::dom::Worker&) /builds/worker/checkouts/gecko/dom/workers/EventWithOptionsRunnable.cpp:35:7
#3 0x7f8aeecfa001 in mozilla::dom::RTCTransformEventRunnable::RTCTransformEventRunnable(mozilla::dom::Worker&, mozilla::FrameTransformerProxy*) /builds/worker/checkouts/gecko/dom/media/webrtc/jsapi/RTCTransformEventRunnable.cpp:33:7
#4 0x7f8aeec6858a in mozilla::dom::RTCRtpScriptTransform::Constructor(mozilla::dom::GlobalObject const&, mozilla::dom::Worker&, JS::Handle<JS::Value>, mozilla::dom::Optional<mozilla::dom::Sequence<JSObject*>> const&, mozilla::ErrorResult&) /builds/worker/checkouts/gecko/dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp:52:11
#5 0x7f8aeccceb05 in mozilla::dom::RTCRtpScriptTransform_Binding::_constructor(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/obj-build/dom/bindings/./RTCRtpScriptTransformBinding.cpp:207:67
#6 0x7f8af20c65b4 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:486:13
#7 0x7f8af20f29f9 in CallJSNativeConstructor(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), JS::CallArgs const&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:502:8
#8 0x7f8af20d6444 in ConstructFromStack /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:755:10
#9 0x7f8af20d6444 in js::Interpret(JSContext*, js::RunState&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:3392:16
#10 0x7f8af20c5422 in js::RunScript(JSContext*, js::RunState&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:458:13
#11 0x7f8af20c5ee9 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:612:13
#12 0x7f8af20c738d in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:679:8
#13 0x7f8af21adf74 in JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) /builds/worker/checkouts/gecko/js/src/vm/CallAndConstruct.cpp:119:10
#14 0x7f8aed64073c in mozilla::dom::EventListener::HandleEvent(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::dom::Event&, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/./EventListenerBinding.cpp:62:8
#15 0x7f8aedf8fbd6 in void mozilla::dom::EventListener::HandleEvent<mozilla::dom::EventTarget*>(mozilla::dom::EventTarget* const&, mozilla::dom::Event&, mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObject::ExceptionHandling, JS::Realm*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/EventListenerBinding.h:65:12
#16 0x7f8aedf8f792 in mozilla::EventListenerManager::HandleEventSingleListener(mozilla::EventListenerManager::Listener*, nsAtom*, mozilla::WidgetEvent*, mozilla::dom::Event*, mozilla::dom::EventTarget*, bool) /builds/worker/checkouts/gecko/dom/events/EventListenerManager.cpp:1342:43
#17 0x7f8aedf908d4 in mozilla::EventListenerManager::HandleEventWithListenerArray(mozilla::EventListenerManager::ListenerArray*, nsAtom*, mozilla::EventMessage, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, bool) /builds/worker/checkouts/gecko/dom/events/EventListenerManager.cpp:1663:12
#18 0x7f8aedf90149 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /builds/worker/checkouts/gecko/dom/events/EventListenerManager.cpp:1560:35
#19 0x7f8aedf836ef in HandleEvent /builds/worker/workspace/obj-build/dist/include/mozilla/EventListenerManager.h:465:5
#20 0x7f8aedf836ef in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /builds/worker/checkouts/gecko/dom/events/EventDispatcher.cpp:363:17
#21 0x7f8aedf82c6b in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /builds/worker/checkouts/gecko/dom/events/EventDispatcher.cpp:610:18
#22 0x7f8aedf85636 in mozilla::EventDispatcher::Dispatch(mozilla::dom::EventTarget*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /builds/worker/checkouts/gecko/dom/events/EventDispatcher.cpp:1225:11
#23 0x7f8aedf88a83 in mozilla::EventDispatcher::DispatchDOMEvent(mozilla::dom::EventTarget*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsPresContext*, nsEventStatus*) /builds/worker/checkouts/gecko/dom/events/EventDispatcher.cpp
#24 0x7f8aec5db839 in nsINode::DispatchEvent(mozilla::dom::Event&, mozilla::dom::CallerType, mozilla::ErrorResult&) /builds/worker/checkouts/gecko/dom/base/nsINode.cpp:1401:17
#25 0x7f8aec0f110c in nsContentUtils::DispatchEvent(mozilla::dom::Document*, mozilla::dom::EventTarget*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, mozilla::Trusted, bool*, mozilla::ChromeOnlyDispatch) /builds/worker/checkouts/gecko/dom/base/nsContentUtils.cpp:4636:29
#26 0x7f8aec0f0f72 in nsContentUtils::DispatchTrustedEvent(mozilla::dom::Document*, mozilla::dom::EventTarget*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, bool*) /builds/worker/checkouts/gecko/dom/base/nsContentUtils.cpp:4602:10
#27 0x7f8aec33ac84 in mozilla::dom::Document::DispatchContentLoadedEvents() /builds/worker/checkouts/gecko/dom/base/Document.cpp:8027:3
#28 0x7f8aec3eded9 in operator()<> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1164:18
#29 0x7f8aec3eded9 in __invoke_impl<void, (lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1163:9)> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:60:14
#30 0x7f8aec3eded9 in __invoke<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1163:9)> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:95:14
#31 0x7f8aec3eded9 in __apply_impl<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1163:9), std::tuple<> &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/tuple:1678:14
#32 0x7f8aec3eded9 in apply<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1163:9), std::tuple<> &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/tuple:1687:14
#33 0x7f8aec3eded9 in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1162:12
#34 0x7f8aec3eded9 in mozilla::detail::RunnableMethodImpl<mozilla::dom::Document*, void (mozilla::dom::Document::*)(), true, (mozilla::RunnableKind)0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1213:13
#35 0x7f8aea7444b7 in mozilla::RunnableTask::Run() /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:549:16
#36 0x7f8aea73c073 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:876:26
#37 0x7f8aea73a8b7 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:699:15
#38 0x7f8aea73ad15 in mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:485:36
#39 0x7f8aea7481c6 in operator() /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:211:37
#40 0x7f8aea7481c6 in mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.h:548:5
#41 0x7f8aea75ebd2 in nsThread::ProcessNextEvent(bool, bool*) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:1198:16
#42 0x7f8aea765cbd in NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:480:10
#43 0x7f8aeb418ed5 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /builds/worker/checkouts/gecko/ipc/glue/MessagePump.cpp:85:21
#44 0x7f8aeb333591 in RunHandler /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:363:3
#45 0x7f8aeb333591 in MessageLoop::Run() /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:345:3
#46 0x7f8aefc4f598 in nsBaseAppShell::Run() /builds/worker/checkouts/gecko/widget/nsBaseAppShell.cpp:148:27
#47 0x7f8af1e8777b in XRE_RunAppShell() /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:721:20
#48 0x7f8aeb419db6 in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /builds/worker/checkouts/gecko/ipc/glue/MessagePump.cpp:235:9
#49 0x7f8aeb333591 in RunHandler /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:363:3
#50 0x7f8aeb333591 in MessageLoop::Run() /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:345:3
#51 0x7f8af1e86fe2 in XRE_InitChildProcess(int, char**, XREChildData const*) /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:656:34
#52 0x55af76e23236 in content_process_main /builds/worker/checkouts/gecko/browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
#53 0x55af76e23236 in main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:375:18
#54 0x7f8afea29d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#55 0x7f8afea29e3f in __libc_start_main csu/../csu/libc-start.c:392:3
#56 0x55af76df8f68 in _start (/home/user/workspace/browsers/m-c-20231011211944-fuzzing-debug/firefox-bin+0x58f68) (BuildId: 2eb5cce7d8cf9cabd42b9b13372b658517f57670)
Flags: in-testsuite?

I'm addressing this in another bug.

Assignee: nobody → bugmail
Severity: -- → S3
Status: NEW → ASSIGNED
Depends on: CVE-2023-6205
Priority: -- → P3

Verified bug as reproducible on mozilla-central 20231012211841-a5369079cd89.
The bug appears to have been introduced in the following build range:

Start: df651cb43d5e0009673e00ee30f927f271c30ef2 (20230720122358)
End: 0bc898fe076442e9a552e9918f1b50ece1c87859 (20230720152457)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=df651cb43d5e0009673e00ee30f927f271c30ef2&tochange=0bc898fe076442e9a552e9918f1b50ece1c87859

Keywords: regression
Whiteboard: [bugmon:bisected,confirmed]

Based on comment #2, this bug contains a bisection range found by bugmon. However, the Regressed by field is still not filled.

:asuth, if possible, could you fill the Regressed by field and investigate this regression?

For more information, please visit BugBot documentation.

Flags: needinfo?(bugmail)
Flags: needinfo?(bugmail)

Setting Bug 1631263 as the regressor based on the pushlog. Please correct if needed.

Set release status flags based on info from the regressing bug 1631263

:asuth can we closed this as resolved in bug 1854076?

Flags: needinfo?(bugmail)
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Flags: needinfo?(bugmail)
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch

Bug marked as FIXED but still reproduces on mozilla-central 20231114213927-cee24679e2a2. If you believe this to be incorrect, please remove the bugmon keyword to prevent further analysis.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Under debug/fuzzing builds WorkerRunnable will assert in its constructor
if passed a null WorkerPrivate. While there is no runtime problem under
non-debug builds, it is a reasonable invariant for us to have until we
are able to eliminate to turn all of this into normal runnables.

RTCRtpScriptTransform::Constructor currently can get into this situation
where the method is invoked but the Worker is in a closing / terminated
state. The spec has a "FIXME" to specify what to do in this situation.

This patch implements an early return with an error based on adding a new
Worker::IsEligibleForMessaging which is analogous to
nsIGlobalObject::IsEligibleForMessaging. This is potentially
observable since JS getters or proxies passed to the constructor as the
options arg will not be serialized in this case, but it is not a
secret to the inherently same-origin Worker whether the Worker is
closing; the same information is available via WebLocks among other
methods. I chose the simplest path here given the absence of any spec
language or even an issue on the repo that I can see.

Pushed by bugmail@asutherland.org:
https://hg.mozilla.org/integration/autoland/rev/b4e3dcc4aee7
Enforce Worker::PostEventWithOptions invariants. r=bwc,dom-worker-reviewers,smaug
Status: REOPENED → RESOLVED
Closed: 10 months ago5 months ago
Resolution: --- → FIXED

Verified bug as fixed on rev mozilla-central 20240410094541-e21f6f5c4e95.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Status: RESOLVED → VERIFIED
Keywords: bugmon
Flags: in-testsuite? → in-testsuite+
Target Milestone: 121 Branch → 126 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: