Closed Bug 1728566 Opened 3 years ago Closed 6 months ago

Assertion failure: aContent.IsInclusiveDescendantOf(aAncestorLimit), at /editor/libeditor/HTMLEditUtils.h:1202

Categories

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

defect

Tracking

()

VERIFIED FIXED
129 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox-esr115 --- wontfix
firefox97 --- wontfix
firefox98 --- wontfix
firefox99 --- wontfix
firefox100 --- wontfix
firefox127 --- wontfix
firefox128 --- wontfix
firefox129 --- verified

People

(Reporter: jkratzer, Assigned: masayuki)

References

(Depends on 3 open bugs, Blocks 1 open bug, Regression)

Details

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

Attachments

(3 files)

Testcase found while fuzzing mozilla-central rev f4ad9b76e5f8 (built with: --enable-debug --enable-fuzzing).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build f4ad9b76e5f8 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
Assertion failure: aContent.IsInclusiveDescendantOf(aAncestorLimit), at /editor/libeditor/HTMLEditUtils.h:1202

    ==668275==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f5181a1ee70 bp 0x7ffc277a2af0 sp 0x7ffc277a2ad0 T668275)
    ==668275==The signal is caused by a WRITE memory access.
    ==668275==Hint: address points to the zero page.
        #0 0x7f5181a1ee70 in mozilla::HTMLEditUtils::GetClosestAncestorListItemElement(nsIContent const&, mozilla::dom::Element const*) /editor/libeditor/HTMLEditUtils.h:1201:5
        #1 0x7f5181a1b0b3 in mozilla::HTMLEditor::InsertParagraphSeparatorAsSubAction() /editor/libeditor/HTMLEditSubActionHandler.cpp:1568:7
        #2 0x7f5181a59da3 in mozilla::HTMLEditor::InsertParagraphSeparatorAsAction(nsIPrincipal*) /editor/libeditor/HTMLEditor.cpp:1195:29
        #3 0x7f51819f0cb6 in mozilla::InsertParagraphCommand::DoCommand(mozilla::Command, mozilla::EditorBase&, nsIPrincipal*) const /editor/libeditor/EditorCommands.cpp:887:25
        #4 0x7f517ec9bc9f in mozilla::dom::Document::ExecCommand(nsTSubstring<char16_t> const&, bool, nsTSubstring<char16_t> const&, nsIPrincipal&, mozilla::ErrorResult&) /dom/base/Document.cpp:5309:37
        #5 0x7f517fdd8243 in mozilla::dom::Document_Binding::execCommand(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/DocumentBinding.cpp:3476:36
        #6 0x7f518016dbf8 in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /dom/bindings/BindingUtils.cpp:3300:13
        #7 0x7f51838e6940 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:401:13
        #8 0x7f51838e603e in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:488:12
        #9 0x7f51838e7a3e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:548:10
        #10 0x7f51838dcfa0 in CallFromStack /js/src/vm/Interpreter.cpp:552:10
        #11 0x7f51838dcfa0 in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3255:16
        #12 0x7f51838d3bc5 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:370:13
        #13 0x7f51838e5f37 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:520:13
        #14 0x7f51838e7a3e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:548:10
        #15 0x7f51838e7c41 in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) /js/src/vm/Interpreter.cpp:565:8
        #16 0x7f5183ac7753 in JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) /js/src/vm/CallAndConstruct.cpp:117:10
        #17 0x7f517fdacd9e 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
        #18 0x7f5180578b16 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
        #19 0x7f518057886a in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) /dom/events/EventListenerManager.cpp:1115:43
        #20 0x7f51805795c2 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1312:17
        #21 0x7f518056e405 in HandleEvent /dom/events/EventListenerManager.h:394:5
        #22 0x7f518056e405 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:348:17
        #23 0x7f518056d91f in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:550:16
        #24 0x7f5180570544 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /dom/events/EventDispatcher.cpp:1082:11
        #25 0x7f5180573186 in mozilla::EventDispatcher::DispatchDOMEvent(nsISupports*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsPresContext*, nsEventStatus*) /dom/events/EventDispatcher.cpp
        #26 0x7f517ee32425 in nsINode::DispatchEvent(mozilla::dom::Event&, mozilla::dom::CallerType, mozilla::ErrorResult&) /dom/base/nsINode.cpp:1339:17
        #27 0x7f517eb3698a in nsContentUtils::DispatchEvent(mozilla::dom::Document*, nsISupports*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, mozilla::Trusted, bool*, mozilla::ChromeOnlyDispatch) /dom/base/nsContentUtils.cpp:4301:28
        #28 0x7f517eb36816 in nsContentUtils::DispatchTrustedEvent(mozilla::dom::Document*, nsISupports*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, bool*) /dom/base/nsContentUtils.cpp:4271:10
        #29 0x7f517eca8797 in mozilla::dom::Document::DispatchContentLoadedEvents() /dom/base/Document.cpp:7794:3
        #30 0x7f517ed1a326 in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12
        #31 0x7f517ed1a326 in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12
        #32 0x7f517ed1a326 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:1200:13
        #33 0x7f517cfc88f2 in mozilla::SchedulerGroup::Runnable::Run() /xpcom/threads/SchedulerGroup.cpp:144:20
        #34 0x7f517cff683e in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:502:16
        #35 0x7f517cfd1b0f in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:805:26
        #36 0x7f517cfd0778 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:641:15
        #37 0x7f517cfd09f3 in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:425:36
        #38 0x7f517cff9e36 in operator() /xpcom/threads/TaskController.cpp:135:37
        #39 0x7f517cff9e36 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:531:5
        #40 0x7f517cfe52ef in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1148:16
        #41 0x7f517cfec03a in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:466:10
        #42 0x7f517da3a176 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #43 0x7f517d95a867 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #44 0x7f517d95a772 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #45 0x7f517d95a772 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #46 0x7f51818e96c8 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27
        #47 0x7f5183769f33 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:917:20
        #48 0x7f517da3b06a in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #49 0x7f517d95a867 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #50 0x7f517d95a772 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #51 0x7f517d95a772 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #52 0x7f518376956e in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:749:34
        #53 0x55ca123fcab6 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #54 0x55ca123fcab6 in main /browser/app/nsBrowserApp.cpp:327:18
        #55 0x7f51928110b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
        #56 0x55ca123d98bc in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x158bc)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /editor/libeditor/HTMLEditUtils.h:1201:5 in mozilla::HTMLEditUtils::GetClosestAncestorListItemElement(nsIContent const&, mozilla::dom::Element const*)
    ==668275==ABORTING
Attached file Testcase

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20210901155113-0ee7ea150df4.
The bug appears to have been introduced in the following build range:

Start: 8803bc71047a75f0983844d891d82b4a5edecda4 (20210310041823)
End: 10ca32d83c66663d73c0600ff90022e85f52b92b (20210310054241)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=8803bc71047a75f0983844d891d82b4a5edecda4&tochange=10ca32d83c66663d73c0600ff90022e85f52b92b

Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]

Hmm, this must be started from bug 1677566, but actual regression point must be older than it. This is a bug of editing outside <body> element.

Severity: -- → S3
Priority: -- → P3
Depends on: domino
Blocks: domino
No longer depends on: domino

Will be fixed in bug 1741494.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Depends on: 1741494
OS: Linux → All
Hardware: x86_64 → All

:masayuki, since this bug contains a bisection range, could you fill (if possible) the regressed_by field?
For more information, please visit auto_nag documentation.

Flags: needinfo?(masayuki)
Flags: needinfo?(masayuki)
Regressed by: 1677566

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

Assignee: masayuki → nobody
Status: ASSIGNED → NEW

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

Bugmon Analysis
Unable to reproduce bug 1728566 using build mozilla-central 20210901091701-f4ad9b76e5f8. Without a baseline, bugmon is unable to analyze this bug.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Keywords: bugmon
Attachment #9238905 - Attachment mime type: text/plain → text/html

Odd, I can still reproduce this crash with debug build.

Keywords: bugmon
Assignee: nobody → masayuki
Status: NEW → ASSIGNED

While handling an "insertParagraph" command, it's closed at least in the editing
host. Therefore, it's file to use editing host outside <body> because it
won't make the tree messy outside the editing host.

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/8469e6fd08fd Make the `HTMLEditor::InsertParagraphSeparatorAsSubAction` callers compute the editing host no limited in the `<body>` r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46742 for changes under testing/web-platform/tests
Whiteboard: [bugmon:bisected,confirmed] → [bugmon:bisected,confirmed], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
Upstream PR merged by moz-wptsync-bot

Verified bug as fixed on rev mozilla-central 20240614204945-97bce31758a5.
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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: