Land test for fixed Assertion failure: false (The container shouldn't be iterated due to out of range), at /builds/worker/checkouts/gecko/dom/base/nsRange.cpp:2113
Categories
(Core :: DOM: Selection, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox146 | --- | unaffected |
| firefox147 | --- | unaffected |
| firefox148 | --- | wontfix |
| firefox149 | --- | fixed |
People
(Reporter: tsmith, Assigned: masayuki)
References
(Blocks 1 open bug, Regression)
Details
(6 keywords, Whiteboard: [assertion fixed by bug 1978714][bugmon:bisected,confirmed], [wptsync upstream][adv-main149-])
Crash Data
Attachments
(1 file, 1 external file, 2 obsolete files)
|
257 bytes,
text/html
|
Details |
Found while fuzzing m-c 20251209-7c6e6dc03dc0 (--enable-debug --enable-fuzzing)
To reproduce via Grizzly Replay:
$ pip install fuzzfetch grizzly-framework --upgrade
$ python -m fuzzfetch -d --fuzzing -n firefox
$ python -m grizzly.replay.bugzilla ./firefox/firefox <bugid>
I am marking this as s-s since until this can be investigated.
Assertion failure: false (The container shouldn't be iterated due to out of range), at /builds/worker/checkouts/gecko/dom/base/nsRange.cpp:2113
#0 0x7915a7683ce8 in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:237:3
#1 0x7915a7683ce8 in nsRange::CutContents(mozilla::dom::DocumentFragment**, void (*)(mozilla::dom::Element*), mozilla::ErrorResult&) /builds/worker/checkouts/gecko/dom/base/nsRange.cpp:2112:11
#2 0x7915a78a64e4 in mozilla::dom::Selection::DeleteFromDocument(mozilla::ErrorResult&) /builds/worker/checkouts/gecko/dom/base/Selection.cpp:4127:27
#3 0x7915a829dba6 in mozilla::dom::Selection_Binding::deleteFromDocument(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/./SelectionBinding.cpp:1653:24
#4 0x7915a8bd172d in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /builds/worker/checkouts/gecko/dom/bindings/BindingUtils.cpp:3306:13
#5 0x7915ac647024 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:490:13
#6 0x7915ac64687f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:586:12
#7 0x7915ac657912 in CallFromStack /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:658:10
#8 0x7915ac657912 in js::Interpret(JSContext*, js::RunState&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:3272:16
#9 0x7915ac645eca in js::RunScript(JSContext*, js::RunState&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:460:13
#10 0x7915ac6468a5 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:618:13
#11 0x7915ac647ccc 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:685:8
#12 0x7915ac730afb 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
#13 0x7915a89922d5 in mozilla::dom::EventHandlerNonNull::Call(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::dom::Event&, JS::MutableHandle<JS::Value>, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/./EventHandlerBinding.cpp:65:37
#14 0x7915a9501feb in void mozilla::dom::EventHandlerNonNull::Call<nsCOMPtr<mozilla::dom::EventTarget>>(nsCOMPtr<mozilla::dom::EventTarget> const&, mozilla::dom::Event&, JS::MutableHandle<JS::Value>, mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObjectBase::ExceptionHandling, JS::Realm*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/EventHandlerBinding.h:82:12
#15 0x7915a9500b32 in mozilla::JSEventHandler::HandleEvent(mozilla::dom::Event*) /builds/worker/checkouts/gecko/dom/events/JSEventHandler.cpp:201:12
#16 0x7915a94dbc01 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:1273:22
#17 0x7915a94dcd59 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:1579:12
#18 0x7915a94dc641 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /builds/worker/checkouts/gecko/dom/events/EventListenerManager.cpp:1484:35
#19 0x7915a94d10de in HandleEvent /builds/worker/workspace/obj-build/dist/include/mozilla/EventListenerManager.h:465:5
#20 0x7915a94d10de in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /builds/worker/checkouts/gecko/dom/events/EventDispatcher.cpp:364:17
#21 0x7915a94d07ac in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /builds/worker/checkouts/gecko/dom/events/EventDispatcher.cpp:605:16
#22 0x7915a94d2f62 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:1260:11
#23 0x7915ab8439aa in nsDocumentViewer::LoadComplete(nsresult) /builds/worker/checkouts/gecko/layout/base/nsDocumentViewer.cpp:994:7
#24 0x7915abcb9280 in nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult) /builds/worker/checkouts/gecko/docshell/base/nsDocShell.cpp:6495:13
#25 0x7915abcb873f in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /builds/worker/checkouts/gecko/docshell/base/nsDocShell.cpp:5816:7
#26 0x7915abcba1b2 in non-virtual thunk to nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /builds/worker/checkouts/gecko/docshell/base/nsDocShell.cpp:0:0
#27 0x7915a65f9df9 in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult) /builds/worker/checkouts/gecko/uriloader/base/nsDocLoader.cpp:1528:3
#28 0x7915a65f95b2 in nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult) /builds/worker/checkouts/gecko/uriloader/base/nsDocLoader.cpp:1060:14
#29 0x7915a65f7104 in nsDocLoader::DocLoaderIsEmpty(bool, mozilla::Maybe<nsresult> const&) /builds/worker/checkouts/gecko/uriloader/base/nsDocLoader.cpp:855:9
#30 0x7915a65f895a in nsDocLoader::OnStopRequest(nsIRequest*, nsresult) /builds/worker/checkouts/gecko/uriloader/base/nsDocLoader.cpp:722:5
#31 0x7915abce028f in nsDocShell::OnStopRequest(nsIRequest*, nsresult) /builds/worker/checkouts/gecko/docshell/base/nsDocShell.cpp:14751:23
#32 0x7915a598b13f in mozilla::net::nsLoadGroup::NotifyRemovalObservers(nsIRequest*, nsresult) /builds/worker/checkouts/gecko/netwerk/base/nsLoadGroup.cpp:656:22
#33 0x7915a598c2e6 in mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) /builds/worker/checkouts/gecko/netwerk/base/nsLoadGroup.cpp:540:10
#34 0x7915a773b6ec in mozilla::dom::Document::DoUnblockOnload() /builds/worker/checkouts/gecko/dom/base/Document.cpp:12491:18
#35 0x7915a7721726 in mozilla::dom::Document::DispatchContentLoadedEvents() /builds/worker/checkouts/gecko/dom/base/Document.cpp:8737:3
#36 0x7915a77ec4a5 in operator()<> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1083:18
#37 0x7915a77ec4a5 in __invoke_impl<void, (lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1082:9)> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60:14
#38 0x7915a77ec4a5 in __invoke<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1082:9)> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:95:14
#39 0x7915a77ec4a5 in __apply_impl<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1082:9), std::tuple<> &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/tuple:1740:14
#40 0x7915a77ec4a5 in apply<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1082:9), std::tuple<> &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/tuple:1751:14
#41 0x7915a77ec4a5 in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1081:12
#42 0x7915a77ec4a5 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:1132:13
#43 0x7915a5716df7 in mozilla::RunnableTask::Run() /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:705:16
#44 0x7915a5711774 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:1325:20
#45 0x7915a57103f7 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:1148:15
#46 0x7915a5710875 in mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:641:36
#47 0x7915a571dc76 in operator() /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:333:37
#48 0x7915a571dc76 in mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.h:549:5
#49 0x7915a572fd53 in nsThread::ProcessNextEvent(bool, bool*) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:1164:16
#50 0x7915a573664f in NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:461:10
#51 0x7915a6328767 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /builds/worker/checkouts/gecko/ipc/glue/MessagePump.cpp:85:21
#52 0x7915a6283c71 in RunHandler /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:361:3
#53 0x7915a6283c71 in MessageLoop::Run() /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:343:3
#54 0x7915ab39a6b8 in nsBaseAppShell::Run() /builds/worker/checkouts/gecko/widget/nsBaseAppShell.cpp:152:27
#55 0x7915ab4681a4 in nsAppShell::Run() /builds/worker/checkouts/gecko/widget/gtk/nsAppShell.cpp:555:33
#56 0x7915ac4aa78b in XRE_RunAppShell() /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:656:20
#57 0x7915a6329614 in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /builds/worker/checkouts/gecko/ipc/glue/MessagePump.cpp:235:9
#58 0x7915a6283c71 in RunHandler /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:361:3
#59 0x7915a6283c71 in MessageLoop::Run() /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:343:3
#60 0x7915ac4a9ee1 in XRE_InitChildProcess(int, char**, XREChildData const*) /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:594:34
#61 0x64367100cf9c in main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:465:22
Comment 1•11 months ago
|
||
Verified bug as reproducible on mozilla-central 20251210064334-deaf4cdda67a.
The bug appears to have been introduced in the following build range:
Start: c2f05ce0b22bedaac3196ad052bc7d47717e1d9c (20251209065918)
End: 4c2e2f108dd68e67c4f04a50f9e953edfb0febec (20251209072250)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=c2f05ce0b22bedaac3196ad052bc7d47717e1d9c&tochange=4c2e2f108dd68e67c4f04a50f9e953edfb0febec
Updated•11 months ago
|
Updated•11 months ago
|
Comment 2•11 months ago
|
||
:masayuki, since you are the author of the regressor, bug 2000988, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Updated•11 months ago
|
| Assignee | ||
Comment 3•11 months ago
|
||
Interesting. It seems that the iterator lists up the anonymous <summary>.
| Assignee | ||
Comment 4•11 months ago
|
||
<details> has a native anonymous shadow which has 2 <slot> elements,
one is for <summary> and the other is for the content of <details>.
And the actual <summary> and the other contents of <details> are
slotted into them [1]. Therefore, GetIndexInParent<TreeKind::Flat>()
of <details> will call GetShadowRoot()->ComputeIndexOf() [2].
Then, the element is not a direct child of the shadow root so that
ComputeIndexOf() returns Nothing.
This causes RangeUtils::CompareNodeToRangeBoundaries() considering
that the node is before the range when comparing <details> and
<summary> [3].
Finally, ContentSubtreeIterator::GetTopAncestorInRange() considers
that the range starting from start of <summary> selects all of the
<summary> since it's considered by
RangeUtils::IsNodeContainedInRange() by the above bug [4]. Therefore,
the iterator lists up <summary> which is the start container as fully
selected element and the assertion fails.
This patch fixes this in
nsContentUtils::CompareChildOffsetAndChildNode() because when
comparing the parent and the child, the caller must expect that they
work so. However, within the lower level, changing the behavior may
block DOM operations with native anonymous subtrees.
- https://searchfox.org/firefox-main/rev/55aaa33f526ad11857e3f2e07a87daef1aa56ad4/dom/html/HTMLDetailsElement.cpp#96,107-108,132,135-136,143
- https://searchfox.org/firefox-main/rev/55aaa33f526ad11857e3f2e07a87daef1aa56ad4/dom/base/ChildIterator.cpp#68-69
- https://searchfox.org/firefox-main/rev/55aaa33f526ad11857e3f2e07a87daef1aa56ad4/dom/base/RangeUtils.cpp#290-300
- https://searchfox.org/firefox-main/rev/55aaa33f526ad11857e3f2e07a87daef1aa56ad4/dom/base/ContentIterator.cpp#1395-1400
Comment 5•11 months ago
|
||
I get this crash from the testcase on Nightly: https://crash-stats.mozilla.org/report/index/e653c4e1-0bd8-47c4-9a11-e57680251211#tab-bugzilla
Updated•11 months ago
|
Updated•11 months ago
|
Updated•10 months ago
|
Comment 6•10 months ago
|
||
Testcase crashes using the initial build (mozilla-central 20251209143057-7c6e6dc03dc0) but not with tip (mozilla-central 20260130211306-fda5656fd125.)
The bug appears to have been fixed in the following build range:
Start: 5c8857fd293506b0e4cc52a5b4d4c746c3dc8815 (20260129202303)
End: f8c55b7ea4582fc9ecaab8e0ca2e0630e04a7cc0 (20260129212213)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=5c8857fd293506b0e4cc52a5b4d4c746c3dc8815&tochange=f8c55b7ea4582fc9ecaab8e0ca2e0630e04a7cc0
masayuki, can you confirm that the above bisection range is responsible for fixing this issue?
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.
| Assignee | ||
Comment 7•10 months ago
|
||
Yeah, possible fixed by it. However, we should add the testcase into the tree so that I leave this open.
Updated•10 months ago
|
| Assignee | ||
Comment 8•10 months ago
|
||
The bug itself was fixed in bug 1978714.
Updated•10 months ago
|
Comment 11•10 months ago
|
||
| bugherder | ||
Updated•9 months ago
|
Updated•9 months ago
|
Comment 13•9 months ago
|
||
It appears that this bug can still be triggered using the attached testcase.
Updated•9 months ago
|
| Assignee | ||
Comment 14•9 months ago
|
||
Thanks for the POC. I've not fully understand that, but looks like it's caused by unexpected mutation while the handling. That means it's a different bug even the assertion failure is at the same. So, I think it should've been handled in a new bug instead of reopening this.
| Assignee | ||
Comment 15•9 months ago
|
||
Or should we put it off to run the lifecycle callbacks with a script blocker?
Comment 16•9 months ago
•
|
||
We should file a new bug and not re-open existing ones.
Updated•9 months ago
|
Comment 17•9 months ago
|
||
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=2015081. We can't track multiple different issues in one bug.
Updated•9 months ago
|
| Comment hidden (obsolete) |
Comment 19•9 months ago
|
||
Comment on attachment 9542889 [details]
poc.html for bug 2015081
I'll mark poc.html obsolete here to avoid confusion, and link it from the new bug.
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
| Reporter | ||
Updated•8 months ago
|
Updated•2 months ago
|
Description
•