Closed Bug 1752167 Opened 3 years ago Closed 3 years ago

Hit MOZ_CRASH(MaxTypedArrayViewType) at /builds/worker/checkouts/gecko/dom/canvas/ClientWebGLContext.cpp:3873

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect

Tracking

()

VERIFIED FIXED
98 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox96 --- unaffected
firefox97 --- unaffected
firefox98 --- verified

People

(Reporter: tsmith, Assigned: jgilbert)

References

(Blocks 1 open bug)

Details

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

Crash Data

Attachments

(2 files)

Attached file testcase.html

Found while fuzzing m-c 20220125-e960e654cbc9 (--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 --xvfb

Hit MOZ_CRASH(MaxTypedArrayViewType) at /builds/worker/checkouts/gecko/dom/canvas/ClientWebGLContext.cpp:3873

#0 0x7fdd9ce87b87 in ToString src/dom/canvas/ClientWebGLContext.cpp:3873:7
#1 0x7fdd9ce87b87 in operator() src/dom/canvas/ClientWebGLContext.cpp:4052:24
#2 0x7fdd9ce87b87 in mozilla::ClientWebGLContext::TexImage(unsigned char, unsigned int, int, unsigned int, mozilla::avec3<int> const&, mozilla::avec3<int> const&, int, mozilla::webgl::PackingInfo const&, mozilla::TexImageSource const&) const src/dom/canvas/ClientWebGLContext.cpp:4029:15
#3 0x7fdd9c6c7bbb in mozilla::ClientWebGLContext::TexImage3D(unsigned int, int, unsigned int, int, int, int, int, unsigned int, unsigned int, mozilla::dom::ArrayBufferView_base<&(JS_GetArrayBufferViewType(JSObject*))> const&, unsigned int, mozilla::ErrorResult&) const src/dom/canvas/ClientWebGLContext.h:1615:5
#4 0x7fdd9c6c6aae in mozilla::dom::WebGL2RenderingContext_Binding::texImage3D(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/WebGL2RenderingContextBinding.cpp:3079:28
#5 0x7fdd9cd7bbf8 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
#6 0x7fdda0832baf in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) src/js/src/vm/Interpreter.cpp:425:13
#7 0x7fdda08322ad in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) src/js/src/vm/Interpreter.cpp:512:12
#8 0x7fdda0833d8e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) src/js/src/vm/Interpreter.cpp:572:10
#9 0x7fdda0829586 in CallFromStack src/js/src/vm/Interpreter.cpp:576:10
#10 0x7fdda0829586 in Interpret(JSContext*, js::RunState&) src/js/src/vm/Interpreter.cpp:3309:16
#11 0x7fdda0820493 in js::RunScript(JSContext*, js::RunState&) src/js/src/vm/Interpreter.cpp:394:13
#12 0x7fdda08321a8 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) src/js/src/vm/Interpreter.cpp:544:13
#13 0x7fdda0833d8e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) src/js/src/vm/Interpreter.cpp:572:10
#14 0x7fdda0833f91 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
#15 0x7fdda09f2741 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
#16 0x7fdd9ca9cb77 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
#17 0x7fdd9d24e116 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
#18 0x7fdd9d24de9a in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) src/dom/events/EventListenerManager.cpp:1308:43
#19 0x7fdd9d24eb99 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) src/dom/events/EventListenerManager.cpp:1505:17
#20 0x7fdd9d243b94 in HandleEvent src/dom/events/EventListenerManager.h:395:5
#21 0x7fdd9d243b94 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) src/dom/events/EventDispatcher.cpp:348:17
#22 0x7fdd9d2430b7 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) src/dom/events/EventDispatcher.cpp:550:16
#23 0x7fdd9d245918 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
#24 0x7fdd9ea08d23 in nsDocumentViewer::LoadComplete(nsresult) src/layout/base/nsDocumentViewer.cpp:1086:7
#25 0x7fdda0038a94 in nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult) src/docshell/base/nsDocShell.cpp:6278:20
#26 0x7fdda0038583 in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) src/docshell/base/nsDocShell.cpp:5667:7
#27 0x7fdda003941f in non-virtual thunk to nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) src/docshell/base/nsDocShell.cpp
#28 0x7fdd9ae3f15c in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult) src/uriloader/base/nsDocLoader.cpp:1377:3
#29 0x7fdd9ae3e6ea in nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult) src/uriloader/base/nsDocLoader.cpp:975:14
#30 0x7fdd9ae3ca70 in nsDocLoader::DocLoaderIsEmpty(bool, mozilla::Maybe<nsresult> const&) src/uriloader/base/nsDocLoader.cpp:794:9
#31 0x7fdd9ae3dc2d in nsDocLoader::OnStopRequest(nsIRequest*, nsresult) src/uriloader/base/nsDocLoader.cpp:677:5
#32 0x7fdda0059edd in nsDocShell::OnStopRequest(nsIRequest*, nsresult) src/docshell/base/nsDocShell.cpp:13540:23
#33 0x7fdd99ba45fa in mozilla::net::nsLoadGroup::NotifyRemovalObservers(nsIRequest*, nsresult) src/netwerk/base/nsLoadGroup.cpp:614:22
#34 0x7fdd99ba5be3 in mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) src/netwerk/base/nsLoadGroup.cpp:518:10
#35 0x7fdd9b810b15 in mozilla::dom::Document::DoUnblockOnload() src/dom/base/Document.cpp:11554:18
#36 0x7fdd9b7db673 in mozilla::dom::Document::UnblockOnload(bool) src/dom/base/Document.cpp:11484:9
#37 0x7fdd9b7f753b in mozilla::dom::Document::DispatchContentLoadedEvents() src/dom/base/Document.cpp:7999:3
#38 0x7fdd9b8a8b2b in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12
#39 0x7fdd9b8a8b2b in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12
#40 0x7fdd9b8a8b2b 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
#41 0x7fdd999a8e22 in mozilla::SchedulerGroup::Runnable::Run() src/xpcom/threads/SchedulerGroup.cpp:144:20
#42 0x7fdd999d915e in mozilla::RunnableTask::Run() src/xpcom/threads/TaskController.cpp:467:16
#43 0x7fdd999b2fb6 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) src/xpcom/threads/TaskController.cpp:770:26
#44 0x7fdd999b1c78 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) src/xpcom/threads/TaskController.cpp:606:15
#45 0x7fdd999b1ef3 in mozilla::TaskController::ProcessPendingMTTask(bool) src/xpcom/threads/TaskController.cpp:390:36
#46 0x7fdd999dc196 in operator() src/xpcom/threads/TaskController.cpp:124:37
#47 0x7fdd999dc196 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:531:5
#48 0x7fdd999c78b3 in nsThread::ProcessNextEvent(bool, bool*) src/xpcom/threads/nsThread.cpp:1195:16
#49 0x7fdd999ce99a in NS_ProcessNextEvent(nsIThread*, bool) src/xpcom/threads/nsThreadUtils.cpp:467:10
#50 0x7fdd9a472c06 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) src/ipc/glue/MessagePump.cpp:85:21
#51 0x7fdd9a392b17 in MessageLoop::RunInternal() src/ipc/chromium/src/base/message_loop.cc:331:10
#52 0x7fdd9a392a22 in RunHandler src/ipc/chromium/src/base/message_loop.cc:324:3
#53 0x7fdd9a392a22 in MessageLoop::Run() src/ipc/chromium/src/base/message_loop.cc:306:3
#54 0x7fdd9e65ab78 in nsBaseAppShell::Run() src/widget/nsBaseAppShell.cpp:137:27
#55 0x7fdda06b67d3 in XRE_RunAppShell() src/toolkit/xre/nsEmbedFunctions.cpp:870:20
#56 0x7fdd9a473afa in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) src/ipc/glue/MessagePump.cpp:235:9
#57 0x7fdd9a392b17 in MessageLoop::RunInternal() src/ipc/chromium/src/base/message_loop.cc:331:10
#58 0x7fdd9a392a22 in RunHandler src/ipc/chromium/src/base/message_loop.cc:324:3
#59 0x7fdd9a392a22 in MessageLoop::Run() src/ipc/chromium/src/base/message_loop.cc:306:3
#60 0x7fdda06b5e0c in XRE_InitChildProcess(int, char**, XREChildData const*) src/toolkit/xre/nsEmbedFunctions.cpp:707:34
#61 0x55cebfd43029 in content_process_main src/browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
#62 0x55cebfd43029 in main src/browser/app/nsBrowserApp.cpp:327:18
#63 0x7fddae8760b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#64 0x55cebfd1e7bc in _start (/home/worker/builds/m-c-20220125100058-fuzzing-debug/firefox-bin+0x157bc)
Flags: in-testsuite?

A Pernosco session is available here: https://pernos.co/debug/HLMbdp1_2NUpr2fRhPILtQ/index.html

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20220126163134-35652548842a.
Failed to bisect testcase (Testcase reproduces on start build!):

Start: 37557864a6845bb8068904e44e8a7dd16746d211 (20210128094617)
End: e960e654cbc9f60ce79eb1535fd6ec4e3acc2029 (20220125100058)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False)

