Closed Bug 1755578 Opened 3 years ago Closed 3 years ago

Crash [@ Is<mozilla::ContentPrincipal>]

Categories

(Core :: Graphics: Canvas2D, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1756186

People

(Reporter: jkratzer, Assigned: aosmond)

References

(Blocks 1 open bug, Regression)

Details

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

Crash Data

Attachments

(2 files)

Testcase found while fuzzing mozilla-central rev 2bbcda1a3414 (built with: --enable-fuzzing --enable-thread-sanitizer).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 2bbcda1a3414 --fuzzing --tsan -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.zip
[@ Is<mozilla::ContentPrincipal>]

    ==18782==ERROR: ThreadSanitizer: SEGV on unknown address 0x000000000070 (pc 0x7f996eecb367 bp 0x7b280004c360 sp 0x7ffda22f7450 T18782)
    ==18782==The signal is caused by a READ memory access.
    ==18782==Hint: address points to the zero page.
        #0 Is<mozilla::ContentPrincipal> /builds/worker/workspace/obj-build/dist/include/mozilla/BasePrincipal.h:95:18 (libxul.so+0x1fc4367)
        #1 mozilla::BasePrincipal::AddonPolicy() /caps/BasePrincipal.cpp:1095:7 (libxul.so+0x1fc4367)
        #2 mozilla::CanvasUtils::DoDrawImageSecurityCheck(mozilla::dom::HTMLCanvasElement*, nsIPrincipal*, bool, bool) /dom/canvas/CanvasUtils.cpp:254:40 (libxul.so+0x3892c71)
        #3 mozilla::dom::CanvasGeneralPattern::ForStyle(mozilla::dom::CanvasRenderingContext2D*, mozilla::dom::CanvasRenderingContext2D::Style, mozilla::gfx::DrawTarget*) /dom/canvas/CanvasRenderingContext2D.cpp:306:9 (libxul.so+0x3886cac)
        #4 mozilla::dom::CanvasRenderingContext2D::StrokeRect(double, double, double, double) /dom/canvas/CanvasRenderingContext2D.cpp:2785:30 (libxul.so+0x3887597)
        #5 mozilla::dom::CanvasRenderingContext2D_Binding::strokeRect(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/CanvasRenderingContext2DBinding.cpp:6042:24 (libxul.so+0x3006047)
        #6 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:3306:13 (libxul.so+0x37e771e)
        #7 CallJSNative /js/src/vm/Interpreter.cpp:425:13 (libxul.so+0x6ed7b32)
        #8 js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:512:12 (libxul.so+0x6ed7b32)
        #9 InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10 (libxul.so+0x6ed8b6e)
        #10 CallFromStack /js/src/vm/Interpreter.cpp:576:10 (libxul.so+0x6ecd9e3)
        #11 Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3309:16 (libxul.so+0x6ecd9e3)
        #12 js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:394:13 (libxul.so+0x6ec10e6)
        #13 js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:544:13 (libxul.so+0x6ed7cb9)
        #14 InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10 (libxul.so+0x6ed8b6e)
        #15 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:589:8 (libxul.so+0x6ed8c4a)
        #16 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 (libxul.so+0x7014c38)
        #17 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 (libxul.so+0x35b4801)
        #18 HandleEvent<mozilla::dom::EventTarget *> /builds/worker/workspace/obj-build/dist/include/mozilla/dom/EventListenerBinding.h:65:12 (libxul.so+0x3c84b79)
        #19 mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) /dom/events/EventListenerManager.cpp:1308:43 (libxul.so+0x3c84b79)
        #20 mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1505:17 (libxul.so+0x3c85697)
        #21 HandleEvent /dom/events/EventListenerManager.h:395:5 (libxul.so+0x3c7b9ae)
        #22 mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:348:17 (libxul.so+0x3c7b9ae)
        #23 mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:550:16 (libxul.so+0x3c7ad39)
        #24 mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /dom/events/EventDispatcher.cpp:1085:11 (libxul.so+0x3c7daf5)
        #25 mozilla::EventDispatcher::DispatchDOMEvent(nsISupports*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsPresContext*, nsEventStatus*) /dom/events/EventDispatcher.cpp (libxul.so+0x3c803f0)
        #26 nsINode::DispatchEvent(mozilla::dom::Event&, mozilla::dom::CallerType, mozilla::ErrorResult&) /dom/base/nsINode.cpp:1354:17 (libxul.so+0x2952fb8)
        #27 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:4311:28 (libxul.so+0x2675075)
        #28 nsContentUtils::DispatchTrustedEvent(mozilla::dom::Document*, nsISupports*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, bool*) /dom/base/nsContentUtils.cpp:4281:10 (libxul.so+0x2674f6c)
        #29 mozilla::dom::Document::DispatchContentLoadedEvents() /dom/base/Document.cpp:7891:3 (libxul.so+0x27d89ea)
        #30 applyImpl<FdWatcher, void (FdWatcher::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12 (libxul.so+0xe7a256)
        #31 apply<FdWatcher, void (FdWatcher::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12 (libxul.so+0xe7a256)
        #32 mozilla::detail::RunnableMethodImpl<nsUpdateProcessor*, void (nsUpdateProcessor::*)(), true, (mozilla::RunnableKind)0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1200:13 (libxul.so+0xe7a256)
        #33 mozilla::SchedulerGroup::Runnable::Run() /xpcom/threads/SchedulerGroup.cpp:140:20 (libxul.so+0xf79c7f)
        #34 mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:467:16 (libxul.so+0xfa61e7)
        #35 mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:770:26 (libxul.so+0xf831dd)
        #36 mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:606:15 (libxul.so+0xf818b6)
        #37 mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:390:36 (libxul.so+0xf81b92)
        #38 operator() /xpcom/threads/TaskController.cpp:124:37 (libxul.so+0xfa9147)
        #39 mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /xpcom/threads/nsThreadUtils.h:531:5 (libxul.so+0xfa9147)
        #40 nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1171:16 (libxul.so+0xf95703)
        #41 NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:467:10 (libxul.so+0xf9c422)
        #42 mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21 (libxul.so+0x18c969d)
        #43 mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:268:30 (libxul.so+0x18c9e9b)
        #44 RunInternal /ipc/chromium/src/base/message_loop.cc:331:10 (libxul.so+0x184b3cc)
        #45 RunHandler /ipc/chromium/src/base/message_loop.cc:324:3 (libxul.so+0x184b3cc)
        #46 MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3 (libxul.so+0x184b3cc)
        #47 nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27 (libxul.so+0x4e0e3f6)
        #48 XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:878:20 (libxul.so+0x6d9b279)
        #49 mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9 (libxul.so+0x18c9e4d)
        #50 RunInternal /ipc/chromium/src/base/message_loop.cc:331:10 (libxul.so+0x184b3cc)
        #51 RunHandler /ipc/chromium/src/base/message_loop.cc:324:3 (libxul.so+0x184b3cc)
        #52 MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3 (libxul.so+0x184b3cc)
        #53 XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:715:34 (libxul.so+0x6d9af7d)
        #54 mozilla::BootstrapImpl::XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/Bootstrap.cpp:67:12 (libxul.so+0x6da2d62)
        #55 content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28 (firefox+0xce3f7)
        #56 main /browser/app/nsBrowserApp.cpp:327:18 (firefox+0xce3f7)
        #57 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 (libc.so.6+0x270b2)
        #58 _start <null> (firefox+0x340df)
    
    ThreadSanitizer can not provide additional info.
    SUMMARY: ThreadSanitizer: SEGV /builds/worker/workspace/obj-build/dist/include/mozilla/BasePrincipal.h:95:18 in Is<mozilla::ContentPrincipal>
    ==18782==ABORTING
Attached file Testcase

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20220215210051-950c1613c97d.
The bug appears to have been introduced in the following build range:

Start: a9e0339866d239aa2995f0c2d9ab8b0414bcd395 (20211215203253)
End: 05eb5b87a4d96dd2aca133b9a3cd4d1b0706a577 (20211215222108)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=a9e0339866d239aa2995f0c2d9ab8b0414bcd395&tochange=05eb5b87a4d96dd2aca133b9a3cd4d1b0706a577

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

Probably one of your changes, Andrew?

Severity: -- → S3
Flags: needinfo?(aosmond)
Assignee: nobody → aosmond

:aosmond, 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?(aosmond)

I believe I fixed this as part of bug 1756186 since I encountered similar crashes in CI which I had to fix as part of landing it.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(aosmond)
Regressed by: 1751915
Resolution: --- → DUPLICATE
Has Regression Range: --- → yes

No valid actions for resolution (DUPLICATE).
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

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

Attachment

General

Created:
Updated:
Size: