impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Robinson (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-5666: ASAN poisoning for MemPool and BufferPool
Date Sun, 13 Aug 2017 17:01:03 GMT
Henry Robinson has submitted this change and it was merged.

Change subject: IMPALA-5666: ASAN poisoning for MemPool and BufferPool
......................................................................


IMPALA-5666: ASAN poisoning for MemPool and BufferPool

"If you poison us, do we not die?"

* Use ASAN_[UN]POISON_MEMORY_REGION to indicate to ASAN runtime that
  memory is not 'valid' from Impala's perspective (but still valid from
  kernel's perspective).

* Add this to MemPool and BufferPoolAllocator. For both, memory goes
  through the following lifecycle: when it is allocated from the OS and
  returned to the user, it must be unpoisoned. When the user returns it
  to a cache, it becomes poisoned. When the cache is freed to the OS, it
  must be unpoisoned again (otherwise future allocations elsewhere in
  the system might return poisoned memory).

* Also add checks to FreePool which uses a MemPool underneath, but has
  its own freelist cache. Fix a couple of bugs in free-pool-test that
  these checks uncovered.

Testing:

* Tests that only run if ASAN is enabled to confirm that poisoning
  catches simple use-after-return errors. These are 'death' tests which
  catch expected process exits.

Change-Id: I8d5a28dfee2b7c631981aac75524bde9acc0b36a
Reviewed-on: http://gerrit.cloudera.org:8080/7591
Tested-by: Impala Public Jenkins
Reviewed-by: Henry Robinson <henry@cloudera.com>
---
M be/CMakeLists.txt
M be/src/runtime/bufferpool/buffer-allocator-test.cc
M be/src/runtime/bufferpool/buffer-allocator.cc
M be/src/runtime/bufferpool/buffer-pool.h
M be/src/runtime/bufferpool/free-list.h
M be/src/runtime/free-pool-test.cc
M be/src/runtime/free-pool.h
M be/src/runtime/mem-pool-test.cc
M be/src/runtime/mem-pool.cc
M be/src/runtime/mem-pool.h
10 files changed, 189 insertions(+), 31 deletions(-)

Approvals:
  Impala Public Jenkins: Verified
  Henry Robinson: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/7591
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d5a28dfee2b7c631981aac75524bde9acc0b36a
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>

Mime
View raw message