Skip to content

Commit

Permalink
Fix ASAN errors in end2end tests.
Browse files Browse the repository at this point in the history
2 minor issues of reading from uninitialized memory in tests.
Removes the suppressions from the fixed tests.

Bug: chromium:1029378
Change-Id: I466ce231cfed1ce53a60732706c05b778b096805
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2055649
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
  • Loading branch information
y-novikov authored and Commit Bot committed Feb 13, 2020
1 parent 4f9608c commit d5861a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/tests/gl_tests/ComputeShaderTest.cpp
Expand Up @@ -637,10 +637,6 @@ TEST_P(ComputeShaderTest, DispatchComputeIndirect)
// Flaky crash on teardown, see http://anglebug.com/3349
ANGLE_SKIP_TEST_IF(IsD3D11() && IsIntel() && IsWindows());

// ASAN error on vulkan backend; ASAN tests only enabled on Mac Swangle
// (http://crbug.com/1029378)
ANGLE_SKIP_TEST_IF(IsOSX() && isSwiftshader());

GLTexture texture;
GLFramebuffer framebuffer;
const char kCSSource[] = R"(#version 310 es
Expand All @@ -654,7 +650,7 @@ void main()
ANGLE_GL_COMPUTE_PROGRAM(program, kCSSource);
glUseProgram(program.get());
const int kWidth = 4, kHeight = 6;
GLuint inputValues[] = {0};
GLuint inputValues[kWidth][kHeight] = {};

GLBuffer buffer;
glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, buffer);
Expand Down
9 changes: 3 additions & 6 deletions src/tests/gl_tests/GLSLTest.cpp
Expand Up @@ -3280,10 +3280,6 @@ TEST_P(GLSLTest_ES31, ArraysOfArraysSampler)
// Test that structs containing arrays of samplers work as expected.
TEST_P(GLSLTest_ES31, StructArraySampler)
{
// ASAN error on vulkan backend; ASAN tests only enabled on Mac Swangle
// (http://crbug.com/1029378)
ANGLE_SKIP_TEST_IF(IsOSX() && isSwiftshader());

constexpr char kFS[] =
"#version 310 es\n"
"precision mediump float;\n"
Expand All @@ -3299,13 +3295,14 @@ TEST_P(GLSLTest_ES31, StructArraySampler)
glUseProgram(program.get());
GLTexture textures[2];
GLColor expected = MakeGLColor(32, 64, 96, 255);
GLubyte data[6] = {}; // Two bytes of padding, so that texture can be initialized with 4 bytes
memcpy(data, expected.data(), sizeof(expected));
for (int i = 0; i < 2; i++)
{
glActiveTexture(GL_TEXTURE0 + i);
glBindTexture(GL_TEXTURE_2D, textures[i]);
// Each element provides two components.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
expected.data() + 2 * i);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, data + 2 * i);
std::stringstream uniformName;
uniformName << "test.data[" << i << "]";
// Then send it as a uniform
Expand Down

0 comments on commit d5861a6

Please sign in to comment.