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_test.cc b/libartbase/base/mem_map_test.cc
index d956126..4a78bdc 100644
--- a/libartbase/base/mem_map_test.cc
+++ b/libartbase/base/mem_map_test.cc
@@ -471,31 +471,33 @@
// cannot allocate in the 2GB-4GB region.
TEST_DISABLED_FOR_MIPS();
+ // This test may not work under Valgrind.
+ // TODO: Valgrind is no longer supported, but Address Sanitizer is:
+ // check whether this test works with ASan.
+ TEST_DISABLED_FOR_MEMORY_TOOL();
+
CommonInit();
- // This test may not work under valgrind.
- if (RUNNING_ON_MEMORY_TOOL == 0) {
- constexpr size_t size = 0x100000;
- // Try all addresses starting from 2GB to 4GB.
- size_t start_addr = 2 * GB;
- std::string error_msg;
- std::unique_ptr<MemMap> map;
- for (; start_addr <= std::numeric_limits<uint32_t>::max() - size; start_addr += size) {
- map.reset(MemMap::MapAnonymous("MapAnonymousExactAddr32bitHighAddr",
- reinterpret_cast<uint8_t*>(start_addr),
- size,
- PROT_READ | PROT_WRITE,
- /*low_4gb*/true,
- false,
- &error_msg));
- if (map != nullptr) {
- break;
- }
+ constexpr size_t size = 0x100000;
+ // Try all addresses starting from 2GB to 4GB.
+ size_t start_addr = 2 * GB;
+ std::string error_msg;
+ std::unique_ptr<MemMap> map;
+ for (; start_addr <= std::numeric_limits<uint32_t>::max() - size; start_addr += size) {
+ map.reset(MemMap::MapAnonymous("MapAnonymousExactAddr32bitHighAddr",
+ reinterpret_cast<uint8_t*>(start_addr),
+ size,
+ PROT_READ | PROT_WRITE,
+ /*low_4gb*/true,
+ false,
+ &error_msg));
+ if (map != nullptr) {
+ break;
}
- ASSERT_TRUE(map.get() != nullptr) << error_msg;
- ASSERT_GE(reinterpret_cast<uintptr_t>(map->End()), 2u * GB);
- ASSERT_TRUE(error_msg.empty());
- ASSERT_EQ(BaseBegin(map.get()), reinterpret_cast<void*>(start_addr));
}
+ ASSERT_TRUE(map.get() != nullptr) << error_msg;
+ ASSERT_GE(reinterpret_cast<uintptr_t>(map->End()), 2u * GB);
+ ASSERT_TRUE(error_msg.empty());
+ ASSERT_EQ(BaseBegin(map.get()), reinterpret_cast<void*>(start_addr));
}
TEST_F(MemMapTest, MapAnonymousOverflow) {