Assertion failure: forwardScanFromEndResult.GetContent() == wsScannerAtEnd.GetEndReasonContent(), at /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDeleteHandler.cpp:7571                
    Categories
(Core :: DOM: Editor, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr128 | --- | unaffected | 
| firefox-esr140 | --- | unaffected | 
| firefox141 | --- | unaffected | 
| firefox142 | --- | fixed | 
| firefox143 | --- | verified | 
People
(Reporter: tsmith, Assigned: masayuki)
References
(Blocks 1 open bug, Regressed 1 open bug, Regression)
Details
(Keywords: assertion, regression, testcase, Whiteboard: [bugmon:bisected,confirmed], [wptsync upstream])
Attachments
(10 files)
| 244 bytes,
          text/html         | Details | |
| 48 bytes,
          text/x-phabricator-request         | Details | Review | |
| 
           Bug 1978485 - part 2: Get rid of `HTMLWithContextInserter::GetInvisibleBRElementAtPoint()` r=m_kato!
            
         48 bytes,
          text/x-phabricator-request         | Details | Review | |
| 48 bytes,
          text/x-phabricator-request         | Details | Review | |
| 48 bytes,
          text/x-phabricator-request         | Details | Review | |
| 48 bytes,
          text/x-phabricator-request         | Details | Review | |
| 48 bytes,
          text/x-phabricator-request         | Details | Review | |
| 48 bytes,
          text/x-phabricator-request         | Details | Review | |
| 48 bytes,
          text/x-phabricator-request         | Details | Review | |
| 48 bytes,
          text/x-phabricator-request         | Details | Review | 
Found while fuzzing 20250715-8b4dd515e78c (--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>
Assertion failure: forwardScanFromEndResult.GetContent() == wsScannerAtEnd.GetEndReasonContent(), at /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDeleteHandler.cpp:7571
#0 0x7ab7b788228e in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:248:3
#1 0x7ab7b788228e in mozilla::Result<mozilla::EditorDOMRangeBase<mozilla::EditorDOMPointBase<nsINode*, nsIContent*>>, nsresult> mozilla::HTMLEditor::AutoDeleteRangesHandler::ExtendOrShrinkRangeToDelete<mozilla::EditorDOMRangeBase<mozilla::EditorDOMPointBase<nsINode*, nsIContent*>>>(mozilla::HTMLEditor const&, mozilla::LimitersAndCaretData const&, mozilla::EditorDOMRangeBase<mozilla::EditorDOMPointBase<nsINode*, nsIContent*>> const&) const /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDeleteHandler.cpp:7570:9
#2 0x7ab7b7877d6c in mozilla::HTMLEditor::AutoDeleteRangesHandler::HandleDeleteNonCollapsedRanges(mozilla::HTMLEditor&, short, short, mozilla::AutoClonedSelectionRangeArray&, mozilla::HTMLEditor::AutoDeleteRangesHandler::SelectionWasCollapsed, mozilla::dom::Element const&) /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDeleteHandler.cpp:2996:50
#3 0x7ab7b7870ba0 in mozilla::HTMLEditor::AutoDeleteRangesHandler::Run(mozilla::HTMLEditor&, short, short, mozilla::AutoClonedSelectionRangeArray&, mozilla::dom::Element const&) /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDeleteHandler.cpp:1204:47
#4 0x7ab7b787016a in mozilla::HTMLEditor::HandleDeleteSelection(short, short) /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDeleteHandler.cpp:506:61
#5 0x7ab7b7790b84 in mozilla::EditorBase::DeleteSelectionAsSubAction(short, short) /builds/worker/checkouts/gecko/editor/libeditor/EditorBase.cpp:4862:9
#6 0x7ab7b782d436 in mozilla::HTMLEditor::DeleteSelectionAndPrepareToCreateNode() /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditor.cpp:6431:9
#7 0x7ab7b784ff83 in mozilla::HTMLEditor::HTMLWithContextInserter::Run(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::EditorBase::SafeToInsertData, mozilla::HTMLEditor::InlineStylesAtInsertionPoint) /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDataTransfer.cpp:745:22
#8 0x7ab7b784ee51 in mozilla::HTMLEditor::InsertHTMLWithContextAsSubAction(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::EditorBase::SafeToInsertData, mozilla::EditorDOMPointBase<nsCOMPtr<nsINode>, nsCOMPtr<nsIContent>> const&, mozilla::EditorBase::DeleteSelectedContent, mozilla::HTMLEditor::InlineStylesAtInsertionPoint, mozilla::dom::Element const&) /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDataTransfer.cpp:657:71
#9 0x7ab7b784b6cc in mozilla::HTMLEditor::InsertHTMLAsAction(nsTSubstring<char16_t> const&, nsIPrincipal*) /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorDataTransfer.cpp:347:8
#10 0x7ab7b784ba42 in mozilla::InsertHTMLCommand::DoCommandParam(mozilla::Command, nsTSubstring<char16_t> const&, mozilla::EditorBase&, nsIPrincipal*) const /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditorCommands.cpp:1201:34
#11 0x7ab7b3b7afd1 in mozilla::dom::Document::ExecCommand(nsTSubstring<char16_t> const&, bool, mozilla::dom::TrustedHTMLOrString const&, nsIPrincipal&, mozilla::ErrorResult&) /builds/worker/checkouts/gecko/dom/base/Document.cpp:5798:27
#12 0x7ab7b4ca6cb0 in mozilla::dom::Document_Binding::execCommand(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/./DocumentBinding.cpp:4181:36
#13 0x7ab7b4f85a6d 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
#14 0x7ab7b87edfb4 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:501:13
#15 0x7ab7b87ed80f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:597:12
#16 0x7ab7b8801438 in CallFromStack /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:669:10
#17 0x7ab7b8801438 in js::Interpret(JSContext*, js::RunState&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:3287:16
#18 0x7ab7b87ece73 in js::RunScript(JSContext*, js::RunState&) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:471:13
#19 0x7ab7b87ed835 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:629:13
#20 0x7ab7b87eec5c 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:696:8
#21 0x7ab7b88d44eb 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
#22 0x7ab7b420f758 in mozilla::dom::MutationCallback::Call(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::dom::Sequence<mozilla::OwningNonNull<nsDOMMutationRecord>> const&, nsDOMMutationObserver&, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/./MutationObserverBinding.cpp:99:8
#23 0x7ab7b3df5e84 in void mozilla::dom::MutationCallback::Call<nsDOMMutationObserver*>(nsDOMMutationObserver* const&, mozilla::dom::Sequence<mozilla::OwningNonNull<nsDOMMutationRecord>> const&, nsDOMMutationObserver&, mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObjectBase::ExceptionHandling, JS::Realm*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/MutationObserverBinding.h:79:12
#24 0x7ab7b3de384f in void mozilla::dom::MutationCallback::Call<nsDOMMutationObserver*>(nsDOMMutationObserver* const&, mozilla::dom::Sequence<mozilla::OwningNonNull<nsDOMMutationRecord>> const&, nsDOMMutationObserver&, char const*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/MutationObserverBinding.h:101:12
#25 0x7ab7b3de3553 in nsDOMMutationObserver::HandleMutation() /builds/worker/checkouts/gecko/dom/base/nsDOMMutationObserver.cpp:818:13
#26 0x7ab7b3de0e0d in nsDOMMutationObserver::HandleMutationsInternal(mozilla::AutoSlowOperation&) /builds/worker/checkouts/gecko/dom/base/nsDOMMutationObserver.cpp:847:26
#27 0x7ab7b1bbceb8 in mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool) /builds/worker/checkouts/gecko/xpcom/base/CycleCollectedJSContext.cpp:879:17
#28 0x7ab7b4f99fd5 in LeaveMicroTask /builds/worker/workspace/obj-build/dist/include/mozilla/CycleCollectedJSContext.h:250:7
#29 0x7ab7b4f99fd5 in mozilla::dom::CallbackObjectBase::CallSetup::~CallSetup() /builds/worker/checkouts/gecko/dom/bindings/CallbackObject.cpp:394:11
#30 0x7ab7b513623c in mozilla::dom::BlobCallback::Call(mozilla::dom::Blob*, mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObjectBase::ExceptionHandling, JS::Realm*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/HTMLCanvasElementBinding.h:91:3
#31 0x7ab7b5a6ae2f in mozilla::dom::BlobCallback::Call(mozilla::dom::Blob*, char const*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/HTMLCanvasElementBinding.h:103:12
#32 0x7ab7b4fafeee in operator()<StoreRefPtrPassByPtr<mozilla::dom::AsyncIterableIterator<mozilla::dom::TestInterfaceAsyncIterableDouble> > &, StoreRefPtrPassByPtr<mozilla::dom::Promise> &> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1085:18
#33 0x7ab7b4fafeee in __invoke_impl<void, (lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1084:9), StoreRefPtrPassByPtr<mozilla::dom::AsyncIterableIterator<mozilla::dom::TestInterfaceAsyncIterableDouble> > &, StoreRefPtrPassByPtr<mozilla::dom::Promise> &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:60:14
#34 0x7ab7b4fafeee in __invoke<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1084:9), StoreRefPtrPassByPtr<mozilla::dom::AsyncIterableIterator<mozilla::dom::TestInterfaceAsyncIterableDouble> > &, StoreRefPtrPassByPtr<mozilla::dom::Promise> &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:95:14
#35 0x7ab7b4fafeee in __apply_impl<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1084:9), std::tuple<StoreRefPtrPassByPtr<mozilla::dom::AsyncIterableIterator<mozilla::dom::TestInterfaceAsyncIterableDouble> >, StoreRefPtrPassByPtr<mozilla::dom::Promise> > &, 0UL, 1UL> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/tuple:1678:14
#36 0x7ab7b4fafeee in apply<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1084:9), std::tuple<StoreRefPtrPassByPtr<mozilla::dom::AsyncIterableIterator<mozilla::dom::TestInterfaceAsyncIterableDouble> >, StoreRefPtrPassByPtr<mozilla::dom::Promise> > &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/tuple:1687:14
#37 0x7ab7b4fafeee in apply<mozilla::dom::TestInterfaceAsyncIterableDouble, void (mozilla::dom::TestInterfaceAsyncIterableDouble::*)(mozilla::dom::AsyncIterableIterator<mozilla::dom::TestInterfaceAsyncIterableDouble> *, mozilla::dom::Promise *)> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1083:12
#38 0x7ab7b4fafeee in mozilla::detail::RunnableMethodImpl<mozilla::scache::StartupCache*, void (mozilla::scache::StartupCache::*)(unsigned char*, unsigned long), true, (mozilla::RunnableKind)0, unsigned char*, unsigned long>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1134:13
#39 0x7ab7b1cc6847 in mozilla::RunnableTask::Run() /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:703:16
#40 0x7ab7b1cbf94e in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:1310:20
#41 0x7ab7b1cbe687 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:1133:15
#42 0x7ab7b1cbeb05 in mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:639:36
#43 0x7ab7b1ccd886 in operator() /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:333:37
#44 0x7ab7b1ccd886 in mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.h:548:5
#45 0x7ab7b1cdf483 in nsThread::ProcessNextEvent(bool, bool*) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:1159:16
#46 0x7ab7b1ce5baf in NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:480:10
#47 0x7ab7b289c557 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /builds/worker/checkouts/gecko/ipc/glue/MessagePump.cpp:85:21
#48 0x7ab7b27f8471 in RunHandler /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:362:3
#49 0x7ab7b27f8471 in MessageLoop::Run() /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:344:3
#50 0x7ab7b7662568 in nsBaseAppShell::Run() /builds/worker/checkouts/gecko/widget/nsBaseAppShell.cpp:148:27
#51 0x7ab7b77263a4 in nsAppShell::Run() /builds/worker/checkouts/gecko/widget/gtk/nsAppShell.cpp:471:33
#52 0x7ab7b864d85b in XRE_RunAppShell() /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:647:20
#53 0x7ab7b289d404 in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /builds/worker/checkouts/gecko/ipc/glue/MessagePump.cpp:235:9
#54 0x7ab7b27f8471 in RunHandler /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:362:3
#55 0x7ab7b27f8471 in MessageLoop::Run() /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:344:3
#56 0x7ab7b864ccb2 in XRE_InitChildProcess(int, char**, XREChildData const*) /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:585:34
#57 0x585f382bda2f in main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:397:22
| Comment 1•3 months ago
           | ||
Verified bug as reproducible on mozilla-central 20250721154325-bca22a6d0402.
The bug appears to have been introduced in the following build range:
Start: ca1cc5350282d2e1047872fb126704505db5e97a (20250715041850)
End: b8a0a82c42cd974169ed44f393c8e49f628cda6a (20250715013234)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ca1cc5350282d2e1047872fb126704505db5e97a&tochange=b8a0a82c42cd974169ed44f393c8e49f628cda6a
| Assignee | ||
| Updated•3 months ago
           | 
| Assignee | ||
| Comment 2•3 months ago
           | ||
Well, the assertion is now wrong. So, this does not affect to the users. However, I think similar mismatching must have occurred at the GetEndReasonContent() or GetStartReasonContent() callers.
| Assignee | ||
| Comment 3•3 months ago
           | ||
Well, I think bug 1976608 should be backed out only from beta branch later.
| Comment 4•3 months ago
           | ||
Set release status flags based on info from the regressing bug 1976608
| Comment 5•3 months ago
          • | ||
Marking 142 as fixed by backout because the regressor (bug 1976608) was backed out beta for 142.0b2.
| Assignee | ||
| Comment 6•3 months ago
           | ||
Starting from bug 1976608,
WSRunScanner::ScanInclusiveNextVisibleNodeOrBlockBoundaryFrom()
started ignoring invisible Comment nodes.  Therefore, the result
may be different from its end reason content.  So, the assertion is now
invalid.
| Assignee | ||
| Comment 7•3 months ago
           | ||
It's unused and it does wrong thing to get the following invisible
<br> element.  So, it should be deleted.
| Assignee | ||
| Comment 8•3 months ago
           | ||
The method should use
WSRunScanner::ScanPreviousVisibleNodeOrBlockBoundaryFrom() and
WSRunScanner::ScanInclusiveNextVisibleNodeOrBlockBoundaryFrom()
instead of the reason content of WSRunScanner.
| Assignee | ||
| Comment 9•3 months ago
           | ||
| Assignee | ||
| Comment 10•3 months ago
           | ||
They should be used only when the caller needs to call both
ScanPreviousVisibleNodeOrBlockBoundary and
ScanPreviousVisibleNodeOrBlockBoundary or referring/calling other
methods of WSRunScanner to skip scanning the surrounding content
twice or more.
| Assignee | ||
| Comment 11•3 months ago
           | ||
This changes the scan start point of the second call because it's odd
that it scans from after the preceding invisible <br> element.
| Assignee | ||
| Comment 12•3 months ago
           | ||
It should not refer the start/end reason content.
| Assignee | ||
| Comment 13•3 months ago
           | ||
| Assignee | ||
| Comment 14•3 months ago
           | ||
| Assignee | ||
| Updated•3 months ago
           | 
| Assignee | ||
| Updated•3 months ago
           | 
| Assignee | ||
| Updated•3 months ago
           | 
| Comment 15•2 months ago
           | ||
| Updated•2 months ago
           | 
| Comment 17•2 months ago
           | ||
| Comment 18•2 months ago
           | ||
| Comment 19•2 months ago
           | ||
| Comment 20•2 months ago
           | ||
| Comment 21•2 months ago
           | ||
|   | ||
| Comment 22•2 months ago
           | ||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/6750ca938769
https://hg.mozilla.org/mozilla-central/rev/2be028a50381
https://hg.mozilla.org/mozilla-central/rev/78a4e370c999
https://hg.mozilla.org/mozilla-central/rev/0e5cc7fef2d6
https://hg.mozilla.org/mozilla-central/rev/402ec19b1b9b
https://hg.mozilla.org/mozilla-central/rev/524457610691
https://hg.mozilla.org/mozilla-central/rev/911cfdaf6659
https://hg.mozilla.org/mozilla-central/rev/fbb1c2043f73
https://hg.mozilla.org/mozilla-central/rev/556836c3c1da
| Comment 24•2 months ago
           | ||
Verified bug as fixed on rev mozilla-central 20250730092527-320fe0da2b9f.
Removing bugmon keyword as no further action possible.  Please review the bug and re-add the keyword for further analysis.
Description
•