Open Bug 1450723 Opened 2 years ago Updated 1 year ago

Assertion failure: aDelta > 0 || s->mEditableDescendantCount >= (uint32_t) (-1 * aDelta), at /builds/worker/workspace/build/src/dom/base/nsINode.cpp:1227

Categories

(Core :: DOM: Core & HTML, defect, P3)

59 Branch
defect

Tracking

()

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, testcase)

Attachments

(1 file)

Attached file trigger.html
Testcase found while fuzzing mozilla-central rev c44f60c43432.

rax = 0x0000000000000000   rdx = 0x0000000000000000
rcx = 0x00007fb0954c42dd   rbx = 0x00000000ffffffff
rsi = 0x00007fb095793770   rdi = 0x00007fb095792540
rbp = 0x00007fff5ed319f0   rsp = 0x00007fff5ed319e0
r8 = 0x00007fb095793770    r9 = 0x00007fb09685e740
r10 = 0x0000000000000039   r11 = 0x0000000000000000
r12 = 0x00007fff5ed31a18   r13 = 0x00007fb073a5b4c0
r14 = 0x00000000ffffffff   r15 = 0x00007fb073a5b400
rip = 0x00007fb08453db27
OS|Linux|0.0.0 Linux 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64
CPU|amd64|family 6 model 78 stepping 3|1
GPU|||
Crash|SIGSEGV|0x0|0
0|0|libxul.so|nsINode::ChangeEditableDescendantCount|hg:hg.mozilla.org/mozilla-central:dom/base/nsINode.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|1226|0x18
0|1|libxul.so|nsGenericHTMLElement::ChangeEditableState|hg:hg.mozilla.org/mozilla-central:dom/html/nsGenericHTMLElement.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|2703|0xf
0|2|libxul.so|nsGenericHTMLElement::AfterSetAttr|hg:hg.mozilla.org/mozilla-central:dom/html/nsGenericHTMLElement.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|708|0xb
0|3|libxul.so|mozilla::dom::Element::UnsetAttr|hg:hg.mozilla.org/mozilla-central:dom/base/Element.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|3014|0x2c
0|4|libxul.so|nsGenericHTMLElement::SetContentEditable|hg:hg.mozilla.org/mozilla-central:dom/base/Element.h:c44f60c43432d468639b5fe078420e60c13fd3de|1569|0x16
0|5|libxul.so|mozilla::dom::HTMLElementBinding::set_contentEditable|s3:gecko-generated-sources:b86027297233892ced3545ad3b795b68896bc45f6b5fed9628556039ed6321933bded084af584d8162e7c425977a7298856700863fdb2b90022ac191209bc2bd/dom/bindings/HTMLElementBinding.cpp:|813|0xe
0|6|libxul.so|mozilla::dom::GenericBindingSetter|hg:hg.mozilla.org/mozilla-central:dom/bindings/BindingUtils.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|2993|0x10
0|7|libxul.so|js::CallJSNative|hg:hg.mozilla.org/mozilla-central:js/src/vm/JSContext-inl.h:c44f60c43432d468639b5fe078420e60c13fd3de|290|0x6
0|8|libxul.so|js::InternalCallOrConstruct|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|467|0xf
0|9|libxul.so|InternalCall|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|516|0xd
0|10|libxul.so|js::Call|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|535|0x5
0|11|libxul.so|js::CallSetter|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|664|0x5
0|12|libxul.so|SetExistingProperty|hg:hg.mozilla.org/mozilla-central:js/src/vm/NativeObject.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|2786|0xb
0|13|libxul.so|js::NativeSetProperty<(js::QualifiedBool)1u>|hg:hg.mozilla.org/mozilla-central:js/src/vm/NativeObject.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|2814|0x2f
0|14|libxul.so|js::SetProperty|hg:hg.mozilla.org/mozilla-central:js/src/vm/NativeObject.h:c44f60c43432d468639b5fe078420e60c13fd3de|1657|0x34
0|15|libxul.so|Interpret|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|264|0xc
0|16|libxul.so|js::RunScript|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|417|0xb
0|17|libxul.so|js::InternalCallOrConstruct|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|489|0xf
0|18|libxul.so|InternalCall|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|516|0xd
0|19|libxul.so|js::Call|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|535|0x5
0|20|libxul.so|JS::Call|hg:hg.mozilla.org/mozilla-central:js/src/jsapi.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|3003|0x20
0|21|libxul.so|mozilla::dom::EventListener::HandleEvent|s3:gecko-generated-sources:4f12b90540cb165dd19eac1b88402159c76e59990061216cada90a154be8b234c7f9a8578831d6a0eb2b0cf1645daa7d853b12949e597c37d4557860ba4f42ae/dom/bindings/EventListenerBinding.cpp:|47|0x5
0|22|libxul.so|mozilla::dom::EventListener::HandleEvent<mozilla::dom::EventTarget*>|s3:gecko-generated-sources:0502cca494d7ae0441ada14535523caade9340fdd09934cf6d31cc421267c319ae3d6f5b43b2730d0b36ae1c87480f3b426c5fa4fec57d51047d83a51acde602/dist/include/mozilla/dom/EventListenerBinding.h:|66|0x1c
0|23|libxul.so|mozilla::EventListenerManager::HandleEventSubType|hg:hg.mozilla.org/mozilla-central:dom/events/EventListenerManager.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|1087|0x36
0|24|libxul.so|mozilla::EventListenerManager::HandleEventInternal|hg:hg.mozilla.org/mozilla-central:dom/events/EventListenerManager.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|1259|0x19
0|25|libxul.so|mozilla::EventTargetChainItem::HandleEvent|hg:hg.mozilla.org/mozilla-central:dom/events/EventListenerManager.h:c44f60c43432d468639b5fe078420e60c13fd3de|376|0xa
0|26|libxul.so|mozilla::EventTargetChainItem::HandleEventTargetChain|hg:hg.mozilla.org/mozilla-central:dom/events/EventDispatcher.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|527|0xf
0|27|libxul.so|mozilla::EventDispatcher::Dispatch|hg:hg.mozilla.org/mozilla-central:dom/events/EventDispatcher.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|918|0xb
0|28|libxul.so|mozilla::EventDispatcher::DispatchDOMEvent|hg:hg.mozilla.org/mozilla-central:dom/events/EventDispatcher.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|1000|0x19
0|29|libxul.so|nsINode::DispatchEvent|hg:hg.mozilla.org/mozilla-central:dom/base/nsINode.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|1174|0x5
0|30|libxul.so|nsContentUtils::DispatchEvent|hg:hg.mozilla.org/mozilla-central:dom/base/nsContentUtils.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|4480|0x1c
0|31|libxul.so|nsContentUtils::DispatchTrustedEvent|hg:hg.mozilla.org/mozilla-central:dom/base/nsContentUtils.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|4449|0xf
0|32|libxul.so|nsIDocument::DispatchContentLoadedEvents|hg:hg.mozilla.org/mozilla-central:dom/base/nsDocument.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|5218|0x5
0|33|libxul.so|mozilla::detail::RunnableMethodImpl<nsIDocument*, void (nsIDocument::*)(), true, (mozilla::RunnableKind)0u>::Run|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThreadUtils.h:c44f60c43432d468639b5fe078420e60c13fd3de|1164|0x13
0|34|libxul.so|mozilla::SchedulerGroup::Runnable::Run|hg:hg.mozilla.org/mozilla-central:xpcom/threads/SchedulerGroup.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|415|0x1c
0|35|libxul.so|nsThread::ProcessNextEvent|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThread.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|1096|0x15
0|36|libxul.so|NS_ProcessNextEvent|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThreadUtils.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|519|0x11
0|37|libxul.so|mozilla::ipc::MessagePump::Run|hg:hg.mozilla.org/mozilla-central:ipc/glue/MessagePump.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|97|0xa
0|38|libxul.so|MessageLoop::RunInternal|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:c44f60c43432d468639b5fe078420e60c13fd3de|326|0x17
0|39|libxul.so|MessageLoop::Run|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:c44f60c43432d468639b5fe078420e60c13fd3de|319|0x8
0|40|libxul.so|nsBaseAppShell::Run|hg:hg.mozilla.org/mozilla-central:widget/nsBaseAppShell.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|157|0xd
0|41|libxul.so|XRE_RunAppShell|hg:hg.mozilla.org/mozilla-central:toolkit/xre/nsEmbedFunctions.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|893|0x11
0|42|libxul.so|mozilla::ipc::MessagePumpForChildProcess::Run|hg:hg.mozilla.org/mozilla-central:ipc/glue/MessagePump.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|269|0x5
0|43|libxul.so|MessageLoop::RunInternal|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:c44f60c43432d468639b5fe078420e60c13fd3de|326|0x17
0|44|libxul.so|MessageLoop::Run|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:c44f60c43432d468639b5fe078420e60c13fd3de|319|0x8
0|45|libxul.so|XRE_InitChildProcess|hg:hg.mozilla.org/mozilla-central:toolkit/xre/nsEmbedFunctions.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|719|0x8
0|46|firefox|content_process_main|hg:hg.mozilla.org/mozilla-central:ipc/contentproc/plugin-container.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|50|0x14
0|47|firefox|main|hg:hg.mozilla.org/mozilla-central:browser/app/nsBrowserApp.cpp:c44f60c43432d468639b5fe078420e60c13fd3de|280|0x11
0|48|libc-2.23.so||||0x20830
0|49|firefox|MOZ_ReportAssertionFailure|hg:hg.mozilla.org/mozilla-central:mfbt/Assertions.h:c44f60c43432d468639b5fe078420e60c13fd3de|164|0x5
Flags: in-testsuite?
Boris, it looks like you reviewed the patch in bug 1181130 that added this assertion. How important is it?
Flags: needinfo?(bzbarsky)
Hmm.  So mEditableDescendantCount is uint32_t.  If the assertion fails, that means that it will undeflow 0 and become a very large number.

It's used in:

1) nsIFrame::IsSelectable.  Having that return "true" incorrectly seems annoying but not fatal.

2) EditableInclusiveDescendantCount, which is used from various places that maintain the mEditableDescendantCount on various nodes.  

So it doesn't sound like a security problem at first glance or anything like that.  But it would be good to understand why the assertion is failing, of course....
Flags: needinfo?(bzbarsky)
Priority: -- → P3
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.