Assertion failure: [GFX1]: void mozilla::gl::GLContext::fUniform1iv(GLint, GLsizei, const GLint *): Generated unexpected GL_INVALID_OPERATION error, at /gfx/2d/Logging.h:751
Categories
(Core :: Graphics: CanvasWebGL, defect, P2)
Tracking
()
People
(Reporter: jkratzer, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: testcase, Whiteboard: [bugmon:bisected,confirmed])
Attachments
(2 files)
Testcase found while fuzzing mozilla-central rev bb528a123b65 (built with: --enable-debug --enable-fuzzing).
Testcase can be reproduced using the following commands:
$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build bb528a123b65 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
Assertion failure: [GFX1]: void mozilla::gl::GLContext::fUniform1iv(GLint, GLsizei, const GLint *): Generated unexpected GL_INVALID_OPERATION error, at /gfx/2d/Logging.h:751
==1743070==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f04da973bbf bp 0x7ffc208079d0 sp 0x7ffc208079c0 T1743070)
==1743070==The signal is caused by a WRITE memory access.
==1743070==Hint: address points to the zero page.
#0 0x7f04da973bbf in mozilla::gfx::Log<1, mozilla::gfx::CriticalLogger>::WriteLog(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /gfx/2d/Logging.h:752:9
#1 0x7f04da973ace in mozilla::gfx::Log<1, mozilla::gfx::CriticalLogger>::Flush() /gfx/2d/Logging.h:277:7
#2 0x7f04da9ac87e in mozilla::gfx::Log<1, mozilla::gfx::CriticalLogger>::~Log() /gfx/2d/Logging.h:270:12
#3 0x7f04daa57122 in mozilla::gl::GLContext::AfterGLCall_Debug(char const*) const /gfx/gl/GLContext.cpp:2604:7
#4 0x7f04dc94c64a in mozilla::WebGLContext::UniformData(unsigned int, bool, mozilla::Range<unsigned char const> const&) const /dom/canvas/WebGLContextGL.cpp:1387:3
#5 0x7f04dc88921c in UniformData /dom/canvas/HostWebGLContext.h:587:15
#6 0x7f04dc88921c in void mozilla::ClientWebGLContext::Run<void (mozilla::HostWebGLContext::*)(unsigned int, bool, mozilla::RawBuffer<unsigned char> const&) const, &(mozilla::HostWebGLContext::UniformData(unsigned int, bool, mozilla::RawBuffer<unsigned char> const&) const), unsigned int&, bool&, mozilla::RawBuffer<unsigned char> >(unsigned int&, bool&, mozilla::RawBuffer<unsigned char>&&) const /dom/canvas/ClientWebGLContext.cpp:344:12
#7 0x7f04dc888bb9 in mozilla::ClientWebGLContext::UniformData(unsigned int, mozilla::WebGLUniformLocationJS const*, bool, mozilla::Range<unsigned char const> const&, unsigned int, unsigned int) const /dom/canvas/ClientWebGLContext.cpp:4557:3
#8 0x7f04dc107c0d in Uniform1i /dom/canvas/ClientWebGLContext.h:1853:3
#9 0x7f04dc107c0d in mozilla::dom::WebGL2RenderingContext_Binding::uniform1i(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/WebGL2RenderingContextBinding.cpp:15843:24
#10 0x7f04dc778618 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
#11 0x7f04e023535f in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:425:13
#12 0x7f04e0234a5d in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:512:12
#13 0x7f04e023653e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10
#14 0x7f04e022bdf6 in CallFromStack /js/src/vm/Interpreter.cpp:576:10
#15 0x7f04e022bdf6 in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3309:16
#16 0x7f04e0222cf3 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:394:13
#17 0x7f04e0234958 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:544:13
#18 0x7f04e023653e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10
#19 0x7f04e0236741 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
#20 0x7f04e03f4d21 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
#21 0x7f04dc499377 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
#22 0x7f04dcc4bc86 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
#23 0x7f04dcc4ba0a in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) /dom/events/EventListenerManager.cpp:1308:43
#24 0x7f04dcc4c709 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1505:17
#25 0x7f04dcc41704 in HandleEvent /dom/events/EventListenerManager.h:395:5
#26 0x7f04dcc41704 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:348:17
#27 0x7f04dcc40c27 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:550:16
#28 0x7f04dcc43488 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /dom/events/EventDispatcher.cpp:1085:11
#29 0x7f04de401c93 in nsDocumentViewer::LoadComplete(nsresult) /layout/base/nsDocumentViewer.cpp:1084:7
#30 0x7f04dfa31cc4 in nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult) /docshell/base/nsDocShell.cpp:6291:20
#31 0x7f04dfa317b3 in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /docshell/base/nsDocShell.cpp:5680:7
#32 0x7f04dfa3264f in non-virtual thunk to nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /docshell/base/nsDocShell.cpp
#33 0x7f04da83771c in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult) /uriloader/base/nsDocLoader.cpp:1377:3
#34 0x7f04da836caa in nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult) /uriloader/base/nsDocLoader.cpp:975:14
#35 0x7f04da835030 in nsDocLoader::DocLoaderIsEmpty(bool, mozilla::Maybe<nsresult> const&) /uriloader/base/nsDocLoader.cpp:794:9
#36 0x7f04da8361ed in nsDocLoader::OnStopRequest(nsIRequest*, nsresult) /uriloader/base/nsDocLoader.cpp:677:5
#37 0x7f04dfa5344d in nsDocShell::OnStopRequest(nsIRequest*, nsresult) /docshell/base/nsDocShell.cpp:13590:23
#38 0x7f04d959d6ca in mozilla::net::nsLoadGroup::NotifyRemovalObservers(nsIRequest*, nsresult) /netwerk/base/nsLoadGroup.cpp:614:22
#39 0x7f04d959ecb3 in mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) /netwerk/base/nsLoadGroup.cpp:518:10
#40 0x7f04db20b3f5 in mozilla::dom::Document::DoUnblockOnload() /dom/base/Document.cpp:11554:18
#41 0x7f04db1d5f53 in mozilla::dom::Document::UnblockOnload(bool) /dom/base/Document.cpp:11484:9
#42 0x7f04db1f1e1b in mozilla::dom::Document::DispatchContentLoadedEvents() /dom/base/Document.cpp:7999:3
#43 0x7f04db2a327b in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12
#44 0x7f04db2a327b in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12
#45 0x7f04db2a327b 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
#46 0x7f04d93a2282 in mozilla::SchedulerGroup::Runnable::Run() /xpcom/threads/SchedulerGroup.cpp:140:20
#47 0x7f04d93d258e in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:467:16
#48 0x7f04d93ac416 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:770:26
#49 0x7f04d93ab0d8 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:606:15
#50 0x7f04d93ab353 in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:390:36
#51 0x7f04d93d55c6 in operator() /xpcom/threads/TaskController.cpp:124:37
#52 0x7f04d93d55c6 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:531:5
#53 0x7f04d93c0ce3 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1195:16
#54 0x7f04d93c7dca in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:467:10
#55 0x7f04d9e68396 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
#56 0x7f04d9d8d0f7 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
#57 0x7f04d9d8d002 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
#58 0x7f04d9d8d002 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
#59 0x7f04de0593d8 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27
#60 0x7f04e00b9033 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:870:20
#61 0x7f04d9e6928a in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
#62 0x7f04d9d8d0f7 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
#63 0x7f04d9d8d002 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
#64 0x7f04d9d8d002 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
#65 0x7f04e00b866c in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:707:34
#66 0x55cd0fa15029 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
#67 0x55cd0fa15029 in main /browser/app/nsBrowserApp.cpp:327:18
#68 0x7f04ee1e80b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#69 0x55cd0f9f07bc in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x157bc)
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV /gfx/2d/Logging.h:752:9 in mozilla::gfx::Log<1, mozilla::gfx::CriticalLogger>::WriteLog(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
==1743070==ABORTING
Reporter | ||
Comment 1•3 years ago
|
||
Reporter | ||
Comment 2•3 years ago
|
||
Comment 3•3 years ago
|
||
Bugmon Analysis
Verified bug as reproducible on mozilla-central 20220131212843-788ab1920ef8.
Failed to bisect testcase (Testcase reproduces on start build!):
Start: babdc3b3a30001ae014cc9180992549c5e4d5045 (20210202033500)
End: bb528a123b65479d96326b5f4d5b7981538542d2 (20220131165143)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False)
Comment 4•3 years ago
|
||
The severity field is not set for this bug.
:jgilbert, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 5•3 years ago
|
||
Error:
fUniform1iv(GLint, GLsizei, const GLint *): Generated unexpected GL_INVALID_OPERATION error
Testcase:
context.shaderSource(vertex, "attribute highp vec3 aVertexNormal; attribute highp vec3 aVertexPosition; attribute highp vec2 aTextureCoord; uniform highp mat4 uNormalMatrix; uniform highp mat4 uMVMatrix; uniform highp mat4 uPMatrix; varying highp vec2 vTextureCoord; varying highp vec3 vLighting; void main(void) { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = aTextureCoord; highp vec3 ambientLight = vec3(0.6, 0.6, 0.6); highp vec3 directionalLightColor = vec3(0.5, 0.5, 0.75); highp vec3 directionalVector = vec3(0.85, 0.8, 0.75); highp vec4 transformedNormal = uNormalMatrix * vec4(aVertexNormal, 1.0); highp float directional = max(dot(transformedNormal.xyz, directionalVector), 0.0); vLighting = ambientLight + (directionalLightColor * directional); }")
context.shaderSource(fragment, "varying highp vec2 vTextureCoord; varying highp vec3 vLighting; uniform sampler2D uSampler; void main(void) { highp vec4 texelColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t)); gl_FragColor = vec4(texelColor.rgb * vLighting, texelColor.a); }")
context.linkProgram(program)
const samplerLocation = context.getUniformLocation(program, "uSampler")
context.linkProgram(program) // again?
context.uniform1i(samplerLocation, 16)
https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glUniform.xhtml:
Errors
- GL_INVALID_OPERATION is generated if there is no current program object.
- GL_INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.
- GL_INVALID_OPERATION is generated if one of the signed or unsigned integer variants of this function is used to load a uniform variable of type float, vec2, vec3, vec4, or an array of these,
or if one of the floating-point variants of this function is used to load a uniform variable of type int, ivec2, ivec3, ivec4, unsigned int, uvec2, uvec3, uvec4, or an array of these.- GL_INVALID_OPERATION is generated if one of the signed integer variants of this function is used to load a uniform variable of type unsigned int, uvec2, uvec3, uvec4, or an array of these.
GL_INVALID_OPERATION is generated if one of the unsigned integer variants of this function is used to load a uniform variable of type int, ivec2, ivec3, ivec4, or an array of these.- GL_INVALID_OPERATION is generated if location is an invalid uniform location for the current program object and location is not equal to -1.
GL_INVALID_VALUE is generated if count is less than 0.GL_INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.GL_INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.
Comment 6•3 years ago
|
||
The severity field is not set for this bug.
:jgilbert, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Comment 7•3 years ago
|
||
Bugmon Analysis
Testcase crashes using the initial build (mozilla-central 20220131165143-bb528a123b65) but not with tip (mozilla-central 20220304214025-967ae1edad41.)
The bug appears to have been fixed in the following build range:
Start: 7f1b70e843584c5da6901538e3f0b84d098884a4 (20220301194521)
End: e76373d064bc3b0da5d50c78028989efb324e5ed (20220301224524)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=7f1b70e843584c5da6901538e3f0b84d098884a4&tochange=e76373d064bc3b0da5d50c78028989efb324e5ed
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.
Description
•