Open Bug 1724436 Opened 3 years ago Updated 11 months ago

Assertion failure: rangeToDelete.StartRef().EqualsOrIsBefore( replaceRangeDataAtEnd.StartRef()), at /editor/libeditor/WSRunObject.cpp:1923

Categories

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

x86_64
Linux
defect

Tracking

()

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 2 open bugs)

Details

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

Attachments

(1 file)

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

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build b19fdf435550 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
Assertion failure: rangeToDelete.StartRef().EqualsOrIsBefore( replaceRangeDataAtEnd.StartRef()), at /editor/libeditor/WSRunObject.cpp:1923

    ==2091122==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f65c92c8157 bp 0x7fffb5295270 sp 0x7fffb5294bd0 T2091122)
    ==2091122==The signal is caused by a WRITE memory access.
    ==2091122==Hint: address points to the zero page.
        #0 0x7f65c92c8157 in mozilla::WhiteSpaceVisibilityKeeper::MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange(mozilla::HTMLEditor&, mozilla::EditorDOMRangeBase<mozilla::EditorDOMPointBase<nsCOMPtr<nsINode>, nsCOMPtr<nsIContent> > > const&) /editor/libeditor/WSRunObject.cpp:1922:5
        #1 0x7f65c926759e in PrepareToDeleteRange /editor/libeditor/WSRunObject.h:1341:19
        #2 0x7f65c926759e in mozilla::HTMLEditor::AutoDeleteRangesHandler::HandleDeleteNonCollapsedRanges(mozilla::HTMLEditor&, short, short, mozilla::AutoRangeArray&, mozilla::HTMLEditor::AutoDeleteRangesHandler::SelectionWasCollapsed) /editor/libeditor/HTMLEditorDeleteHandler.cpp:3004:19
        #3 0x7f65c9263701 in mozilla::HTMLEditor::AutoDeleteRangesHandler::Run(mozilla::HTMLEditor&, short, short, mozilla::AutoRangeArray&) /editor/libeditor/HTMLEditorDeleteHandler.cpp:1643:29
        #4 0x7f65c926238f in mozilla::HTMLEditor::HandleDeleteSelection(short, short) /editor/libeditor/HTMLEditorDeleteHandler.cpp:1128:43
        #5 0x7f65c91b474d in mozilla::EditorBase::DeleteSelectionAsSubAction(short, short) /editor/libeditor/EditorBase.cpp:4268:7
        #6 0x7f65c91eebb8 in mozilla::HTMLEditor::HandleInsertText(mozilla::EditSubAction, nsTSubstring<char16_t> const&, mozilla::EditorBase::SelectionHandling) /editor/libeditor/HTMLEditSubActionHandler.cpp:951:9
        #7 0x7f65c91b5c7a in mozilla::EditorBase::InsertTextAsSubAction(nsTSubstring<char16_t> const&, mozilla::EditorBase::SelectionHandling) /editor/libeditor/EditorBase.cpp:6007:7
        #8 0x7f65c91c8e53 in mozilla::EditorBase::InsertTextAsAction(nsTSubstring<char16_t> const&, nsIPrincipal*) /editor/libeditor/EditorBase.cpp:5970:8
        #9 0x7f65c91ce0fc in mozilla::InsertPlaintextCommand::DoCommand(mozilla::Command, mozilla::EditorBase&, nsIPrincipal*) const /editor/libeditor/EditorCommands.cpp:832:19
        #10 0x7f65c664317f in mozilla::dom::Document::ExecCommand(nsTSubstring<char16_t> const&, bool, nsTSubstring<char16_t> const&, nsIPrincipal&, mozilla::ErrorResult&) /dom/base/Document.cpp:5309:37
        #11 0x7f65c769e0d3 in mozilla::dom::Document_Binding::execCommand(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/DocumentBinding.cpp:3475:36
        #12 0x7f65c7a173f7 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:3299:13
        #13 0x7f65cabc2af0 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:402:13
        #14 0x7f65cabc2272 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:489:12
        #15 0x7f65cabc3a79 in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:549:10
        #16 0x7f65cabb96dd in CallFromStack /js/src/vm/Interpreter.cpp:553:10
        #17 0x7f65cabb96dd in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3242:16
        #18 0x7f65cabb0545 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:371:13
        #19 0x7f65cabc228f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:521:13
        #20 0x7f65cabc3a79 in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:549:10
        #21 0x7f65cabc3cb1 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:566:8
        #22 0x7f65cad7bba3 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
        #23 0x7f65c7672c0e 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:61:8
        #24 0x7f65c7dd54e6 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
        #25 0x7f65c7dd523a in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) /dom/events/EventListenerManager.cpp:1115:43
        #26 0x7f65c7dd5ef2 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1312:17
        #27 0x7f65c7dcb205 in HandleEvent /dom/events/EventListenerManager.h:394:5
        #28 0x7f65c7dcb205 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:348:17
        #29 0x7f65c7dca71f in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:550:16
        #30 0x7f65c7dcd344 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /dom/events/EventDispatcher.cpp:1082:11
        #31 0x7f65c9451db3 in nsDocumentViewer::LoadComplete(nsresult) /layout/base/nsDocumentViewer.cpp:1087:7
        #32 0x7f65ca56cac4 in nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult) /docshell/base/nsDocShell.cpp:6284:20
        #33 0x7f65ca56c5bf in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /docshell/base/nsDocShell.cpp:5674:7
        #34 0x7f65ca56d43f in non-virtual thunk to nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /docshell/base/nsDocShell.cpp
        #35 0x7f65c5c56b6c in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult) /uriloader/base/nsDocLoader.cpp:1370:3
        #36 0x7f65c5c5613a in nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult) /uriloader/base/nsDocLoader.cpp:968:14
        #37 0x7f65c5c54547 in nsDocLoader::DocLoaderIsEmpty(bool, mozilla::Maybe<nsresult> const&) /uriloader/base/nsDocLoader.cpp:787:9
        #38 0x7f65c5c5572f in nsDocLoader::OnStopRequest(nsIRequest*, nsresult) /uriloader/base/nsDocLoader.cpp:670:5
        #39 0x7f65ca58cd28 in nsDocShell::OnStopRequest(nsIRequest*, nsresult) /docshell/base/nsDocShell.cpp:13438:23
        #40 0x7f65c4b574fa in mozilla::net::nsLoadGroup::NotifyRemovalObservers(nsIRequest*, nsresult) /netwerk/base/nsLoadGroup.cpp:614:22
        #41 0x7f65c4b58973 in mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) /netwerk/base/nsLoadGroup.cpp:518:10
        #42 0x7f65c6660a6d in mozilla::dom::Document::DoUnblockOnload() /dom/base/Document.cpp:11463:18
        #43 0x7f65c663d9d0 in mozilla::dom::Document::UnblockOnload(bool) /dom/base/Document.cpp:11393:9
        #44 0x7f65c664fcc6 in mozilla::dom::Document::DispatchContentLoadedEvents() /dom/base/Document.cpp:7901:3
        #45 0x7f65c66bf9a6 in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1148:12
        #46 0x7f65c66bf9a6 in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1154:12
        #47 0x7f65c66bf9a6 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:1201:13
        #48 0x7f65c49956c2 in mozilla::SchedulerGroup::Runnable::Run() /xpcom/threads/SchedulerGroup.cpp:144:20
        #49 0x7f65c49c04be in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:502:16
        #50 0x7f65c499e229 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:805:26
        #51 0x7f65c499d0a8 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:641:15
        #52 0x7f65c499d323 in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:425:36
        #53 0x7f65c49c3cb6 in operator() /xpcom/threads/TaskController.cpp:135:37
        #54 0x7f65c49c3cb6 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:532:5
        #55 0x7f65c49afe5f in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1148:16
        #56 0x7f65c49b68ca in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:466:10
        #57 0x7f65c52d7646 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #58 0x7f65c5231f17 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #59 0x7f65c5231e32 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #60 0x7f65c5231e32 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #61 0x7f65c90d2ab8 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27
        #62 0x7f65caa8cd13 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:917:20
        #63 0x7f65c52d853a in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #64 0x7f65c5231f17 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #65 0x7f65c5231e32 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #66 0x7f65c5231e32 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #67 0x7f65caa8c92e in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:749:34
        #68 0x55d5b3d4a9b6 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #69 0x55d5b3d4a9b6 in main /browser/app/nsBrowserApp.cpp:327:18
        #70 0x7f65d97290b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
        #71 0x55d5b3d277bc in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x157bc)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /editor/libeditor/WSRunObject.cpp:1922:5 in mozilla::WhiteSpaceVisibilityKeeper::MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange(mozilla::HTMLEditor&, mozilla::EditorDOMRangeBase<mozilla::EditorDOMPointBase<nsCOMPtr<nsINode>, nsCOMPtr<nsIContent> > > const&)
    ==2091122==ABORTING
Attached file Testcase

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20210806132505-92ef20a8efbe.
Failed to bisect testcase (Testcase reproduces on start build!):

Start: d51942b1e2d80cb9bfb1e5e5f21ba141e38fe065 (20200807033206)
End: b19fdf435550af00321e5e43ad7787843c590d88 (20210806095029)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False)

Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Component: DOM: Core & HTML → DOM: Editor
Blocks: 1710167
Severity: -- → S3
Priority: -- → P3
Depends on: domino
Blocks: domino
No longer depends on: domino

Bugmon was unable reproduce this issue.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Keywords: bugmon

A change to the Taskcluster build definitions over the weekend caused Bugmon to fail when reproducing issues. This issue has been corrected. Re-enabling bugmon.

Keywords: bugmon
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: