enable gcc7 with address sanitizer

because of deffered deletion some variables are dereferenced after
leaving test scope. this causes invalid stack memory accesses reported
by GCC 7.

Change-Id: I183be8ec3c815a41a75a1f71635d9afb560c7457
This commit is contained in:
Artur Harasimiuk 2018-02-13 13:02:40 +01:00 committed by sys_ocldev
parent 56b34ee49f
commit 92198537a6
2 changed files with 11 additions and 9 deletions

View File

@ -31,7 +31,7 @@ components:
branch: infra
clean_on_sync: true
dest_dir: infra
revision: b78ce68f547ede0beabb9333a6568703537ac515
revision: 67529f98817725900c58e7fdb1b8eddbae448971
type: git
internal:
branch: master

View File

@ -135,6 +135,9 @@ class DrmMemoryManagerFixture : public MemoryManagementFixture {
this->mock = nullptr;
MemoryManagementFixture::TearDown();
}
protected:
DrmMockCustom::IoctlResExt ioctlResExt = {0, 0};
};
typedef Test<DrmMemoryManagerFixture> DrmMemoryManagerTest;
@ -781,9 +784,8 @@ TEST_F(DrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFrom64B
TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWithHostPtrAndAllocUserptrFailsThenFails) {
mock->ioctl_expected = 1;
DrmMockCustom::IoctlResExt ioctlToPass = {0, -1};
mock->ioctl_res_ext = &ioctlToPass;
this->ioctlResExt = {0, -1};
mock->ioctl_res_ext = &ioctlResExt;
auto size = 10u;
void *host_ptr = (void *)0x1000;
@ -795,9 +797,8 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWithHo
TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationAndAllocUserptrFailsThenFails) {
mock->ioctl_expected = 1;
DrmMockCustom::IoctlResExt ioctlToPass = {0, -1};
mock->ioctl_res_ext = &ioctlToPass;
this->ioctlResExt = {0, -1};
mock->ioctl_res_ext = &ioctlResExt;
auto size = 10u;
auto allocation = memoryManager->allocate32BitGraphicsMemory(size, nullptr);
@ -1469,8 +1470,9 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerSupportingVirutalPaddingWhenItIsR
TEST_F(DrmMemoryManagerTest, givenMemoryManagerSupportingVirutalPaddingWhenAllocUserptrFailsThenReturnsNullptr) {
mock->ioctl_expected = 7;
DrmMockCustom::IoctlResExt ioctlToFail = {2, -1};
mock->ioctl_res_ext = &ioctlToFail;
this->ioctlResExt = {2, -1};
mock->ioctl_res_ext = &ioctlResExt;
//first let's create normal buffer
auto bufferSize = MemoryConstants::pageSize;