Closed Bug 1748271 Opened 2 years ago Closed 2 years ago

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

Categories

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

x86_64
Linux
defect

Tracking

()

VERIFIED FIXED
98 Branch
Tracking Status
firefox98 --- verified

People

(Reporter: jkratzer, Assigned: jgilbert)

References

(Blocks 1 open bug)

Details

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

Attachments

(2 files)

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

Please note that this issue is occurring frequently enough as to negatively impact fuzzing. Please prioritize accordingly.

Testcase can be reproduced using the following commands:

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

    ==46792==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f9e950c551c bp 0x7ffd815f2480 sp 0x7ffd815f2120 T46792)
    ==46792==The signal is caused by a WRITE memory access.
    ==46792==Hint: address points to the zero page.
        #0 0x7f9e950c551c in ToString /dom/canvas/ClientWebGLContext.cpp:3864:3
        #1 0x7f9e950c551c in operator() /dom/canvas/ClientWebGLContext.cpp:4041:24
        #2 0x7f9e950c551c 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:4018:15
        #3 0x7f9e9487ca4b 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 /dom/canvas/ClientWebGLContext.h:1613:5
        #4 0x7f9e9487b93e 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 0x7f9e94fbd3f8 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:3306:13
        #6 0x7f9e98a167af in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:425:13
        #7 0x7f9e98a15ead in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:512:12
        #8 0x7f9e98a1798e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10
        #9 0x7f9e98a0d196 in CallFromStack /js/src/vm/Interpreter.cpp:576:10
        #10 0x7f9e98a0d196 in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3309:16
        #11 0x7f9e98a040b3 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:394:13
        #12 0x7f9e98a15da8 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:544:13
        #13 0x7f9e98a1798e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10
        #14 0x7f9e98a17b91 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:589:8
        #15 0x7f9e98bd6fa1 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 0x7f9e94cd2cd7 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 0x7f9e95486286 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 0x7f9e9548600a in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) /dom/events/EventListenerManager.cpp:1303:43
        #19 0x7f9e95486d09 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1500:17
        #20 0x7f9e9547bd34 in HandleEvent /dom/events/EventListenerManager.h:395:5
        #21 0x7f9e9547bd34 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:348:17
        #22 0x7f9e9547b257 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:550:16
        #23 0x7f9e9547dab8 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 0x7f9e95480386 in mozilla::EventDispatcher::DispatchDOMEvent(nsISupports*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsPresContext*, nsEventStatus*) /dom/events/EventDispatcher.cpp
        #25 0x7f9e93cc5acd in nsINode::DispatchEvent(mozilla::dom::Event&, mozilla::dom::CallerType, mozilla::ErrorResult&) /dom/base/nsINode.cpp:1355:17
        #26 0x7f9e9381858a in 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:4305:28
        #27 0x7f9e93818387 in nsContentUtils::DispatchTrustedEvent(mozilla::dom::Document*, nsISupports*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, bool*) /dom/base/nsContentUtils.cpp:4275:10
        #28 0x7f9e93a46b5f in mozilla::dom::Document::DispatchContentLoadedEvents() /dom/base/Document.cpp:7891:3
        #29 0x7f9e93af834b in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12
        #30 0x7f9e93af834b in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12
        #31 0x7f9e93af834b 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
        #32 0x7f9e91c13162 in mozilla::SchedulerGroup::Runnable::Run() /xpcom/threads/SchedulerGroup.cpp:144:20
        #33 0x7f9e91c42a7e in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:468:16
        #34 0x7f9e91c1c716 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:771:26
        #35 0x7f9e91c1b3d8 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:607:15
        #36 0x7f9e91c1b653 in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:391:36
        #37 0x7f9e91c460e6 in operator() /xpcom/threads/TaskController.cpp:124:37
        #38 0x7f9e91c460e6 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:531:5
        #39 0x7f9e91c31053 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1183:16
        #40 0x7f9e91c382ba in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:467:10
        #41 0x7f9e926dabd6 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #42 0x7f9e925fa0b7 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #43 0x7f9e925f9fc2 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #44 0x7f9e925f9fc2 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #45 0x7f9e968775a8 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27
        #46 0x7f9e9889a333 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:864:20
        #47 0x7f9e926dbaca in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #48 0x7f9e925fa0b7 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #49 0x7f9e925f9fc2 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #50 0x7f9e925f9fc2 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #51 0x7f9e9889996b in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:701:34
        #52 0x5604b4262029 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #53 0x5604b4262029 in main /browser/app/nsBrowserApp.cpp:327:18
        #54 0x7f9ea83e50b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
        #55 0x5604b423d7bc in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x157bc)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /dom/canvas/ClientWebGLContext.cpp:3864:3 in ToString
    ==46792==ABORTING
Attached file Testcase

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

Start: 1d89f3cb5bb3e5a37b0249977838c4a98c162c80 (20210105043131)
End: 1cb2015e6fbc11f3a03137692fe60b111b94693a (20220103092929)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False)

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

The severity field is not set for this bug.
:jgilbert, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jgilbert)

This assert (written by...me) is bad and I should feel bad. This could have shown up statically at compile time, but nooooo.

Severity: -- → S4
Flags: needinfo?(jgilbert)
Priority: -- → P1
Assignee: nobody → jgilbert
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dbeabba7b21d
Make switch exhaustive so we don't assert. r=gfx-reviewers,aosmond
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

Bugmon Analysis
Verified bug as fixed on rev mozilla-central 20220125100058-e960e654cbc9.
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
See Also: → 1752167

: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, wrong needinfo because of a 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: