Open Bug 1753773 Opened 2 years ago Updated 2 years ago

Assertion failure: srcGap >= 0 && dstGap >= 0, at src/gfx/2d/Swizzle.cpp:388

Categories

(Core :: Graphics: Canvas2D, defect, P3)

defect

Tracking

()

Tracking Status
firefox98 --- affected

People

(Reporter: tsmith, Unassigned)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

Attached file testcase.html

Found while fuzzing m-c 20220204-24a44838181c (--enable-debug --enable-fuzzing)

To reproduce via Grizzly Replay:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch -d --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html

Assertion failure: srcGap >= 0 && dstGap >= 0, at src/gfx/2d/Swizzle.cpp:388

#0 0x7faf5e983a9f in mozilla::gfx::PremultiplyData(unsigned char const*, int, mozilla::gfx::SurfaceFormat, unsigned char*, int, mozilla::gfx::SurfaceFormat, mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> const&) src/gfx/2d/Swizzle.cpp:388:3
#1 0x7faf607da211 in mozilla::dom::CanvasRenderingContext2D::PutImageData_explicit(int, int, mozilla::dom::ImageData&, bool, int, int, int, int, mozilla::ErrorResult&) src/dom/canvas/CanvasRenderingContext2D.cpp:5436:3
#2 0x7faf607da8cc in mozilla::dom::CanvasRenderingContext2D::PutImageData(mozilla::dom::ImageData&, int, int, int, int, int, int, mozilla::ErrorResult&) src/dom/canvas/CanvasRenderingContext2D.cpp:5308:3
#3 0x7faf5fccc5bb in mozilla::dom::CanvasRenderingContext2D_Binding::putImageData(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/CanvasRenderingContext2DBinding.cpp:4594:28
#4 0x7faf607091c8 in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) src/dom/bindings/BindingUtils.cpp:3306:13
#5 0x7faf6420d54f in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) src/js/src/vm/Interpreter.cpp:425:13
#6 0x7faf6420cc4d in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) src/js/src/vm/Interpreter.cpp:512:12
#7 0x7faf6420e72e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) src/js/src/vm/Interpreter.cpp:572:10
#8 0x7faf64203fe6 in CallFromStack src/js/src/vm/Interpreter.cpp:576:10
#9 0x7faf64203fe6 in Interpret(JSContext*, js::RunState&) src/js/src/vm/Interpreter.cpp:3309:16
#10 0x7faf641faee3 in js::RunScript(JSContext*, js::RunState&) src/js/src/vm/Interpreter.cpp:394:13
#11 0x7faf6420cb48 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) src/js/src/vm/Interpreter.cpp:544:13
#12 0x7faf6420e72e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) src/js/src/vm/Interpreter.cpp:572:10
#13 0x7faf6420e931 in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) src/js/src/vm/Interpreter.cpp:589:8
#14 0x7faf643ccfd1 in JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) src/js/src/vm/CallAndConstruct.cpp:117:10
#15 0x7faf60429f17 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:62:8
#16 0x7faf60c08cf6 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
#17 0x7faf60c08a7a in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) src/dom/events/EventListenerManager.cpp:1308:43
#18 0x7faf60c09779 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) src/dom/events/EventListenerManager.cpp:1505:17
#19 0x7faf60bfe774 in HandleEvent src/dom/events/EventListenerManager.h:395:5
#20 0x7faf60bfe774 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) src/dom/events/EventDispatcher.cpp:348:17
#21 0x7faf60bfdc97 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) src/dom/events/EventDispatcher.cpp:550:16
#22 0x7faf60c004f8 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) src/dom/events/EventDispatcher.cpp:1085:11
#23 0x7faf60c02dc6 in mozilla::EventDispatcher::DispatchDOMEvent(nsISupports*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsPresContext*, nsEventStatus*) src/dom/events/EventDispatcher.cpp
#24 0x7faf5f3ebb9d in nsINode::DispatchEvent(mozilla::dom::Event&, mozilla::dom::CallerType, mozilla::ErrorResult&) src/dom/base/nsINode.cpp:1355:17
#25 0x7faf5ef3a8da in nsContentUtils::DispatchEvent(mozilla::dom::Document*, nsISupports*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, mozilla::Trusted, bool*, mozilla::ChromeOnlyDispatch) src/dom/base/nsContentUtils.cpp:4314:28
#26 0x7faf5ef3a6d7 in nsContentUtils::DispatchTrustedEvent(mozilla::dom::Document*, nsISupports*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, bool*) src/dom/base/nsContentUtils.cpp:4284:10
#27 0x7faf5f16b06f in mozilla::dom::Document::DispatchContentLoadedEvents() src/dom/base/Document.cpp:7891:3
#28 0x7faf5f21ca2b in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12
#29 0x7faf5f21ca2b in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12
#30 0x7faf5f21ca2b 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:1200:13
#31 0x7faf5d314bc2 in mozilla::SchedulerGroup::Runnable::Run() src/xpcom/threads/SchedulerGroup.cpp:140:20
#32 0x7faf5d344fde in mozilla::RunnableTask::Run() src/xpcom/threads/TaskController.cpp:467:16
#33 0x7faf5d31ed56 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) src/xpcom/threads/TaskController.cpp:770:26
#34 0x7faf5d31da18 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) src/xpcom/threads/TaskController.cpp:606:15
#35 0x7faf5d31dc93 in mozilla::TaskController::ProcessPendingMTTask(bool) src/xpcom/threads/TaskController.cpp:390:36
#36 0x7faf5d348016 in operator() src/xpcom/threads/TaskController.cpp:124:37
#37 0x7faf5d348016 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:531:5
#38 0x7faf5d333733 in nsThread::ProcessNextEvent(bool, bool*) src/xpcom/threads/nsThread.cpp:1195:16
#39 0x7faf5d33a81a in NS_ProcessNextEvent(nsIThread*, bool) src/xpcom/threads/nsThreadUtils.cpp:467:10
#40 0x7faf5dddb886 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) src/ipc/glue/MessagePump.cpp:85:21
#41 0x7faf5dd005a7 in MessageLoop::RunInternal() src/ipc/chromium/src/base/message_loop.cc:331:10
#42 0x7faf5dd004b2 in RunHandler src/ipc/chromium/src/base/message_loop.cc:324:3
#43 0x7faf5dd004b2 in MessageLoop::Run() src/ipc/chromium/src/base/message_loop.cc:306:3
#44 0x7faf62035908 in nsBaseAppShell::Run() src/widget/nsBaseAppShell.cpp:137:27
#45 0x7faf640911a3 in XRE_RunAppShell() src/toolkit/xre/nsEmbedFunctions.cpp:878:20
#46 0x7faf5dddc77a in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) src/ipc/glue/MessagePump.cpp:235:9
#47 0x7faf5dd005a7 in MessageLoop::RunInternal() src/ipc/chromium/src/base/message_loop.cc:331:10
#48 0x7faf5dd004b2 in RunHandler src/ipc/chromium/src/base/message_loop.cc:324:3
#49 0x7faf5dd004b2 in MessageLoop::Run() src/ipc/chromium/src/base/message_loop.cc:306:3
#50 0x7faf640907dc in XRE_InitChildProcess(int, char**, XREChildData const*) src/toolkit/xre/nsEmbedFunctions.cpp:715:34
#51 0x560d8b13bb57 in content_process_main src/browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
#52 0x560d8b13bb57 in main src/browser/app/nsBrowserApp.cpp:327:18
#53 0x7faf721cb0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#54 0x560d8b1172dc in _start (/home/worker/builds/m-c-20220204092958-fuzzing-debug/firefox-bin+0x152dc)
Flags: in-testsuite?

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20220206212741-6dc962d81df3.
The bug appears to have been introduced in the following build range:

Start: 740fad344989d083fad880469a0555ac68010d34 (20211208214306)
End: 935f867d7bdaeeed38e25ad501479710cf4c759e (20211208210542)
Pushlog: https://hg.mozilla.org/mozilla-unified/pushloghtml?fromchange=740fad344989d083fad880469a0555ac68010d34&tochange=935f867d7bdaeeed38e25ad501479710cf4c759e

Whiteboard: [bugmon:bisected,confirmed]
Severity: -- → S3
Priority: -- → P3

Bugmon Analysis
Testcase crashes using the initial build (mozilla-central 20220204092958-24a44838181c) but not with tip (mozilla-central 20220514040948-28b2e8958185.)
The bug appears to have been fixed in the following build range:

Start: 97b50e3f5c3101a97ddba74d8e82ffb1bb4b7ebd (20220510052212)
End: 5e7354806d3aba6010a27a60d9e8833c452fef61 (20220510070729)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=97b50e3f5c3101a97ddba74d8e82ffb1bb4b7ebd&tochange=5e7354806d3aba6010a27a60d9e8833c452fef61
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

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

Attachment

General

Created:
Updated:
Size: