Skip to content

Commit d5861a6

Browse files
y-novikovCommit Bot
authored andcommitted
Fix ASAN errors in end2end tests.
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 <[email protected]> Commit-Queue: Yuly Novikov <[email protected]>
1 parent 4f9608c commit d5861a6

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/tests/gl_tests/ComputeShaderTest.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,6 @@ TEST_P(ComputeShaderTest, DispatchComputeIndirect)
637637
// Flaky crash on teardown, see http://anglebug.com/3349
638638
ANGLE_SKIP_TEST_IF(IsD3D11() && IsIntel() && IsWindows());
639639

640-
// ASAN error on vulkan backend; ASAN tests only enabled on Mac Swangle
641-
// (http://crbug.com/1029378)
642-
ANGLE_SKIP_TEST_IF(IsOSX() && isSwiftshader());
643-
644640
GLTexture texture;
645641
GLFramebuffer framebuffer;
646642
const char kCSSource[] = R"(#version 310 es
@@ -654,7 +650,7 @@ void main()
654650
ANGLE_GL_COMPUTE_PROGRAM(program, kCSSource);
655651
glUseProgram(program.get());
656652
const int kWidth = 4, kHeight = 6;
657-
GLuint inputValues[] = {0};
653+
GLuint inputValues[kWidth][kHeight] = {};
658654

659655
GLBuffer buffer;
660656
glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, buffer);

src/tests/gl_tests/GLSLTest.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,10 +3280,6 @@ TEST_P(GLSLTest_ES31, ArraysOfArraysSampler)
32803280
// Test that structs containing arrays of samplers work as expected.
32813281
TEST_P(GLSLTest_ES31, StructArraySampler)
32823282
{
3283-
// ASAN error on vulkan backend; ASAN tests only enabled on Mac Swangle
3284-
// (http://crbug.com/1029378)
3285-
ANGLE_SKIP_TEST_IF(IsOSX() && isSwiftshader());
3286-
32873283
constexpr char kFS[] =
32883284
"#version 310 es\n"
32893285
"precision mediump float;\n"
@@ -3299,13 +3295,14 @@ TEST_P(GLSLTest_ES31, StructArraySampler)
32993295
glUseProgram(program.get());
33003296
GLTexture textures[2];
33013297
GLColor expected = MakeGLColor(32, 64, 96, 255);
3298+
GLubyte data[6] = {}; // Two bytes of padding, so that texture can be initialized with 4 bytes
3299+
memcpy(data, expected.data(), sizeof(expected));
33023300
for (int i = 0; i < 2; i++)
33033301
{
33043302
glActiveTexture(GL_TEXTURE0 + i);
33053303
glBindTexture(GL_TEXTURE_2D, textures[i]);
33063304
// Each element provides two components.
3307-
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
3308-
expected.data() + 2 * i);
3305+
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, data + 2 * i);
33093306
std::stringstream uniformName;
33103307
uniformName << "test.data[" << i << "]";
33113308
// Then send it as a uniform

0 commit comments

Comments
 (0)