[Piglit] [PATCH 07/11] glslparsertest: Reproduce a segfault in Mesa's GLSL linker

Ian Romanick idr at freedesktop.org
Wed Aug 21 09:07:59 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

When there are way too many samplers, the linker misbehaves... walking
all over the stack and crashing.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/glslparsertest/glsl2/too-many-samplers.frag | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 tests/glslparsertest/glsl2/too-many-samplers.frag

diff --git a/tests/glslparsertest/glsl2/too-many-samplers.frag b/tests/glslparsertest/glsl2/too-many-samplers.frag
new file mode 100644
index 0000000..1b4f42a
--- /dev/null
+++ b/tests/glslparsertest/glsl2/too-many-samplers.frag
@@ -0,0 +1,13 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.10
+// check_link
+// [end config]
+
+uniform sampler2D s[666];
+uniform int i;
+
+void main()
+{
+	gl_FragColor = texture2D(s[i], vec2(0.0));
+}
-- 
1.8.1.4



More information about the Piglit mailing list