Whiteboard: [bugmon:bisected,confirmed]
See Also: → 1748271
Crash Signature: [@ mozilla::ClientWebGLContext::TexImage ]

Unfortunately, this issue is occurring so frequently that it's having a negative impact on fuzzing (specifically, our new libfuzzer driven WebGL fuzzer). Kelsey, any idea what would be required to fix this?

Flags: needinfo?(jgilbert)
Whiteboard: [bugmon:bisected,confirmed] → [bugmon:bisected,confirmed][fuzzblocker]

People to not use MaxTypedArrayViewType as a valid type sentinel.
I can fix this again, but a wag of the finger at whatever's causing this.

Flags: needinfo?(jgilbert)

Also mention one reason that Type might be MaxTypedArrayViewType, which
otherwise sounds like a pure sentinel.

Assignee: nobody → jgilbert
Status: NEW → ASSIGNED
Attachment #9262039 - Attachment description: Bug 1752167 - Use official type(js::Scalar::Type). → Bug 1752167 - Use official name(js::Scalar::Type).
Pushed by jgilbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d01d48c261f9 Use official name(js::Scalar::Type). r=jonco
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

Bugmon Analysis
Verified bug as fixed on rev mozilla-central 20220204034627-3dd2d157c24a.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Status: RESOLVED → VERIFIED
Keywords: bugmon

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

Sorry, bug in the bot.

Flags: needinfo?(jgilbert)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: