Open Bug 1792061 Opened 3 years ago Updated 11 months ago

Assertion failure: leaf, at /dom/events/EventStateManager.cpp:5778

Categories

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

x86_64
Linux
defect

Tracking

()

REOPENED

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: intermittent-failure, testcase, Whiteboard: [bugmon:bisected,confirmed])

Attachments

(1 file)

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

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build c9041757a18a --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
Assertion failure: leaf, at /dom/events/EventStateManager.cpp:5778

    ==184697==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f5efb41f9e1 bp 0x7fffe458a920 sp 0x7fffe458a8e0 T184697)
    ==184697==The signal is caused by a WRITE memory access.
    ==184697==Hint: address points to the zero page.
        #0 0x7f5efb41f9e1 in mozilla::EventStateManager::RemoveNodeFromChainIfNeeded(mozilla::dom::ElementState, nsIContent*, bool) /dom/events/EventStateManager.cpp:5778:3
        #1 0x7f5efb41fcd6 in mozilla::EventStateManager::ContentRemoved(mozilla::dom::Document*, nsIContent*) /dom/events/EventStateManager.cpp:5855:3
        #2 0x7f5efd09e4ff in mozilla::PresShell::ContentRemoved(nsIContent*, nsIContent*) /layout/base/PresShell.cpp:4603:38
        #3 0x7f5ef98a32bb in operator() /dom/base/MutationObservers.cpp:196:3
        #4 0x7f5ef98a32bb in Notify<IsRemoval::Yes, ShouldAssert::Yes, (lambda at /dom/base/MutationObservers.cpp:196:3), (lambda at /dom/base/MutationObservers.cpp:196:3)> /dom/base/MutationObservers.cpp:91:5
        #5 0x7f5ef98a32bb in mozilla::dom::MutationObservers::NotifyContentRemoved(nsINode*, nsIContent*, nsIContent*) /dom/base/MutationObservers.cpp:197:3
        #6 0x7f5ef9a2f40b in nsINode::RemoveChildNode(nsIContent*, bool) /dom/base/nsINode.cpp:2182:5
        #7 0x7f5ef9795cda in mozilla::dom::Document::RemoveChildNode(nsIContent*, bool) /dom/base/Document.cpp:7148:12
        #8 0x7f5ef9a2ef20 in nsINode::ReplaceChildren(nsINode*, mozilla::ErrorResult&) /dom/base/nsINode.cpp:2150:5
        #9 0x7f5ef9a2eba0 in nsINode::ReplaceChildren(mozilla::dom::Sequence<mozilla::dom::OwningNodeOrString> const&, mozilla::ErrorResult&) /dom/base/nsINode.cpp:2132:10
        #10 0x7f5efab20321 in mozilla::dom::Document_Binding::replaceChildren(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/DocumentBinding.cpp:19319:24
        #11 0x7f5efaeb802c 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:3287:13
        #12 0x7f5f00563cfc in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:458:13
        #13 0x7f5f00563621 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:546:12
        #14 0x7f5f0055a958 in CallFromStack /js/src/vm/Interpreter.cpp:618:10
        #15 0x7f5f0055a958 in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3374:16
        #16 0x7f5f005519fd in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:430:13
        #17 0x7f5f0056351d in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:578:13
        #18 0x7f5f00564a5c 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:645:8
        #19 0x7f5eff421077 in js::CallSelfHostedFunction(JSContext*, JS::Handle<js::PropertyName*>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) /js/src/vm/SelfHosting.cpp:1498:10
        #20 0x7f5eff1b7f69 in AsyncFunctionResume(JSContext*, JS::Handle<js::AsyncFunctionGeneratorObject*>, ResumeKind, JS::Handle<JS::Value>) /js/src/vm/AsyncFunction.cpp:154:8
        #21 0x7f5eff3a008f in AsyncFunctionPromiseReactionJob /js/src/builtin/Promise.cpp:2111:12
        #22 0x7f5eff3a008f in PromiseReactionJob(JSContext*, unsigned int, JS::Value*) /js/src/builtin/Promise.cpp:2174:12
        #23 0x7f5f00563cfc in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:458:13
        #24 0x7f5f00563621 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:546:12
        #25 0x7f5f00564a5c 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:645:8
        #26 0x7f5eff1e391c 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
        #27 0x7f5efa0e692d in mozilla::dom::PromiseJobCallback::Call(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/PromiseBinding.cpp:35:8
        #28 0x7f5ef7c4d015 in mozilla::dom::PromiseJobCallback::Call(mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObject::ExceptionHandling, JS::Realm*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:88:12
        #29 0x7f5ef7c4c2d3 in Call /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:101:12
        #30 0x7f5ef7c4c2d3 in mozilla::PromiseJobRunnable::Run(mozilla::AutoSlowOperation&) /xpcom/base/CycleCollectedJSContext.cpp:213:18
        #31 0x7f5ef7c39f78 in mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool) /xpcom/base/CycleCollectedJSContext.cpp:676:17
        #32 0x7f5ef7c3adec in mozilla::CycleCollectedJSContext::AfterProcessTask(unsigned int) /xpcom/base/CycleCollectedJSContext.cpp:463:3
        #33 0x7f5ef8ae2cb5 in XPCJSContext::AfterProcessTask(unsigned int) /js/xpconnect/src/XPCJSContext.cpp:1480:28
        #34 0x7f5ef7d5e0dc in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1242:24
        #35 0x7f5ef7d6432d in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:465:10
        #36 0x7f5ef8944716 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #37 0x7f5ef8869d77 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:381:10
        #38 0x7f5ef8869c82 in RunHandler /ipc/chromium/src/base/message_loop.cc:374:3
        #39 0x7f5ef8869c82 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:356:3
        #40 0x7f5efcd27708 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:150:27
        #41 0x7f5efef1e89b in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:880:20
        #42 0x7f5ef894560a in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #43 0x7f5ef8869d77 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:381:10
        #44 0x7f5ef8869c82 in RunHandler /ipc/chromium/src/base/message_loop.cc:374:3
        #45 0x7f5ef8869c82 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:356:3
        #46 0x7f5efef1ddb3 in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:739:34
        #47 0x55aa0a509b39 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #48 0x55aa0a509b39 in main /browser/app/nsBrowserApp.cpp:359:18
        #49 0x7f5f0f07ed8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
        #50 0x7f5f0f07ee3f in __libc_start_main csu/../csu/libc-start.c:392:3
        #51 0x55aa0a4df8dc in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x168dc) (BuildId: e5b5ca556772264f29159c13c21a77fdcef14354)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /dom/events/EventStateManager.cpp:5778:3 in mozilla::EventStateManager::RemoveNodeFromChainIfNeeded(mozilla::dom::ElementState, nsIContent*, bool)
    ==184697==ABORTING
Attached file Testcase —
Keywords: bugmon

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20220926093803-7e4f996f7537.
Unable to bisect testcase (Testcase reproduces on start build!):

Start: 5f100fef718b82fe7327e1e5fa40a77e4a13ca80 (20210927093458)
End: c9041757a18ac481d701af85012d9c7c9720db7a (20220922095647)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False, nyx=False)

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

The stack looks very similar to bug 1780802. Emilio was needinfo'ed there, CC him here, too.

See Also: → 1780802
Severity: -- → S3

Bugmon Analysis
Unable to reproduce bug 1792061 using build mozilla-central 20220922095647-c9041757a18a. 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
Status: NEW → RESOLVED
Closed: 3 years ago
Duplicate of bug: 1778544
Resolution: --- → DUPLICATE

:CosminS, since this bug has a test script to reproduce the issue, so I would suggest we reopen this one and make it block bug 1778544 instead. WDYT?

Flags: needinfo?(csabou)

Edgar, sounds good to me.

Blocks: 1778544
Status: RESOLVED → REOPENED
No longer duplicate of bug: 1778544
Flags: needinfo?(csabou)
Resolution: DUPLICATE → ---
See Also: → 1974208
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: