Revert^2 "Remove support for Valgrind in ART."
- Disable test configuration art-gtest-valgrind64
(art-gtest-valgrind32 was already disabled).
- Remove Makefile logic regarding testing with Valgrind.
- Remove occurrences of `TEST_DISABLED_FOR_MEMORY_TOOL_VALGRIND`.
- Replace occurrences of `TEST_DISABLED_FOR_MEMORY_TOOL_ASAN` with
`TEST_DISABLED_FOR_MEMORY_TOOL`.
- Replace the potentially dynamically evaluated
`RUNNING_ON_MEMORY_TOOL` expression with constant
`kRunningOnMemoryTool`.
- Simplify and fold the logic of
`art::ArenaAllocatorMemoryToolCheckImpl` and
`art::ArenaAllocatorMemoryToolCheck` into
`art::ArenaAllocatorMemoryTool`.
- Adjust comments regarding memory tools.
- Remove Valgrind suppression files.
- Remove `--callgrind` option from tools/art.
This reverts commit 8b362a87d52a6668ffd2283ef6ffc274315f41c8.
Change-Id: I23c76845e6ccf766f19b22b58a0d5161f60842a9
Test: art/test.py
Test: art/test/testrunner/run_build_test_target.py art-asan
Bug: 77856586
Bug: 29282211
diff --git a/libartbase/base/mem_map.cc b/libartbase/base/mem_map.cc
index c455fed..9ba1d6c 100644
--- a/libartbase/base/mem_map.cc
+++ b/libartbase/base/mem_map.cc
@@ -460,7 +460,7 @@
(expected_ptr == nullptr) ? nullptr : (expected_ptr - page_offset);
size_t redzone_size = 0;
- if (RUNNING_ON_MEMORY_TOOL && kMemoryToolAddsRedzones && expected_ptr == nullptr) {
+ if (kRunningOnMemoryTool && kMemoryToolAddsRedzones && expected_ptr == nullptr) {
redzone_size = kPageSize;
page_aligned_byte_count += redzone_size;
}
@@ -649,9 +649,11 @@
bool MemMap::Sync() {
bool result;
if (redzone_size_ != 0) {
- // To avoid valgrind errors, temporarily lift the lower-end noaccess protection before passing
- // it to msync() as it only accepts page-aligned base address, and exclude the higher-end
- // noaccess protection from the msync range. b/27552451.
+ // To avoid errors when running on a memory tool, temporarily lift the lower-end noaccess
+ // protection before passing it to msync() as it only accepts page-aligned base address,
+ // and exclude the higher-end noaccess protection from the msync range. b/27552451.
+ // TODO: Valgrind is no longer supported, but Address Sanitizer is:
+ // check whether this special case is needed for ASan.
uint8_t* base_begin = reinterpret_cast<uint8_t*>(base_begin_);
MEMORY_TOOL_MAKE_DEFINED(base_begin, begin_ - base_begin);
result = msync(BaseBegin(), End() - base_begin, MS_SYNC) == 0;