Closed Bug 1741468 Opened 2 years ago Closed 2 years ago

Assertion failure: false, at /dom/canvas/ClientWebGLContext.cpp:3795

Categories

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

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1748271
Tracking Status
firefox97 --- affected

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

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

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 3890e2f0b025 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
Assertion failure: false, at /dom/canvas/ClientWebGLContext.cpp:3795

    ==361918==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fba24145526 bp 0x7ffd9f2fa2d0 sp 0x7ffd9f2f9f80 T361918)
    ==361918==The signal is caused by a WRITE memory access.
    ==361918==Hint: address points to the zero page.
        #0 0x7fba24145526 in ToString /dom/canvas/ClientWebGLContext.cpp:3795:3
        #1 0x7fba24145526 in operator() /dom/canvas/ClientWebGLContext.cpp:3967:24
        #2 0x7fba24145526 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 /dom/canvas/ClientWebGLContext.cpp:3944:15
        #3 0x7fba2396325c in void mozilla::ClientWebGLContext::TexImage2D<mozilla::dom::RootedSpiderMonkeyInterface<mozilla::dom::Nullable<mozilla::dom::ArrayBufferView_base<&(JS_GetArrayBufferViewType(JSObject*))> > > >(unsigned int, int, unsigned int, int, int, int, unsigned int, unsigned int, mozilla::dom::RootedSpiderMonkeyInterface<mozilla::dom::Nullable<mozilla::dom::ArrayBufferView_base<&(JS_GetArrayBufferViewType(JSObject*))> > > const&, mozilla::ErrorResult&) const /dom/canvas/ClientWebGLContext.h:1555:5
        #4 0x7fba23961faf in mozilla::dom::WebGL2RenderingContext_Binding::texImage2D(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/WebGL2RenderingContextBinding.cpp:2179:32
        #5 0x7fba24066288 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:3300:13
        #6 0x7fba27980b1f in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:387:13
        #7 0x7fba2798022b in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:474:12
        #8 0x7fba27981cfe in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:534:10
        #9 0x7fba279774f3 in CallFromStack /js/src/vm/Interpreter.cpp:538:10
        #10 0x7fba279774f3 in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3242:16
        #11 0x7fba2796e2e3 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:356:13
        #12 0x7fba27980126 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:506:13
        #13 0x7fba27981cfe in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:534:10
        #14 0x7fba27981f01 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:551:8
        #15 0x7fba27b3a5b1 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
        #16 0x7fba23d79037 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 0x7fba244712e6 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 0x7fba2447106a in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) /dom/events/EventListenerManager.cpp:1117:43
        #19 0x7fba24471d69 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1314:17
        #20 0x7fba244677d4 in HandleEvent /dom/events/EventListenerManager.h:394:5
        #21 0x7fba244677d4 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:348:17
        #22 0x7fba24466cf7 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:550:16
        #23 0x7fba24469558 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /dom/events/EventDispatcher.cpp:1085:11
        #24 0x7fba25bf5343 in nsDocumentViewer::LoadComplete(nsresult) /layout/base/nsDocumentViewer.cpp:1087:7
        #25 0x7fba27198b24 in nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult) /docshell/base/nsDocShell.cpp:6333:20
        #26 0x7fba27198613 in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /docshell/base/nsDocShell.cpp:5722:7
        #27 0x7fba271994af in non-virtual thunk to nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /docshell/base/nsDocShell.cpp
        #28 0x7fba22331c5c in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult) /uriloader/base/nsDocLoader.cpp:1376:3
        #29 0x7fba223311ea in nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult) /uriloader/base/nsDocLoader.cpp:974:14
        #30 0x7fba2232f570 in nsDocLoader::DocLoaderIsEmpty(bool, mozilla::Maybe<nsresult> const&) /uriloader/base/nsDocLoader.cpp:793:9
        #31 0x7fba2233072d in nsDocLoader::OnStopRequest(nsIRequest*, nsresult) /uriloader/base/nsDocLoader.cpp:676:5
        #32 0x7fba271b9a7d in nsDocShell::OnStopRequest(nsIRequest*, nsresult) /docshell/base/nsDocShell.cpp:13586:23
        #33 0x7fba210dbefa in mozilla::net::nsLoadGroup::NotifyRemovalObservers(nsIRequest*, nsresult) /netwerk/base/nsLoadGroup.cpp:614:22
        #34 0x7fba210dd4e3 in mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) /netwerk/base/nsLoadGroup.cpp:518:10
        #35 0x7fba22c0e36d in mozilla::dom::Document::DoUnblockOnload() /dom/base/Document.cpp:11555:18
        #36 0x7fba22beae3d in mozilla::dom::Document::UnblockOnload(bool) /dom/base/Document.cpp:11485:9
        #37 0x7fba22bfd406 in mozilla::dom::Document::DispatchContentLoadedEvents() /dom/base/Document.cpp:7987:3
        #38 0x7fba22c729a6 in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12
        #39 0x7fba22c729a6 in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12
        #40 0x7fba22c729a6 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 0x7fba20ee7cc2 in mozilla::SchedulerGroup::Runnable::Run() /xpcom/threads/SchedulerGroup.cpp:144:20
        #42 0x7fba20f17a4e in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:468:16
        #43 0x7fba20ef1366 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:771:26
        #44 0x7fba20ef0028 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:607:15
        #45 0x7fba20ef02a3 in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:391:36
        #46 0x7fba20f1b046 in operator() /xpcom/threads/TaskController.cpp:124:37
        #47 0x7fba20f1b046 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:531:5
        #48 0x7fba20f05d53 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1175:16
        #49 0x7fba20f0cf3a in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:467:10
        #50 0x7fba2199a106 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #51 0x7fba218b9747 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #52 0x7fba218b9652 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #53 0x7fba218b9652 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #54 0x7fba25849458 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27
        #55 0x7fba27804013 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:917:20
        #56 0x7fba2199affa in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #57 0x7fba218b9747 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #58 0x7fba218b9652 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #59 0x7fba218b9652 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #60 0x7fba2780364b in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:749:34
        #61 0x55d5b8d37e49 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #62 0x55d5b8d37e49 in main /browser/app/nsBrowserApp.cpp:327:18
        #63 0x7fba387710b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
        #64 0x55d5b8d135dc in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x155dc)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /dom/canvas/ClientWebGLContext.cpp:3795:3 in ToString
    ==361918==ABORTING
Attached file Testcase

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20211116212601-0799fad6d9ec.
Failed to bisect testcase (Unable to launch the start build!):

Start: 42e7e98c701d3e8c8c66a5acca0f0aeeb5076661 (20201118041908)
End: 3890e2f0b0250c7d13367b969f483996ac1c2e81 (20211116093425)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False)

Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Severity: -- → S3
Priority: -- → P3
Component: Canvas: 2D → Canvas: WebGL

Bugmon Analysis
Testcase crashes using the initial build (mozilla-central 20211116093425-3890e2f0b025) but not with tip (mozilla-central 20220128155052-48e8fb0b62c5.)
The bug appears to have been fixed in the following build range:

Start: 9b23d1bb84b2499b94d91c5f588fc93a54e5bdcc (20220124214229)
End: e960e654cbc9f60ce79eb1535fd6ec4e3acc2029 (20220125100058)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=9b23d1bb84b2499b94d91c5f588fc93a54e5bdcc&tochange=e960e654cbc9f60ce79eb1535fd6ec4e3acc2029
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: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: