Closed Bug 1729115 Opened 3 years ago Closed 3 years ago

ASSERTION: sContent and aContent are mismatched.: 'sContent.get() == aContent', file C:/Users/sasch/Documents/GitHub/gecko-dev/dom/events/IMEStateManager.cpp:1080

Categories

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

defect

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: saschanaz, Assigned: masayuki)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(5 files)

Steps, on Windows:

  1. Open dom/events/test/mochitest.ini and comment out disabled from test_bug1692277.html
  2. On debug build, run ./mach mochitest dom/events/test/test_bug1692052.html dom/events/test/test_bug1692277.html (somehow it does not happen alone but only with together)
  3. Somehow the Windows handwriting input panel opens and then the crash happens

CI log: https://treeherder.mozilla.org/jobs?repo=try&revision=0864c2f4267a95cfcf0c6509fcc84902c59f6f7a&selectedTaskRun=J-UKMkzPScGgMi6xD8rmFw.0

Stack:

NS_DebugBreak (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\base\nsDebugImpl.cpp:431)
mozilla::IMEStateManager::UpdateIMEState (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\events\IMEStateManager.cpp:1079)
mozilla::EditorBase::PostCreateInternal (C:\Users\sasch\Documents\GitHub\gecko-dev\editor\libeditor\EditorBase.cpp:464)
mozilla::HTMLEditor::PostCreate (C:\Users\sasch\Documents\GitHub\gecko-dev\editor\libeditor\HTMLEditor.cpp:363)
nsEditingSession::SetupEditorOnWindow (C:\Users\sasch\Documents\GitHub\gecko-dev\editor\composer\nsEditingSession.cpp:433)
nsEditingSession::MakeWindowEditable (C:\Users\sasch\Documents\GitHub\gecko-dev\editor\composer\nsEditingSession.cpp:164)
mozilla::dom::Document::EditingStateChanged (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\Document.cpp:6022)
mozilla::dom::Document::DeferredContentEditableCountChange (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\Document.cpp:6142)
mozilla::dom::DeferredContentEditableCountChangeEvent::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\Document.cpp:6116)
nsContentUtils::RemoveScriptBlocker (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\nsContentUtils.cpp:5684)
mozilla::dom::Document::EndUpdate (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\Document.cpp:7709)
mozAutoDocUpdate::~mozAutoDocUpdate (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\mozAutoDocUpdate.h:35)
mozilla::dom::Element::SetAttr (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\Element.cpp:2369)
mozilla::dom::Element::SetAttr (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dist\include\mozilla\dom\Element.h:941)
mozilla::dom::Element::SetAttr (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dist\include\mozilla\dom\Element.h:937)
mozilla::dom::Element::SetAttr (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dist\include\mozilla\dom\Element.h:1577)
nsGenericHTMLElement::SetHTMLAttr (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\html\nsGenericHTMLElement.h:742)
nsGenericHTMLElement::SetContentEditable (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\html\nsGenericHTMLElement.h:124)
mozilla::dom::HTMLElement_Binding::set_contentEditable (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dom\bindings\HTMLElementBinding.cpp:823)
mozilla::dom::binding_detail::GenericSetter<mozilla::dom::binding_detail::NormalThisPolicy> (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\bindings\BindingUtils.cpp:3248)
CallJSNative (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:401)
js::InternalCallOrConstruct (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:488)
InternalCall (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:548)
js::Call (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:565)
js::CallSetter (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:706)
SetExistingProperty (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\NativeObject.cpp:2565)
js::NativeSetProperty<js::Qualified> (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\NativeObject.cpp:2599)
js::SetProperty (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\ObjectOperations-inl.h:299)
SetObjectElementOperation (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:1758)
Interpret (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:3010)
js::RunScript (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:370)
js::InternalCallOrConstruct (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:520)
InternalCall (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:548)
js::Call (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\Interpreter.cpp:565)
JS::Call (C:\Users\sasch\Documents\GitHub\gecko-dev\js\src\vm\CallAndConstruct.cpp:117)
mozilla::dom::EventListener::HandleEvent (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dom\bindings\EventListenerBinding.cpp:62)
mozilla::dom::EventListener::HandleEvent<mozilla::dom::EventTarget *> (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dist\include\mozilla\dom\EventListenerBinding.h:65)
mozilla::EventListenerManager::HandleEventSubType (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\events\EventListenerManager.cpp:1117)
mozilla::EventListenerManager::HandleEventInternal (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\events\EventListenerManager.cpp:1311)
mozilla::EventListenerManager::HandleEvent (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\events\EventListenerManager.h:396)
mozilla::EventTargetChainItem::HandleEvent (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\events\EventDispatcher.cpp:351)
mozilla::EventTargetChainItem::HandleEventTargetChain (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\events\EventDispatcher.cpp:552)
mozilla::EventDispatcher::Dispatch (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\events\EventDispatcher.cpp:1085)
nsDocumentViewer::LoadComplete (C:\Users\sasch\Documents\GitHub\gecko-dev\layout\base\nsDocumentViewer.cpp:1088)
nsDocShell::EndPageLoad (C:\Users\sasch\Documents\GitHub\gecko-dev\docshell\base\nsDocShell.cpp:6284)
nsDocShell::OnStateChange (C:\Users\sasch\Documents\GitHub\gecko-dev\docshell\base\nsDocShell.cpp:5675)
nsDocLoader::DoFireOnStateChange (C:\Users\sasch\Documents\GitHub\gecko-dev\uriloader\base\nsDocLoader.cpp:1376)
nsDocLoader::doStopDocumentLoad (C:\Users\sasch\Documents\GitHub\gecko-dev\uriloader\base\nsDocLoader.cpp:973)
nsDocLoader::DocLoaderIsEmpty (C:\Users\sasch\Documents\GitHub\gecko-dev\uriloader\base\nsDocLoader.cpp:795)
nsDocLoader::OnStopRequest (C:\Users\sasch\Documents\GitHub\gecko-dev\uriloader\base\nsDocLoader.cpp:677)
nsDocShell::OnStopRequest (C:\Users\sasch\Documents\GitHub\gecko-dev\docshell\base\nsDocShell.cpp:13468)
mozilla::net::nsLoadGroup::NotifyRemovalObservers (C:\Users\sasch\Documents\GitHub\gecko-dev\netwerk\base\nsLoadGroup.cpp:614)
mozilla::net::nsLoadGroup::RemoveRequest (C:\Users\sasch\Documents\GitHub\gecko-dev\netwerk\base\nsLoadGroup.cpp:518)
mozilla::dom::Document::DoUnblockOnload (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\Document.cpp:11452)
mozilla::dom::Document::UnblockOnload (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\Document.cpp:11381)
mozilla::dom::Document::DispatchContentLoadedEvents (C:\Users\sasch\Documents\GitHub\gecko-dev\dom\base\Document.cpp:7902)
mozilla::detail::RunnableMethodArguments<>::applyImpl<mozilla::dom::Document,void (mozilla::dom::Document::*)()> (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dist\include\nsThreadUtils.h:1147)
mozilla::detail::RunnableMethodArguments<>::apply<mozilla::dom::Document,void (mozilla::dom::Document::*)()> (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dist\include\nsThreadUtils.h:1153)
mozilla::detail::RunnableMethodImpl<mozilla::dom::Document *,void (mozilla::dom::Document::*)(),1,mozilla::RunnableKind::Standard>::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dist\include\nsThreadUtils.h:1203)
mozilla::SchedulerGroup::Runnable::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\threads\SchedulerGroup.cpp:144)
mozilla::RunnableTask::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\threads\TaskController.cpp:502)
mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\threads\TaskController.cpp:805)
mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\threads\TaskController.cpp:641)
mozilla::TaskController::ProcessPendingMTTask (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\threads\TaskController.cpp:425)
mozilla::TaskController::InitializeInternal::<unnamed-tag>::operator() (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\threads\TaskController.cpp:135)
mozilla::detail::RunnableFunction<`lambda at C:/Users/sasch/Documents/GitHub/gecko-dev/xpcom/threads/TaskController.cpp:135:7'>::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\obj-dbg\dist\include\nsThreadUtils.h:532)
nsThread::ProcessNextEvent (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\threads\nsThread.cpp:1151)
NS_ProcessNextEvent (C:\Users\sasch\Documents\GitHub\gecko-dev\xpcom\threads\nsThreadUtils.cpp:466)
mozilla::ipc::MessagePump::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\glue\MessagePump.cpp:85)
mozilla::ipc::MessagePumpForChildProcess::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\glue\MessagePump.cpp:269)
MessageLoop::RunInternal (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\chromium\src\base\message_loop.cc:331)
MessageLoop::RunHandler (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\chromium\src\base\message_loop.cc:325)
MessageLoop::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\chromium\src\base\message_loop.cc:307)
nsBaseAppShell::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\widget\nsBaseAppShell.cpp:139)
nsAppShell::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\widget\windows\nsAppShell.cpp:603)
XRE_RunAppShell (C:\Users\sasch\Documents\GitHub\gecko-dev\toolkit\xre\nsEmbedFunctions.cpp:917)
mozilla::ipc::MessagePumpForChildProcess::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\glue\MessagePump.cpp:235)
MessageLoop::RunInternal (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\chromium\src\base\message_loop.cc:331)
MessageLoop::RunHandler (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\chromium\src\base\message_loop.cc:325)
MessageLoop::Run (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\chromium\src\base\message_loop.cc:307)
XRE_InitChildProcess (C:\Users\sasch\Documents\GitHub\gecko-dev\toolkit\xre\nsEmbedFunctions.cpp:753)
mozilla::BootstrapImpl::XRE_InitChildProcess (C:\Users\sasch\Documents\GitHub\gecko-dev\toolkit\xre\Bootstrap.cpp:67)
content_process_main (C:\Users\sasch\Documents\GitHub\gecko-dev\ipc\contentproc\plugin-container.cpp:57)
NS_internal_main (C:\Users\sasch\Documents\GitHub\gecko-dev\browser\app\nsBrowserApp.cpp:327)
wmain (C:\Users\sasch\Documents\GitHub\gecko-dev\toolkit\xre\nsWindowsWMain.cpp:131)
__scrt_common_main_seh (d:\a01\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
Attached file full log

Hi Masayuki, can you see what's happening here?

Flags: needinfo?(masayuki)

Well, the window for the previous test is closed after SimpleTest.finish() call:
https://searchfox.org/mozilla-central/rev/36a784a4c4b666c3da6677259a635c48a058c95a/dom/events/test/file_bug1692052.html#17

This might cause confusion of focus management with this call:
https://searchfox.org/mozilla-central/rev/36a784a4c4b666c3da6677259a635c48a058c95a/dom/events/test/test_bug1692277.html#35

However, I have no concrete idea. How about to get a log of IMEStateManager:5,sync?

Flags: needinfo?(masayuki) → needinfo?(krosylight)

Actually running a single test is enough to reproduce this: ./mach mochitest --keep-open=false dom/events/test/test_bug1692052.html

Flags: needinfo?(krosylight) → needinfo?(masayuki)
Attachment #9242555 - Attachment mime type: application/octet-stream → text/plain

IMEStateManager OnChangeFocus() hasn't been called with the <canvas> element after becoming editable. So it detects a bug. Perhaps, there was no active IME content observer, and nothing has focus, IMEStateManager::UpdateIMEState() needs to call IMEStateManager::OnChangeFocus() manually.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)

Masayuki: can you please set severity and priority for this ticket? It'll result in the ticket disappearing from the DOM Core triage list.

Flags: needinfo?(masayuki)

Changing severity to N/A because of not affected to release builds.

Severity: -- → N/A
Depends on: 1732845
Flags: needinfo?(masayuki)
Priority: -- → P3

Changing severity to S4 because N/A results in autonag emails.

Severity: N/A → S4

For making it possible to check whether an expected node is observed by
IMEContentObserver or not in mochitest, the following patches need this API.

Depends on D126764

Some information which is added by this patch are required when I debug this
bug so that these additional information may help developers in the future
too.

Depends on D127610

nsFocusManager does not send focus event in some cases, e.g., non-editable
root element gets focus. However, the element may become editable later without
a focus move. Therefore, even if IMEStateManager::sContent is nullptr,
IMEStateManager::UpdateIMEState() and IMEStateManager::FocusInEditor() are
called with focused content when the uncomposed document is in design mode.

With this change, editor does not need to call IMEStateManager methods with
nullptr when it's in designMode. Therefore, we can get rid of
GetFocusedContentForIME() which just returns nullptr if focused content is
in design mode.

Depends on D127611

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/413e4df87214
part 1: Make it possible tests to retrieve a node being observed by `IMEContentObserver` for the following changes r=smaug
https://hg.mozilla.org/integration/autoland/rev/cfd34d4f5760
part 2: Improve some log in `IMEStateManager` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/d51a3f460230
part 3: Make `IMEStateManager` check whether given focused content matches with null `sContent` in design mode r=m_kato
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: